selenium 错误集锦->ElementNotVisibleException
来源:互联网 发布:儿童可视化编程软件 编辑:程序博客网 时间:2024/06/06 03:58
[error] Exception in thread “main”
org.openqa.selenium.ElementNotVisibleException:Element is not
currently visible and so may not be interacted with Command duration
or timeout:27 millseconds
Reason:大多数Web应用程序使用AJAX技术。当浏览器在加载页面时,页面上的元素可能并不是同时被加载完成的。如果因为在加载某个元素时延迟而造成元素定位失败的情况,那么会降低自动化脚本的稳定性。所以需要通过设置元素等待提高这种问题而造成的不稳定。(上述例子是由于识别对象失败,故采用implicitylyWait函数)
Solve:设置等待时间:Driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);
TimeOuts方法
- implicitlyWait:识别对象时的超时时间。过了这个时间如果对象还没找到的话就会抛出NoSuchElement异常。
- setScriptTimeout:异步脚本的超时时间。WebDriver可以异步执行脚本,这个设置异步执行脚本返回结果的超时结果。
- pageLoadTimeout:页面加载时的超时时间。因为WebDriver会等页面加载完毕再进行后面的操作,所以如果页面超时设置时间依然没有加载完成,那么WebDriver就会抛出异常。
阅读全文
0 0
- selenium 错误集锦->ElementNotVisibleException
- org.openqa.selenium.ElementNotVisibleException
- ElementNotVisibleException
- [Repost]Selenium ElementNotVisibleException: Cannot click on element
- org.openqa.selenium.ElementNotVisibleException: element not visible
- selenium 错误集锦->f.QueryInterface is not a function
- selenium问题集锦
- selenium常见问题集锦
- 错误集锦
- 错误集锦
- 错误集锦
- 错误集锦
- 错误集锦
- 错误集锦
- 错误集锦
- 错误集锦
- 错误集锦
- 错误集锦
- Source Insight 4.0 文件类型、编码格式、tab转空格、tab键自动补全设置
- Linux中getopt_long_only函数用法详解
- ios新手入门之UITextField左边空格
- 第12节-Linux 文件系统的运行方式
- F
- selenium 错误集锦->ElementNotVisibleException
- HBuilder使用夜神模拟器调试Android应用
- 简单选择排序(C)
- LeetCode-434. Number of Segments in a String
- 16.5的PowerDesigner中的to be Implemented找不到,inherited也找不到
- win10+VS2013编译caffe的common.cpp错误error C4996: ‘getpid': The POSIX name for this item is deprecated.
- Linux达人养成记Ⅰ笔记
- python——数据可视化:matplotlib,seaborn,pandas
- 十大基础排序 · 四 --- 快速排序(不稳定)挖坑填补法+区间分割法+3种优化方法