我正在创建 webdriver,如下所示:
var driver = require("selenium-webdriver");
driver = new webdriver.Builder().
usingServer(server.address()).
withCapabilities({'browserName': 'chrome'}).
build();
it('should append query to title', function() {
driver.get('http://www.google.com');
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.name('btnG')).click();
driver.wait(function() {
return driver.getTitle().then(function(title) {
return 'webdriver - Google Search' === title;
});
}, 1000);
});
这在 Firefox 上运行良好。使用 chrome,打开 chrome 实例后出现以下异常:谁能告诉我如何解决这个问题?此外,最新的 chrome 版本 26.0.1410.65。
chromedriver
我的机器上安装了最新版本。
UnknownError: Unable to either launch or connect to Chrome. Please check that ChromeDriver is up-to-date. Using Chrome binary at: /Applications/Google Chrome.app/Contents/MacOS/Google Chrome (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 28.32 seconds
Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.7.3', java.version: '1.6.0_31'
Driver info: org.openqa.selenium.chrome.ChromeDriver