selenium Element not found in the cache - perhaps the page has changed since it was looked up接解决
selenium Element not found in the cache - perhaps the page has changed since it was looked up。这个问题爆出以后,找了各种解决的方法,始终不能正常解决。
最后找到了一个方法,上边提示说可以尝试在页面刷新后重新 find元素。就把查找基本元素的方法挪了下位置,在页面刷新后,在次查找需要处理的集合,找到后在进行处理。问题解决,最后发现,这个问题彻底解决了,哎。写代码要谨慎啊。页面存在多种连接时,可能一行既有图片又有文字连接,找到后分开放了2个集合。一个点击完后,在点击后一个集合,就会出现上边的错误,这个也很合理啊,页面的元素都已经刷新了,这个集合就改变了,就找不到,必须重新查找,缓存失效了。在每个页面打开后,要记得 _driver.Navigate().Back();返回上个链接。这个所有的连接地址都是在同一个页面开始的。
selenium Element not found in the cache - perhaps the page has changed since it was looked up接解决的更多相关文章
- Webdriver如何解决页面元素过期:org.openqa.selenium.StaleElementReferenceException: Element not found in the cache - perhaps the page has changed since it was looked up
当运行Webdriver时抛出如下异常:org.openqa.selenium.StaleElementReferenceException: Element not found in the cac ...
- selenium+python自动化88-批量操作循环点击报错:Element not found in the cache - perhaps the page has changed since it was looked up
前言 selenium定位一组元素,批量操作循环点击的时候会报错:Element not found in the cache - perhaps the page has changed since ...
- java selenium后报错Element not found in the cache元素定位要重新赋值之前的定义
习惯上把定位的元素在操作之前就定位好, 例如: WebElement element1=driver.findElement(...); ----------declaration1 Web ...
- selenium之 坑(StaleElementReferenceException: Message: Element not found in the cache...)
今天给大家分享一个selenium中经常会有人遇到的坑: selenium.common.exceptions.StaleElementReferenceException: Message: Ele ...
- selenium之坑:点击后页面刷新重新获取刷新前的页面(StaleElementReferenceException:Message:Element not found in the cache...)
循环点击一列链接,但只能点到第一个,第二个失败,这是为什么,因为第二个已经是新页面,当然找不到之前页面的元素,虽然元素没变,甚至是后退回来,页面都没有变,为什么是新页面,页面长的一样不代表是同一张页面 ...
- selenium之坑(StaleElementReferenceException: Message: Element not found in the cache...)
有时候循环点击一列链接,只能点到第一个,第二个就失败了 原因是第二个已经是新页面,当然找不到之前页面的元素.就算是后退回来的,页面也是不一样的 页面长的一样不一定是同一张页面,就像两个人长的一样不一定 ...
- 参考:(Java Selenium)Element is not visible to clcik
1.The element is not visible to click. Use Actions or JavascriptExecutor for making it to click. By ...
- Python Selenium element is not reachable by keyboard
碰到这个问题,没法解决, 最后这么搞的 pcAction.move_by_offset(571, 534).click().perform() #激活输入框 driver.switch_to.acti ...
- java+Selenium+TestNg搭建自动化测试架构(3)实现POM(page+Object+modal)
1.Page Object是Selenium自动化测试项目开发实践的最佳设计模式之一,通过对界面元素的封装减少冗余代码,同时在后期维护中,若元素定位发生变化,只需要调整页面元素封装的代码,提高测试用例 ...
随机推荐
- 河南省第十一届ACM程序设计竞赛 修路
Problem C: 修路 Time Limit: 3 Sec Memory Limit: 128 MBSubmit: 63 Solved: 22[Submit][Status][Web Boar ...
- HashMap 1.8的源码分析二
hashmap的构造方法: public HashMap(int initialCapacity, float loadFactor) { ) throw new IllegalArgumentExc ...
- 页面加载完成前的loading加载效果
/*loading.js*/ // 加载HTML图 var _LoadingHtml = '<div id="loadingDiv" style="position ...
- Django之ORM其他骚操作 执行原生SQl
Django ORM执行原生SQL # extra # 在QuerySet的基础上继续执行子语句 # extra(self, select=None, where=None, params=Non ...
- codeforces-777E Hanoi Factory (栈+贪心)
题目传送门 题目大意: 现在一共有N个零件,如果存在:bi>=bj&&bj>ai的两个零件i,j,那么此时我们就可以将零件j放在零件i上.我们现在要组成一个大零件,使得高度 ...
- echarts和highcharts
highcharts是基于svg技术的 echarts基于canvas 后者可以在浏览器中实现3D图形 链接 ,这种效果highcharts是完全不可能做得到的.
- Oracle SQL优化规则详解
1. 选用适合的Oracle优化器 Oracle的优化器共有3种: a. RULE (基于规则) b. COST (基于成本) c. CHOOSE (选择性) 设置缺省的优化器,可以通过对init.o ...
- 分布式事务框架-fescar
https://github.com/alibaba/fescar/wiki/%E6%A6%82%E8%A7%88?spm=5176.11156381.0.0.b9f85ceegUXvCC
- 使用 Moq 测试.NET Core 应用
第一篇文章, 关于Mock的概念介绍: https://www.cnblogs.com/cgzl/p/9294431.html 第二篇文章, 关于方法Mock的介绍: https://www.cnbl ...
- 虚拟机 ---- 最小化安装无法使用tab补全键
解决方法: 安装 yum -y install bash-completion 然后重启 注意:挂载时使用绝对路径的cdrom挂载, ls -l /dev/cdromvim /etc/fstab — ...