【问题标题】:Firefox Driver fails with org.openqa.selenium.SessionNotCreatedException:Firefox 驱动程序失败并出现 org.openqa.selenium.SessionNotCreatedException:
【发布时间】:2022-08-06 05:46:35
【问题描述】:

在 Firefox 中运行测试时出现此异常。

    com.codeborne.selenide.ex.SoftAssertionError: Test DraftTest.setUp failed (3 failures)
        org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
        org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
        org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
    
        at com.codeborne.selenide.logevents.ErrorsCollector.cleanAndGetAssertionError(ErrorsCollector.java:64)
        at com.codeborne.selenide.testng.SoftAsserts.failIfErrors(SoftAsserts.java:91)
        at com.codeborne.selenide.testng.SoftAsserts.onConfigurationFailure(SoftAsserts.java:46)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
        at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)

火狐版本:98.0.1

硒化物版本:6.3.4(硒 4.1.2)

  • 检查您正在使用的浏览器版本和驱动程序版本。为您的版本下载兼容的 Firefox 驱动程序并试一试
  • @dheeraj 在 Selenide 中,WebDriverManager 在测试执行期间总是在寻找和下载驱动程序。
  • 您可以手动检查 webdriver manager 是否正在下载与您的 firefox 兼容的正确驱动程序吗?否则需要更新您的 Firefox 或下载与您的 Firefox 版本匹配的驱动程序
  • @dheeraj 我手动设置 geckodriver 并且它有效。

标签: java selenium firefox


【解决方案1】:

我在使用 Selenium 4.3.0 和 Firefox 91.6 运行测试时遇到了同样的错误。我从here(撰写本文时0.31.0)下载了最新的geckodriver,这为我解决了这个问题。

【讨论】:

    猜你喜欢
    • 2017-02-27
    • 1970-01-01
    • 1970-01-01
    • 2023-03-24
    • 1970-01-01
    • 2016-04-26
    • 2018-05-18
    • 2012-11-15
    • 1970-01-01
    相关资源
    最近更新 更多