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接解决的更多相关文章

  1. 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 ...

  2. 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 ...

  3. java selenium后报错Element not found in the cache元素定位要重新赋值之前的定义

    习惯上把定位的元素在操作之前就定位好, 例如: WebElement element1=driver.findElement(...);      ----------declaration1 Web ...

  4. selenium之 坑(StaleElementReferenceException: Message: Element not found in the cache...)

    今天给大家分享一个selenium中经常会有人遇到的坑: selenium.common.exceptions.StaleElementReferenceException: Message: Ele ...

  5. selenium之坑:点击后页面刷新重新获取刷新前的页面(StaleElementReferenceException:Message:Element not found in the cache...)

    循环点击一列链接,但只能点到第一个,第二个失败,这是为什么,因为第二个已经是新页面,当然找不到之前页面的元素,虽然元素没变,甚至是后退回来,页面都没有变,为什么是新页面,页面长的一样不代表是同一张页面 ...

  6. selenium之坑(StaleElementReferenceException: Message: Element not found in the cache...)

    有时候循环点击一列链接,只能点到第一个,第二个就失败了 原因是第二个已经是新页面,当然找不到之前页面的元素.就算是后退回来的,页面也是不一样的 页面长的一样不一定是同一张页面,就像两个人长的一样不一定 ...

  7. 参考:(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 ...

  8. Python Selenium element is not reachable by keyboard

    碰到这个问题,没法解决, 最后这么搞的 pcAction.move_by_offset(571, 534).click().perform() #激活输入框 driver.switch_to.acti ...

  9. java+Selenium+TestNg搭建自动化测试架构(3)实现POM(page+Object+modal)

    1.Page Object是Selenium自动化测试项目开发实践的最佳设计模式之一,通过对界面元素的封装减少冗余代码,同时在后期维护中,若元素定位发生变化,只需要调整页面元素封装的代码,提高测试用例 ...

随机推荐

  1. [CEOI2008]order BZOJ1391 网络流

    题目描述 有N个工作,M种机器,每种机器你可以租或者买过来. 每个工作包括若干道工序,每道工序需要某种机器来完成,你可以通过购买或租用机器来完成. 现在给出这些参数,求最大利润 输入输出格式 输入格式 ...

  2. [WebShow系列] 评委打分端现场操作方法

    前期准备: 在活动现场,组委会为每一个评委准备了打分相关东西: A.一个移动打分设备(平板电脑,或评委自己手机,或电脑也行); B.(可选)纸质的打分清单和笔.此清单中有打分细则,上场选手清单及打分处 ...

  3. csv HTTP简单表服务器

    HTTP Simple Table Server Download Performance testing with JMeter can be done with several JMeter in ...

  4. Oulipo (KMP出现次数)

    The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e ...

  5. poj3111 选取物品(二分+贪心)

    题目传送门 题意就是,n个物品,从中选取k个,要按照那个公式所取的值最大. 思路:最大化平均值的时候首先想到的就是二分, 我们设G(x) 为单位的重量不小于X, 我们的目标就是要找到满足条件的最大的X ...

  6. Hello World 十大秘密

    #include <stdio.h> int main(int argc, char* argv[], char* env[]) { printf("Hello World\n& ...

  7. 使用Spring和JQuery实现视频文件的上传和播放

    Spring MVC可以很方便用户进行WEB应用的开发,实现Model.View和Controller的分离,再结合Spring boot可以很方便.轻量级部署WEB应用,这里为大家介绍如何使用Spr ...

  8. VS 2017与 Docker

    https://www.cnblogs.com/rufus-hua/p/6742836.html 参考 1 基于VS2017的Docker Support体检ASP.NET Core站点的Docker ...

  9. 虚拟机 ---- 最小化安装无法使用tab补全键

    解决方法: 安装 yum -y install bash-completion 然后重启 注意:挂载时使用绝对路径的cdrom挂载,  ls -l /dev/cdromvim /etc/fstab — ...

  10. webpack01