iOS Safari Mobile web: start point is not within the bounds of the screen

363 views
Skip to first unread message

RG

unread,
Apr 14, 2014, 12:17:29 PM4/14/14
to appium-...@googlegroups.com
I'm using appium (18.1, from source) to automate mobile web on safari and chrome. It seems that element.click only works on safari if the element is in view - are other people finding this or are there good workarounds that I haven't found yet?

With the example of github's site (for non-logged in users), there is a 'enterprise' button at the bottom of the page on iPhone 4" Simulator and Samsung S4 (real)

// click on enterprise button, out of view
driver.find_elements(:xpath, "//a[@class='button blue']")[2].click # Works on android, but not on iPhone
post /element/5014/click
Selenium::WebDriver::Error::JavascriptError: start point is not within the bounds of the screen

// attempting to use scrollTo, not working for me on either android or ios, ios error below
driver.execute_script "mobile: scrollTo", driver.find_elements(:xpath, "//a[@class='button blue']")[2].ref
Selenium::WebDriver::Error::JavascriptError: 'null' is not an object (evaluating 'au.getElement('').scrollToVisible')

// yet...even when the element is out of view
driver.find_elements(:xpath, "//a[@class='button blue']")[2].displayed?
// true on both platforms

Thanks in advance

RG

Jonathan Lipps

unread,
Apr 14, 2014, 1:08:45 PM4/14/14
to RG, appium-...@googlegroups.com
you might try playing with the 'nonSyntheticWebClick' capability, as it affects how touches are effected in safari.

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/d/optout.

balaji KM

unread,
Apr 15, 2014, 7:48:36 AM4/15/14
to appium-...@googlegroups.com, RG
I am also facing the same issue. I tried with capability 'nonSyntheticWebClick'  true / false and I am getting the same error. 

RG

unread,
Apr 17, 2014, 4:43:54 AM4/17/14
to appium-...@googlegroups.com, RG
Having nonSyntheticWebClick: false is working for me on simulators. Have not tried it with real devices yet.

Jonathan Lipps

unread,
Apr 17, 2014, 2:33:22 PM4/17/14
to RG, appium-...@googlegroups.com
fyi: this is the only possible behavior anyway with real devices, since we can't automate the native layer of safari on a real device.
Reply all
Reply to author
Forward
0 new messages