Javascript 含硒的IE10中的Moveto元素
我在IE10中遇到Webdriver方法moveto的问题。 我打算做的是滚动一个当前不可见且位于溢出div中的项 HTML示例:Javascript 含硒的IE10中的Moveto元素,javascript,html,css,selenium,Javascript,Html,Css,Selenium,我在IE10中遇到Webdriver方法moveto的问题。 我打算做的是滚动一个当前不可见且位于溢出div中的项 HTML示例: <div id="container" style="height: 500px; width: 200px; overflow: auto;"> <div id="first" style="height: 1000px; width: 200px; background-color: red;"></div> <
<div id="container" style="height: 500px; width: 200px; overflow: auto;">
<div id="first" style="height: 1000px; width: 200px; background-color: red;"></div>
<div id="second" style="height: 200px; width: 200px; background-color: green;"></div>
</div>
在上面的例子中,我想在第二个元素上使用moveto。这在firefox中运行得很好,但在IE10中不行。我正在使用WebDriverJs和Selenium 2.33.0。使用以下代码滚动到元素
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("window.scrollBy(0,2000)", "");
向下滚动到元素
上卷
JavascriptExecutor jse = (JavascriptExecutor)driver;
jse.executeScript("window.scrollBy(2000,0)", "");
我也考虑过这一点,但我宁愿不使用javascript。它不应该和moveto一起工作吗?