以下代码 SauceLabs通过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。任何人都可以建议我在这里遗失任何东西。由于代码之前工作正常,它可能是代理问题吗?
答案 0 :(得分:0)
还有其他空格。
尝试public static final String URL = "http"+USERNAME+":"+ACCESS_KEY+"@oandemand.saucelabs.com:80/wd/hub";