首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Selenium - StaleElementReferenceException (Chromedriver 80)

Selenium - StaleElementReferenceException (Chromedriver 80)
EN

Stack Overflow用户
提问于 2020-02-18 19:58:08
回答 1查看 75关注 0票数 0

以下代码在Chromedriver 80更新之前有效,但现在当元素出现在DOM中时,它会抛出StaleElementReferenceException:

代码语言:javascript
复制
public static void WaitUntilElementNotExists(string clase)
{
    Instance.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(2);
    webDriverWait.Until(x => !ElementsByClass(clase).Any());
    Instance.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(WaitDefinition.TimeOut);
}
EN

回答 1

Stack Overflow用户

发布于 2020-02-22 05:35:08

尝试在执行webDriverWait.Until()之前将StaleElementReferenceException添加到webDriverWait.IgnoreExceptionTypes()

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60280398

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档