Hi I want to know how to scroll in a webview using Ruby

Using the simulator for either the in the inspector or the manual server mode ->

  1. ios 8.1 for the simulator

  2. xcode 6.1

  3. for the inspector i’m using Appium 1.3.5
    with the inspector nothing happen when trying to scroll or swipe…

    with the manual mode with ruby while trying the codes below still no results,
    

    execute_script “mobile: scrollTo”, :element => find_element(:xpath, “//UIAApplication[1]/UIAWindow[2]/UIAScrollView[1]/UIAScrollView[2]/UIAWebView[1]”).ref

Appium::TouchAction.new.swipe(startX: 50, startY: 84, endX: 50, endY: 400, :duration => 5000).perform

Appium::TouchAction.new.swipe(:start_x => 200, :start_y => 200, :end_x => 180, :end_y => 180, :touchCount => 1, :duration => 1000).perform()
even if i try using the coordinates of elements found in the list of the webview, i will get error of out bound screen…

Coordinate for invisible element:

continue = driver.find_element(:xpath, ‘//UIALink[@name=“Continue as Guest”]’)
continue.location

driver.execute_script ‘mobile: tap’, :tapCount => 1, :touchCount => 1, :duration => 0.5, :x => 21, :y => 43

:x => 101.953125, :y => 992.09375

Appium::TouchAction.new :x => 285, :y => 447, :fingers => 1, :tapCount => 1, :duration => 0.5

Selenium::WebDriver::Error::JavascriptError: start point is not within the bounds of the screen

is there any way to solved this issue???

Can someone help me pls…

Ricardo

driver.execute_script(“mobile: scrollTo”,:element => continue.ref) <- no error but conflict with visible element!!!

when running the syntax above the cursor stop in the Badge Number field, no error msg is popup…

i’m coding in ruby…

I’m using Python, but see my comments in this thread: Mobile: scrollTo fails in iOS hybrid webview

It works!!! Coooooooool

THank you Christopher for your help…

Glad I could help. Make sure to pay it forward. :slight_smile: