Created
April 11, 2014 13:20
-
-
Save zevnull/10468282 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HashMap<String, String> scrollObject = new HashMap<String, String>(); | |
//Must be an element with scrollable property; Android (ListView,ScrollabeView) IOS (UIAScrollableView | |
RemoteWebElement element = (RemoteWebElement) driver.findElement(By.[id/name/etc](scrollableElement)); | |
JavascriptExecutor js = (JavascriptExecutor) driver; | |
String widId = ((RemoteWebElement) element).getId(); | |
//Text for search on the screen | |
scrollObject.put("text", text); | |
scrollObject.put("element", widId); | |
js.executeScript("mobile: scrollTo", scrollObject); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment