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

I've searched high and low and can't find the doc section about it.

execute_script 'mobile: scroll', direction: 'down'

is what I'm calling now but it scrolls far too long. how can I say set the duration of the scroll? Or scroll until I find an element. What are other interesting things possible with the execute script, and where can I find the documents on it?

Any help much appreciated.

  • created

    Apr '17
  • last reply

    Apr '17
  • 4

    replies

  • 756

    views

  • 3

    users

  • 1

    link

Thanks! I'm looking for something in the ruby appium_lib though, but this points in the right direction

Here's a ruby example of scrolling explicitly.

  size = appium_driver.driver.manage.window.size
  width = size.width
  start_x = end_x = (width / 2).to_int
  (start_y, end_y) = [(size.height * 0.8).to_int, (size.height * 0.2).to_int]
  Appium::TouchAction.new.swipe(start_x:  start_x,
                                start_y:  start_y,
                                end_x: end_x,
                                end_y: end_y,
                                duration: 1000)