码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-08-25 11:00:52      阅读:414      评论:0      收藏:0      [点我收藏+]

标签:bottom   定位   使用   add   方法   sel   ica   nbsp   对象   

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

  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 异常

标签:bottom   定位   使用   add   方法   sel   ica   nbsp   对象   

原文地址:http://www.cnblogs.com/onmyway20xx/p/7426505.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!