【问题标题】:Could not start a new session using Selenium RemoteWebDriver for SauceLabs无法使用 Selenium RemoteWebDriver for SauceLabs 启动新会话
【发布时间】:2021-10-29 03:16:32
【问题描述】:

SauceLabs through Selenium 的以下代码工作正常,但现在出现错误:

static WebDriver driver;
public static final String URL = "http://" + USERNAME + ":" + ACCESS_KEY + "@ondemand.saucelabs.com:80/wd/hub";

        @BeforeClass
        public static void setupTest() throws MalformedURLException {
            DesiredCapabilities caps = DesiredCapabilities.firefox();
            caps.setCapability("platform", Platform.MAC);
            caps.setCapability("version", "52");
            driver = new RemoteWebDriver(new URL(URL), caps);
        }

错误:

org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Driver info: driver.version: RemoteWebDriver

我已经检查了 Chrome 和 Firefox。任何人都可以建议我是否在这里遗漏任何东西。由于之前的代码运行正常,会不会是代理问题?

【问题讨论】:

  • 在停止工作之前您是否进行了任何更改?
  • 没有改变任何代码。

标签: saucelabs remotewebdriver


【解决方案1】:

还有额外的空格。 试试public static final String URL = "http"+USERNAME+":"+ACCESS_KEY+"@oandemand.saucelabs.com:80/wd/hub";

【讨论】:

    猜你喜欢
    • 2017-12-31
    • 2010-11-27
    • 1970-01-01
    • 2013-08-05
    • 2020-03-25
    • 2023-03-10
    • 1970-01-01
    • 2020-07-30
    • 1970-01-01
    相关资源
    最近更新 更多