Protractor works fine with Chrome, but I cannot get it to start up Firefox or Internet Explorer.
Snippet from package.json
:
"scripts": {
....
"webdriver-manager-update": "webdriver-manager update --ie",
"protractor": "protractor protractor.conf.js",
...
},
...
"devDependencies": {
...
"protractor": "5.1.1",
...
}
protractor.conf.js
:
exports.config = {
capabilities: {
browserName: "firefox" // or "internet explorer"
},
specs: ["target/e2e/**/*.e2e-spec.js"]
};
After running npm run webdriver-manager-update
, <project-home>\node_modules\protractor\node_modules\webdriver-manager\selenium\
contains the files chromedriver_2.28.exe
, geckodriver-v0.15.0.exe
and IEDriverServer3.3.0.exe
.
When running npm run protractor
, I get an error:
[12:29:45] I/launcher - Running 1 instances of WebDriver
[12:29:45] I/local - Starting selenium standalone server...
[12:29:46] I/local - Selenium standalone server started at http://192.168.213.25:62661/wd/hub
[12:29:46] E/launcher - The path to the driver executable must be set by the webdriver.gecko.driver system property
(for IE, it refers to the webdriver.ie.driver
system property)
After lots of googling, I tried the following fixes:
a) Add <project-home>\node_modules\protractor\node_modules\webdriver-manager\selenium\
to the system environment variable Path
. This seems to make no difference.
b) Add the following line to protractor.conf.js
:
seleniumArgs: ["-Dwebdriver.gecko.driver=<project-home>\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\geckodriver-v0.15.0.exe"],
Now npm run protractor
yields:
[12:40:35] I/launcher - Running 1 instances of WebDriver
[12:40:35] I/local - Starting selenium standalone server...
[12:40:35] E/launcher - Error: Error: Server terminated early with status 1
at Error (native)
at earlyTermination.catch.e (<project-home>\node_modules\selenium-webdriver\remote\index.js:252:52)
at process._tickCallback (internal/process/next_tick.js:103:7)
[12:40:35] E/launcher - Process exited with error code 100
(analoguous behavior with IE)
My search results suggest I am not the only one having this problem, but unfortunately, I did not discover a solution.
Finally I found the solution in an answer by Nick Tomlin:
Its is not seleniumArgs
you need to set, but localSeleniumStandaloneOpts.jvmArgs
. So, in protractor.conf.js
, write:
localSeleniumStandaloneOpts: {
jvmArgs: ["-Dwebdriver.gecko.driver=<project-home>\\node_modules\\protractor\\node_modules\\webdriver-manager\\selenium\\geckodriver-v0.15.0.exe"]
},
(analoguous for IE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With