'How to scroll to an element with appium using webdriveriO
I am using following command: browser.scroll('#login');
I am getting this error - Not yet implemented. Please help us: http://appium.io/get-involved.html
Solution 1:[1]
public void scroll()
{
Dimension dimensions = driver.manage().window().getSize();
System.out.println(dimensions);
Double screenHeightStart = dimensions.getHeight() * 0.5;
int scrollStart = screenHeightStart.intValue();
Double screenHeightEnd = dimensions.getHeight() * 0.2;
int scrollEnd = screenHeightEnd.intValue();
((IOSDriver<MobileElement>) driver).swipe(0, scrollStart, 0, scrollEnd, 1000);
}
Solution 2:[2]
Use this command:
browser.execute("mobile: scroll", {direction: 'down'});
Solution 3:[3]
For IOS: browser.execute("mobile: scroll", {direction: 'down'});
For Android I've tried so many ways myself but did not get any robust result.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | user7682978 |
| Solution 2 | javimuu |
| Solution 3 | atul binwal |
