PageFactory中的StaleElementReference异常 [英] StaleElementReference Exception in PageFactory

查看:122
本文介绍了PageFactory中的StaleElementReference异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习PageFactory模型.我了解以下事实:当我们执行initElements时,将定位WebElement.举例来说,我单击一个Web元素,因此DOM中的其他Web元素之一发生了变化.现在,显然我会在这里得到StaleElementReferenceException.我该如何解决这个问题?

I am trying to learn the PageFactory model. I understood the fact that when we do a initElements, the WebElements are located. Say for example, I click on a webelement and because of which there is a change in one of the other webelements in DOM. Now, obviously I would get a StaleElementReferenceException here. How would I resolve this issue?

我是否应该再次知道特定的WebElement知道DOM中WebElement的属性可以更改的事实?还是有另一种方法来解决这个问题?

Should I find that specific WebElement again knowing the fact that there can be a change in the WebElement's properties in the DOM? or is there an another way to handle this?

推荐答案

StaleElementReferenceException

StaleElementReferenceException 扩展了 WebDriverException 并指出元素现在陈旧,并且元素引用在页面DOM上不再存在.

StaleElementReferenceException

StaleElementReferenceException extends WebDriverException and indicates that the previous reference of the element is now stale and the element reference is no longer present on the DOM of the page.

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆