問題描述
我已經使用 webdriver-manager start
啟動了一個服務器,但是當我嘗試運行量角器時出現此錯誤:
I already have started a server with webdriver-manager start
, but I get this error when I try to run protractor:
Using the selenium server at http://127.0.0.1:4444/wd/hub
[launcher] Running 1 instances of WebDriver
ERROR - Unable to start a WebDriver session.
C:...
pm
ode_modulesprotractor
ode_modulesselenium-webdriverlibatomserror.js:113
var template = new Error(this.message);
^
UnknownError: unknown error: cannot find Chrome binary
我的配置文件如下所示:
My config file looks like this:
exports.config = {
specs: [
'test/*.js'
],
capabilities: {
'browserName': 'chrome'
},
seleniumAddress: 'http://127.0.0.1:4444/wd/hub'
};
我還嘗試指向功能對象中的二進制文件以及添加 chromeDriver 和 seleniumServerJar 鍵均無濟于事.有什么想法嗎?
I have also tried pointing to the binary in the capabilities object as well as adding chromeDriver and seleniumServerJar keys to no avail. Any ideas?
推薦答案
根據相關github問題,問題是 chromedriver
找不到 chrome
瀏覽器可執行文件 - 在不同的操作系統上它會在 不同的地方.
According to the relevant github issue, the problem is that chromedriver
cannot find chrome
browser executeable - on different operating systems it searches for it in different places.
您需要在 chromedriver
期望的地方安裝 chrome,或者指定 chrome
在 中可執行的路徑>二進制
設置:
You need to either have chrome installed where chromedriver
expects it to be, or specify the path to the chrome
executeable in the binary
setting:
capabilities: {
"browserName": "chrome",
"chromeOptions": {
binary: "D:/Program Files/Chrome/chrome.exe",
args: [],
extensions: [],
}
},
這篇關于量角器給出“無法啟動 WebDriver 會話";錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!