开发者

How to solve selenium exception: StaleElementReferenceException: Element not found in the cache

I'm getting collection of links. Then I click first link, do something, moving back (driver.navigate().back();), getting second link and then link.click(); throws an exception org.openqa.selenium.StaleElementReferenceException: Element not found in the cache.

What a开发者_StackOverflowm I doing wrong?


As soon as you navigate away from the page the element variables become invalid. The trick is to find the first element, click, go back and then find the second element and click.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜