【问题标题】:how to reload the html DOM with selenium so that the new commands will locate the new nodes?如何使用 selenium 重新加载 html DOM,以便新命令能够定位新节点?
【发布时间】:2016-03-19 00:15:17
【问题描述】:

所以我正在做一些测试,一个页面在单击某些按钮和链接后会更改它的 html 树。但是 webdriver 只在旧的 html DOM 中进行搜索。

那么如何定位新添加的 web 元素呢?或者我怎样才能让 webdriver 加载新的 Html DOM 以便它以新元素为目标?谢谢

【问题讨论】:

    标签: javascript c# selenium


    【解决方案1】:

    WebDriver 会自动轮询 DOM。

    在与最近添加的网络元素交互之前使用隐式或显式等待: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#explicit-and-implicit-waits

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-12-21
      • 2013-05-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-18
      • 1970-01-01
      相关资源
      最近更新 更多