stale element reference: element is not attached to the page document 异常

时间:2022-09-19 10:16:23

在执行脚本时,有时候引用一些元素对象会抛出如下异常

  org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document

按字面表达的意思大概是,所引用的元素已过时,不再依附于当前页面。通常情况下,这是因为页面进行了刷新或跳转,解决方法是,重新使用 findElement 或 findElements 方法进行元素定位即可。

stale element reference: element is not attached to the page document 异常的更多相关文章

  1. 关于报错stale element reference: element is not attached to the page document处理

    1.现象 在执行脚本时,有时候引用一些元素对象会抛出如下异常 org.openqa.selenium.StaleElementReferenceException: stale element ref ...

  2. 报错stale element reference: element is not attached to the page document结局方案

    今天在调试脚本时,遇到如下报错: org.openqa.selenium.StaleElementReferenceException: stale element reference: elemen ...

  3. selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document

    抓取网页代码后,由于是在同一个li标签下,所以使用一次性抓取,所有的a标签,然后循环做不同的操作,但是抛出找不到元素异常. def office_page(_chrome: Chrome): sn = ...

  4. 【问题记录】element is not attached to the page document

    遇到ui脚本报错:element is not attached to the page document 解决办法,再次定位即可

  5. Selenium2学习-012-WebUI自动化实战实例-010-解决元素失效:StaleElementReferenceException: stale element reference: element is not attached to the page document

    元素失效的想象提示信息如下图所示,此种问题通常是因为元素页面刷新之后,为重新获取元素导致的. 解决此类问题比较简单,只需要在页面刷新之后,重新获取一下元素,就可以消除此种错误了. 以下以易迅网搜索为例 ...

  6. Selenium 错误处理之:stale element reference: element is not attached to the page document

    出现该错误的原因是页面在获取到DOM元素之后到引用元素之间页面进行了刷新,所以需要再次获取该DOM元素即可.

  7. Is it possible to implement a Firebug-like “inspect element” DOM element highlighter with client-side JavaScript?

    Is it possible to implement a Firebug-like "inspect element" DOM element highlighter with ...

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

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

随机推荐

  1. Unity3D访问Android系统目录

    file:///sdcard/Movies/3D/互动.mp4file:///storage/emulated/0/Movies/3D/互动.mp4/storage/emulated/0/Movies ...

  2. MySQL学习(一)

    mysql left join,right join,inner join用法分析 left join:是以A表的记录为基础的,A可以看成左表,B可以看成右表,left join是以左表为准的. 换句 ...

  3. OI历程日常

    之前的一直没来的及记录,表示从今往后连载 10.29 蒟蒻正在紧张的备战NOIP 整改了一下faebdc学长的模拟题,T1直接可以暴力破解,T2二分,O(nlog^2n)开始二分写残了,调了半天唉,现 ...

  4. [Android] Android开发优化之——使用软引用和弱引用

      Java从JDK1.2版本开始,就把对象的引用分为四种级别,从而使程序能更加灵活的控制对象的生命周期.这四种级别由高到低依次为:强引用.软引用.弱引用和虚引用. 这里重点介绍一下软引用和弱引用. ...

  5. C# 利用VS自带的WSDL工具生成WebService服务类

    C# 利用VS自带的WSDL工具生成WebService服务类   WebService有两种使用方式,一种是直接通过添加服务引用,另一种则是通过WSDL生成. 添加服务引用大家基本都用过,这里就不讲 ...

  6. js实现oss文件上传及一些问题

    关于兼容性问题,ie8以下的可以使用4.x的版本 一.引入sdk和jq <script src="http://libs.baidu.com/jquery/2.0.0/jquery.m ...

  7. windows7 安装IIS没有default web site 解决方法

    因当时是第一次在Windows 7上使用IIS,不小心把default web site删除了,后来无论怎么重装IIS都不行,最后想到能不能直接把别人安装好后的IIS相关文件夹拷过来使用,用宿舍一哥们 ...

  8. python学习笔记(八)---关于Django的下载以及环境配置

    下载链接: https://www.djangoproject.com/download/ (建议选择 1.6版本) 然后安装 Django下载后为压缩包,解压缩跟Python放在同一个根目录,在do ...

  9. 使用socket&period;io&plus;redis来实现基本的聊天室应用场景

    本文根据socket.io与Redis来实现基本的聊天室应用场景,主要表现于多个浏览器之间的信息同步和实时更新. 只是简单记录了一下, 更详细的内容可以参考后续的一篇补充文章: 使用node.js + ...

  10. NuGet 2&period;0 (&period;NET软件包管理器) 发布了-现在升级吧

    原文:https://blogs.msdn.microsoft.com/scott_hanselman/2012/07/10/nuget-2-0-net/ [原文发表地址]  NuGet 2.0 (. ...