Selenium element is not attached to the page document

来源:互联网 发布:查手机mac地址 编辑:程序博客网 时间:2024/05/20 11:46

最近有兴趣在学习一下selenium,发现出现了很多的错误。


1:Exception in thread "main" org.openqa.selenium.StaleElementReferenceException: stale element reference:element is not attached to the page document

原因:点击了登录按钮后,很快的跳转到了“首页”,但首页的需要定位的元素还未加载好,导致element找不到。



解决办法: thread.sleep(3000)打开。



阅读全文
0 0
原创粉丝点击