标题: selenium 不可见元素的操作 [打印本页] 作者: Congdinal1han 时间: 2015-6-18 10:38 标题: selenium 不可见元素的操作 webdriver录制脚本时想对不可见元素进行click操作,能定位到元素,但click时就报错(WebElement g = driver.findElement(By.xpath("//table[@id='table3']/tbody/tr/td/a"));),错误信息element is not currently visible and so may not be interracted with.....
代码如下:
D:\代码.png[attach]95829[/attach]
作者: Congdinal1han 时间: 2015-6-18 10:42
WebElement g = driver.findElement(By.xpath("//table[@id='table3']/tbody/tr/td/a"));
if(!(g.isDisplayed())){System.out.println("Element is not displayed!");
System.out.println(g.getAttribute("title"));};
g.click();