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

Posted 干不好测试的程序员不是一个好工程师!

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了stale element reference: element is not attached to the page document 异常相关的知识,希望对你有一定的参考价值。

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

  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 异常的主要内容,如果未能解决你的问题,请参考以下文章

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

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

Message: stale element reference: element is not attached to the page document错误解决方法

JNI ERROR (app bug): accessed stale local reference

JNI ERROR (app bug): accessed stale local reference

海康摄像头视频调用出错,Jni Error(app bug): accessed stale local reference解决办法