This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 6
Dec 2017

Hello there! I am new to appium(Ruby Cucumber for Android) using Appium v1.7.1 on a Nexus 5(OS 5.1) and I can’t get my code to swipe from the Left to the right to work using percents.

ie

Appium::TouchAction.new.swipe(start_x: 0.1, start_y: 0.5, offset_x: 0.99, offset_y: 0.5, duration:1000).perform

but

Appium::TouchAction.new.swipe(start_x: 10, start_y: 0.5, offset_x: 900, offset_y: 0.5, duration:1000).perform

works. Which is problematic because if I try to test on a device with a smaller screen it goes off screen and the step fails. Any help would be greatly appreciated!

  • created

    Dec '17
  • last reply

    Oct '18
  • 5

    replies

  • 908

    views

  • 4

    users

  • 1

    link

Have you thought about getting the screen size and adjusting your start_x accordingly?

That would definitely be a good way around the issue. Thank you!

It just deeply bothers me that, that fails but my right to left works using this:

Appium::TouchAction.new.swipe(start_x: 0.90 , start_y: 0.5, offset_x: 0.5, offset_y: 0.5, duration:3500).perform

PS: Ignore the stupid long duration, one of the tablets I test on requires this for it to not skip pages.

16 days later
10 months later