在c#中使用selenium webdriver滚动网页

时间:2016-05-26 04:43:35

标签: c# selenium-webdriver

如何使用c#中的selenium web驱动程序滚动网页?目前我无法向下滚动网页。我不需要知道如何滚动元素。

1 个答案:

答案 0 :(得分:2)

您实际上可以做的是,您可以检查元素,直到您想要向下滚动并执行操作,

WebElement element = driver.findElement(By.id("youElementID"));
Actions act = new Actions(driver);
act.moveToElement(element);
act.perform();