我不知道如何结束滚动操作,如果存在特定的网页元素,则需要结束滚动操作。
while(AppiumHelper.isElementPresent(driver,By.name("Comment")) == false){
System.out.println("1......");
WebElement element = driver
.findElementByName("save_button"); JavascriptExecutor js = (JavascriptExecutor) driver;
HashMap<String, String> scrollObjects = new HashMap<String, String>();
scrollObjects.put("direction", "down");
scrollObjects.put("element",
((RemoteWebElement) element).getId());
js.executeScript("mobile: scroll", scrollObjects);
}