Selenium RC drag and drop:
作者: Max.Bai
时间: 2014/06
WebDriver can't action the element when out of view
Webdriver can't action the element when the element is out of view
1. Scroll to the element
use javascript to scroll the element to view
((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].scrollIntoView(true);", element);2. Use Location to view
Use LocationInView property need use RemoteWebdriver and RemoteWebElement
Code like:
RemoteWebdriver rw = new RemoteWebdriver();
RemoteWebElement re = rw.FindelementOnPage(By.Id("id"));
re.LocationInView;

本文介绍了当Webdriver无法操作页面上不可见元素时的两种解决方法:使用JavaScript将元素滚动到可视区域,以及利用RemoteWebDriver和RemoteWebElement的LocationInView属性。
467

被折叠的 条评论
为什么被折叠?



