-1

I am trying to implement below move_to action https://www.rubydoc.info/gems/appium_lib/9.3.8/Appium%2FTouchAction:move_to

Appium::TouchAction.new.press(x: 176, y: 200).move_to(50).perform

but it is giving error

NoMethodError:
       undefined method `key?' for 100:Integer

I want to move/swipe screen on iOS Simulator from one co-ordinates to other co-ordinates.

paul
  • 4,333
  • 16
  • 71
  • 144

2 Answers2

0

The link you posted clearly states that move_to expects a hash with :x and :y as parameters, just like you passed to press.

Appium::TouchAction.new.press(x: 176, y: 200).move_to(x: 176, y: 200).perform
Felipe Zavan
  • 1,654
  • 1
  • 14
  • 33
0

The syntax for TouchAction is as follows (in python):

touch = TouchAction(driver)
touch.press(x=473, y=1396).move_to(x=468, y=705).release().perform()

The syntax remains the same for ruby with paramenters for press and move_to class

Libin Thomas
  • 829
  • 9
  • 18