0

我尝试在 SauceLabs 上运行硒测试,效果很好。但是几天以来,我的所有测试都无法以错误消息开始:“浏览器无法启动”。如果我尝试启动交互式会话,则会出现相同的错误消息。浏览器/操作系统组合似乎没有任何影响(我尝试了 chrome、firefox、opera on mavericks、windows 7 和 linux——结果都一样)。

我的设置如下所示:

public abstract class AbstractSeleniumTestBase implements SauceOnDemandSessionIdProvider {
    RemoteWebDriver driver;
    Selenium selenium; 


public DesiredCapabilities getCapabilities() {
    DesiredCapabilities capabilities = new DesiredCapabilities(this.browser);
    capabilities.setCapability("version", this.version);
    capabilities.setCapability("platform", this.platform);
    return capabilities;
}

@Before
public void setUp() throws Exception {
    String serverUrl = System.getProperty("selenium.server");
    String baseUrl = System.getProperty("selenium.url");
    DesiredCapabilities c = getCapabilities();
    c.setJavascriptEnabled(true);
    String name = getName() + " (on " + c.getBrowserName() + " "
            + c.getVersion() + " " + c.getPlatform() + ")\n";
    c.setCapability("name", name);
    System.out.print("\nTesting: " + name);

    this.driver = new RemoteWebDriver(new URL(serverUrl), c);
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    selenium = new WebDriverBackedSelenium(driver, baseUrl);
    this.sessionId = driver.getSessionId().toString();
}
4

2 回答 2

0

We have noticed this problem show up every once in a while. Manually starting a session within SauceLabs resulted in the same error. In short the problem is with SauceLabs. It usually gets fixed within 24 hours.

Unfortunately we have not received an official answer to the exact nature of the problem. Last time we saw this issue crop up on one of our accounts was on August 3rd around 11pm. Just had to wait for it to clear out the next day.

于 2014-08-11T18:59:14.410 回答
0

尝试在酱实验室格式中指定格式:

DesiredCapabilities caps = DesiredCapabilities.firefox();
caps.setCapability("platform", "Windows 7");
caps.setCapability("version", "30");

您用于 this.version 和 this.platform 的值是什么。

于 2014-07-23T17:13:25.430 回答