Element is not currently visible and so may not be interactedwith 解决方法
来源:互联网 发布:数据科学家待遇 编辑:程序博客网 时间:2024/05/12 16:21
先看截图:
在Firebug中对应的html源码,见高亮显示。
如果用:
driver.findElement(By.className("cancelBtn")).click();
或 driver.findElement(By.id("save_btn")).click();
就会报“Element is not currently visible andso may not be interacted with”错误
解决方法:
思路: 使用findElements遍历,input标签,然后找到share按钮对应的 索引值,然后再操作。
List<WebElement>element=driver.findElements(By.tagName("input"));
for(WebElement e:element)
{
System.out.println(e.getAttribute("id"));
}
element.get(78).click();
至此 问题解决。
问题更正: 此种问题的关键是在于用className和id都不唯一所以找不到对象,改为:
driver.findElement(By.xpath("//input[@value='Share']")).click();同样可以解决问题。
0 0
- Webdriver Element is not currently visible and so may not be interactedwith 解决方法
- Element is not currently visible and so may not be interactedwith 解决方法
- Selenium-异常:Element is not currently visible and so may not be interacted with的解决
- selenium webDriver: Element is not currently visible and so may not be interacted with
- Selenium-异常:Element is not currently visible and so may not be interacted with的解决
- WebDriver遇到Element is not currently visible and so ...解决
- Webdriver Element is not currently visible 解决方法
- selenium:Element is not visible
- element not visible的解决方法
- selenium +Python 测试时报 “Element is not visible”解决方法
- FAIL - Context /SsmApp is defined in server.xml and may not be undeployed
- 配置伪分布式时的问题”JAVA_HOME is not set and could not be found“解决方法
- A class file was not written. The project may be inconsistent, if so try refreshing this project and
- rails and gem is currently not installed (解决)
- the breakpoint will not currently be hit. No executale code is currently loaded at this location
- MyEclipse is not currently available
- JAVA_HOME is not set and could not be found.
- hadoop2 JAVA_HOME is not set and could not be found
- ORA-28001: the password has expired解决办法
- python dict
- 设计模式分类
- Android之ListView控件使用简单介绍
- 记录错误:'command '/.../sdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1
- Element is not currently visible and so may not be interactedwith 解决方法
- Android Studio鼠标移到类或者方法上面显示方法注释doc
- Uip在STM32平台移植之建立UDP链接
- 认识js中的function和this---new Function(a,b,body)方式
- smartSVN 分支合并到主干
- 【思想】教师评教
- 欢迎使用CSDN-markdown编辑器
- spatialhadoop2.3源码阅读(六) grid 索引生成方法(二)
- 关于java.lang.ThreadLocal