TouchAction.swipe returning "Not yet implemented" error

Hi all,

I’m having issues trying to implement swipes in my tests on both iOS and Android. Below I have where I am instantiating my driver, and also the method I’m using to swipe:

caps = {
    'platformName' => 'Android',
    'deviceName' => 'ab41ecf4',
    'platformVersion' => '5.0',
    'browserName' => 'chrome'
}
$appium = Appium::Driver.new(appium_port: 4723, caps: caps)
$browser = $appium.start_driver

touch = Appium::TouchAction.new.swipe(:start_x => x, :start_y => start, :end_x => x, :end_y => finish, :touchCount => 1, :duration => 500)
touch.perform

The error I’m getting is “Not yet implemented. Please help us: http://appium.io/get-involved.html (Selenium::WebDriver::Error::UnknownError)”. I’ve also tried $driver.swipe and got the same issue. Using Appium 1.4.0.

Any help would be greatly appreciated!

You need to switch to the NATIVE context.

@sebv Sorry, realised it’s set_context. When I switch to NATIVE_APP I get the error:

Invalid locator strategy: css selector (Selenium::WebDriver::Error::UnknownCommandError)

EDIT I just got the coordinates wrong. Thanks a lot!

Please try

Appium::TouchAction.new.press(x: start_x, y: start_y).wait(100).move_to(x: end_x, y: end_y).release.perform 

or you can simply use `swipe(start_x: value_for_starting_X, start_y: value_for_starting_Y , end_x: value_for_ending_X, end_y: value_for_ending_Y, duration: 1)

Thanks,
Donald