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自动化测试项目开发实践的最佳设计模式之一,通过对界面元素的封装减少冗余代码,同时在后期维护中,若元素定位发生变化,只需要调整页面元素封装的代码,提高测试用例 ...
随机推荐
- Flashcache的 KEEP属性自动失效
如果希望一个数据对象长期地缓存在flashcache中,则可以手动地将该数据对象的CELL_FLASH_CACHE属性设置为"keep". 其实需要说明的是,但不是数据对象的CEL ...
- [Groovy]Parse properties file in Groovy
def props = new Properties() new File("foo.properties").withInputStream { s -> props.lo ...
- 最长子序列问题(二分+贪心nlogn算法)
[题目描述] 给定N个数,求这N个数的最长上升子序列的长度. [样例输入] 7 2 5 3 4 1 7 6 [样例输出] 4 什么是最长上升子序列? 就是给你一个序列,请你在其中求出一段不断严格上升的 ...
- Request库基本使用
基本实例 import requests url= 'https://www.baidu.com/' response = requests.get(url) print(type(response) ...
- TortoiseGit安装简单介绍和使用
首先,你必须有会装软件的技能和一个看得懂英语的眼睛.然后保证Git也装好了 他提供了中文版的安装包哦 安装过程尽量选择默认就行,先装上面那个啊,语言包最后装. 语言配置 因为以前装过,所以...路径是 ...
- django组件之form
form组件 首先要了解form组件的一些基本语法: 1. 校验数据: form组件校验的是字典,所以数据应该以字典形式传进去 form 校验,可以多传数据,不要紧(只校验form组件有 ...
- Rabbitmq相关学习网址
1.安装文档: http://www.cnblogs.com/shuzhenyu/p/9823324.html 2.RabbitMq的整理 exchange.route.queue关系 https:/ ...
- Windows10上安装OpenStack
1. 启动Hyper-V 2. 在Hyper-V内安装Ubuntu 这两部可以参考http://www.cnblogs.com/jimmy-y/p/5328306.html(Ubuntu16类似) 3 ...
- Windows 常见DOS命令
1. 查看网络连接及路由状况 netstat -a 查看开启了哪些端口,常用netstat -an netstat -n 查看端口的网 ...
- 关于vue路由嵌套遇到的坑~
关键在于子路由中的path问题,path之前不要放/ <!DOCTYPE html> <html lang="en"> <head> <m ...