我想使用此代碼滾動頁面向下滾動我的網頁和IM它不工作如何,但向下滾動使用硒的webdriver與Java
public ViewBasketSentToMePageObject viewSlideShare() throws InterruptedException {
Thread.sleep(500l);
Actions action1 =new Actions(getDriver());
action1.keyDown(Keys.CONTROL).sendKeys(String.valueOf('\u0030')).build().perform();
List<WebElement> function = getDriver().findElements(By.xpath("//a [@ng-click='onItemClick()']"));
function.get(13).findElement(By.xpath("//img [@ng-src='resources/images/slideshare-icon-small.png']")).click();
return getFactory().create(ViewBasketSentToMePageObject.class);
}
尋找幫助
您的問題早先在這裏解決:http://stackoverflow.com/questions/12293158/page-scroll-up-or-down-in-webdriver-selenium-2-using-java – maximkou 2013-04-22 06:12:13