[英]Scrolling issue in SeeTest Automation using Selenium webdriver
我在使用移动Webdriver + Selenium的Android自动化的SeeTest Automation
面临滚动问题。
我也尝试过JScriptExcecutor
和Scroll方法,但是我无法滚动,因此有人可以为此提供帮助吗?
您可以使用屏幕尺寸在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(); 在您的测试案例中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.