我有一组用https://github.com/camme/webdriverjs编写的验收测试。我希望通过 Selenium Server (WebDriver) 和 Sauce Labs 对真实浏览器运行测试。Firefox 启动良好,但 Chromium(来自 Debian Wheezy 软件包的 30.0.1599.101)不能。通过设置{ desiredCapabilities: { browserName: "chrome" } }
我得到ERROR COULDNT GET A SESSION ID
和 Selenium Server 控制台输出显示
WARN - Exception: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://code.google.com/p/chromedriver/downloads/list
如果我启动 Selenium Server 并-Dwebdriver.chrome.driver=/usr/bin/chromium
出现新的浏览器窗口,但测试永远不会开始运行,超时后我会得到相同的ERROR COULDNT GET A SESSION ID
结果,并且 Selenium Server 控制台输出显示
Created new window in existing browser session. 13:43:25.775 WARN - Exception thrown java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
[...]
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
[...]
Caused by: 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.
[...]
Caused by: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start.