Touch actions are not working via scripts but working via ARC(Appium ruby console)

Hello,

I am using below code to perform swipe

  1. Appium::TouchAction.new.press(x: 166, y: 600).wait(1000).move_to(x: 660, y: 620).release.perform

  2. Appium::TouchAction.new.swipe(:start_x => 166, :start_y => 600, :end_x => 660, :end_y => 620, :duration => 1000).perform

Both are working fine on arc(appium ruby console)
but not working while I am running thorough scripts. It is throwing below error

C:/Ruby200/lib/ruby/gems/2.0.0/gems/appium_lib-7.0.0/lib/appium_lib/device/touch_actions.rb:119:in perform': undefined methodtouch_actions’ for nil:NilClass (NoMethodError)
from swipe.rb:45:in `’

Could you please help. Thanks in Advance

Thanks,
Soumyaranjan

1 Like