scrollToExact not working

I’m using appium version 1.4.16 with java-client 3.3.0.
I’m testing on a real device Note 4 (SM-N910V) running API 21, Android version 5.0.1.

When I get to the page I want to scroll on I issue the following: (my element is at the bottom of the page).

((AndroidDriver<?>) driver).scrollToExact(“MORTGAGE LOAN2”);

I get different scenarios.

  1. Almost all the time it scrolls down and up a couple of lines (about 3 times, sometimes less) then bombs.
  2. Sometimes it does option 1 then scrolls all the way to the bottom, then all the way back to the top then back down to the object. This is painful as the list is long. I would expect the behavior to stop once the string is in view.
  3. I’ve also seen it be successful and stop once it scrolls to the string in view. However option scenario 1 still occurs everytime where it scrolls up and down a couple times (couple lines) before starting to scroll down.

Below is the stack trace for an instance were option 1 bombed.

Tests run: 3, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 66.199 sec <<< FAILURE! - in TestSuite
verifyAccountTotalsChangeWhenHidingCCLoan( Time elapsed: 20.054 sec <<< FAILURE!
org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 17.80 seconds
For documentation on this error, please visit:
Build info: version: ‘2.48.2’, revision: ‘41bccdd10cf2c0560f637404c2d96164b67d9d67’, time: ‘2015-10-09 13:08:06’
System info: host: ‘xxxxx-MBP.domain’, ip: ‘192.xxxx.0.xx’, ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.2’, java.version: ‘1.8.0_65’
Driver info:
Capabilities [{, networkConnectionEnabled=true, warnings={},, databaseEnabled=false, deviceName=Android, platform=LINUX,, desired={,, autoLaunch=false, platformVersion=21,, autoWebview=false, platformName=Android, deviceName=Android}, autoLaunch=false, platformVersion=21, webStorageEnabled=false, locationContextEnabled=false, browserName=Android, takesScreenshot=true, javascriptEnabled=true, autoWebview=false, platformName=Android}]
Session ID: 3bb257e0-857d-49a2-aa06-36e5fdbe7e58
*** Element info: {Using=-android uiautomator, value=new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().description(“MORTGAGE LOAN2”).instance(0));new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().text(“MORTGAGE LOAN2”).instance(0));}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at io.appium.java_client.DefaultGenericMobileDriver.execute(
at io.appium.java_client.AppiumDriver.execute(
at org.openqa.selenium.remote.RemoteWebDriver.findElement(

Any help would be appreciated.


File an issue on github

1 Like

Okay, I just submitted the issue.

1 Like