【发布时间】:2014-07-12 22:15:54
【问题描述】:
我尝试在 Internet Explorer 10 中使用 javascript 滚动(x,y)。但是,当我尝试为网站执行脚本时它不起作用。 IE 中的等价物是什么?它是 Java Selenium 测试的一部分。我需要在页面中滚动。所以,我通过使用 javascript executor 执行 javascript 代码来做到这一点。
for(int i=0;i<X;i+=Y)
String cmd = "window.scrollTo(0,"+i+")";
((JavascriptExecutor) driver).executeScript(cmd);
我在测试中使用上面的代码来滚动页面。但是,在 Internet Explorer IE10 中它不起作用。
【问题讨论】:
-
为什么要否决这个问题?
标签: java javascript html css selenium-webdriver