Tried a simple appium test.
driver.scrollTo(“HockeyApp”);
gives the following error. It says that the element is not found.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:27)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:269)
at io.appium.java_client.DefaultGenericMobileElement.execute(DefaultGenericMobileElement.java:27)
at io.appium.java_client.MobileElement.execute(MobileElement.java:1)
at io.appium.java_client.ios.IOSElement.execute(IOSElement.java:1)
at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:172)
at io.appium.java_client.ios.IOSElement.findElementByIosUIAutomation(IOSElement.java:20)
at io.appium.java_client.ios.IOSElement.scrollTo(IOSElement.java:39)
at io.appium.java_client.ios.IOSElement.scrollTo(IOSElement.java:1)
at io.appium.java_client.ios.IOSDriver.scrollTo(IOSDriver.java:50)
at com.test.appium.Extra.IosDriverTest.test(IosDriverTest.java:92)
On the appium server side. This is the log for reference.
info: [debug] Pushing command to appium work queue: "au.getElementByUIAutomation('.scrollToElementWithPredicate(\\\"name CONTAINS \\'HockeyApp\\'\\\")', '22')"
info: [debug] Sending command to instruments: au.getElementByUIAutomation('.scrollToElementWithPredicate(\"name CONTAINS \'HockeyApp\'\")', '22')
info: [debug] [INST] 2015-07-27 06:12:49 +0000 Debug: Got new command 54 from instruments: au.getElementByUIAutomation('.scrollToElementWithPredicate(\"name CONTAINS \'HockeyApp\'\")', '22')
info: [debug] [INST] 2015-07-27 06:12:49 +0000 Debug: evaluating au.getElementByUIAutomation('.scrollToElementWithPredicate(\"name CONTAINS \'HockeyApp\'\")', '22')
info: [debug] [INST] 2015-07-27 06:12:49 +0000 Debug: byUIAutomation: evaluating code: $.getElement('22').scrollToElementWithPredicate("name CONTAINS 'HockeyApp'")
info: [debug] [INST] 2015-07-27 06:12:49 +0000 Debug: evaluation finished
info: [debug] [INST] 2015-07-27 06:12:49 +0000 Debug: responding with:
info: [debug] [INST] 2015-07-27 06:12:49 +0000 Debug: Running system command #55: /usr/local/bin/node /Users/nakeer/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{"status":0,"value":""}...
info: [debug] Socket data received (25 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":""}
info: [debug] Waited for 721ms so far
info: [debug] Pushing command to appium work queue: "au.getElementByUIAutomation('.scrollToElementWithPredicate(\\\"name CONTAINS \\'HockeyApp\\'\\\")', '22')"
info: [debug] Sending command to instruments: au.getElementByUIAutomation('.scrollToElementWithPredicate(\"name CONTAINS \'HockeyApp\'\")', '22')
info: [debug] Socket data received (25 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {"status":0,"value":""}
info: [debug] Condition unmet after 1303ms. Timing out.
info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":""},"sessionId":"3c9a766d-8b7a-48da-8b14-d98d7c6addd0"}