我在使用Mobile Webdriver + Selenium的安卓自动化SeeTest Automation中遇到了滚动问题。
我已经尝试了JScriptExcecutor,滚动的方法,但我不能滚动,所以任何人可以帮助我在这方面?
发布于 2016-06-09 13:03:56
你可以使用屏幕尺寸在android设备中滚动,找到下面的功能,
public void scroll() throws IOException {
try {
Dimension dimensions = driver.manage().window().getSize();
System.out.println("Size of Window= " +dimensions);
int Startpoint = (int) (dimensions.getHeight() * 0.5);
System.out.println("Size of scrollStart= " +Startpoint );
int scrollEnd = (int) (dimensions.getHeight() * 0.2);
System.out.println("Size of cscrollEnd= " + scrollEnd);
driver.swipe(0, Startpoint,0,scrollEnd,1000);
} catch (IOException e) {
}
}将此代码添加到您的代码中,只需在您的测试用例中使用scroll()
https://stackoverflow.com/questions/37716789
复制相似问题