【问题标题】:Updated selenium, remote web element no longer works更新了 selenium,远程 web 元素不再起作用
【发布时间】:2017-05-02 18:33:22
【问题描述】:

我今天必须将 selenium 从 2.53.1 更新到 3.0,这也需要 geckodriver。我把所有东西都安装好了,但是每当我运行我的测试时,我都无法通过所有套件来处理任何远程元素。如果我降级它可以工作,如果我升级到最新版本的 selenium,它仍然无法工作。有人知道找到远程元素的解决方法吗?我目前正在这样做:

RemoteWebElement currentEventCell = (RemoteWebElement)gridElement.FindElements(By.CssSelector("tr[data-recordindex=\"" + RowIndex + "\"] td:nth-child(" + colIndex + ")"))[0];
var ScrollIt = currentEventCell.LocationOnScreenOnceScrolledIntoView;

产生的错误

抛出异常: OpenQA.Selenium.NoSuchElementException: 找不到元素 by: By.CssSelector: input[name="FunctionRoomOptionNumber"]

【问题讨论】:

  • 你能确定你现在使用的是哪个版本的 Selenium 吗?是 Selenium 3.4.0 吗?

标签: c# selenium geckodriver


【解决方案1】:

从您的代码中,我可以观察到您正在尝试访问 Grid 元素。

所以,这里是更新:

Selenium 3.4.0-Java:https://github.com/SeleniumHQ/selenium/issues/3946

硒 3.4.0-C#:https://github.com/SeleniumHQ/selenium/issues/3939

c# nuget 3.4.0 版中的远程WebDriver 实例https://github.com/SeleniumHQ/selenium/issues/3929

希望这些信息对您有所帮助:)

【讨论】:

    猜你喜欢
    • 2023-03-21
    • 2014-07-08
    • 1970-01-01
    • 2019-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-07
    相关资源
    最近更新 更多