protractor: Protractor doesn't find webdriver's firefox driver automatically when running local tests.
Description: protractor doesn’t find firefox driver automatically when running local tests. The file https://github.com/angular/protractor/blob/5.3.0/lib/config.ts does say for “geckoDriver” the following:
geckoDriver location is used to help find the gecko binary. This will be passed to the Selenium jar as the system property webdriver.gecko.driver. If the value is not set when launchinglocally, it will use the default values downloaded from webdriver-manager.
So I think my small/basic example should work on firefox as well; in chrome (see output below) it does work automatically and both browser drivers are present in (…)\node_modules\protractor\node_modules\webdriver-manager\selenium
If it is not supposed to work like that then the https://github.com/angular/protractor/blob/5.3.0/lib/config.ts comment needs to be fixed/enhanced for firefox.
- Node Version: v8.9.4
- Protractor Version: 5.3.0
- Angular Version: 1 (using your sample from http://www.protractortest.org/testapp/ng1)
- Browser(s): firefox
- Operating System and Version: Windows 10
- Protractor configuration file:
exports.config = {
specs : [ "geckoDriverBug_spec.js" ],
rootElement : 'html',
maxSessions: 1,
multiCapabilities : [ { browserName : 'firefox' }, { browserName : 'chrome' } ]
};
- A relevant example test; file “geckoDriverBug_spec.js”:
describe('geckoDriverBug', function() {
it('should execute test case without errors', function() {
browser.get("http://www.protractortest.org/testapp/ng1");
browser.wait(function() {
return browser.isElementPresent(element(by.xpath("//*[@id='animals']")));
}, 8000);
expect(element(by.xpath("//*[@id='animals']")).isPresent()).toBe(true);
});
});
- Output
(node:18632) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[10:09:51] I/launcher - Running 1 instances of WebDriver
[10:09:54] I/testLogger -
------------------------------------
[10:09:54] I/testLogger - [firefox #01] PID: 4344
[firefox #01] Specs: e:\GitHome_master\git\servoy_test\E2E_tests\geckoDriverBug_spec.js
[firefox #01]
[firefox #01] (node:4344) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[firefox #01] [10:09:52] I/local - Starting selenium standalone server...
[firefox #01] [10:09:54] I/local - Selenium standalone server started at http://192.168.1.5:51226/wd/hub
[firefox #01]
[firefox #01] e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\lib\error.js:546
[firefox #01] throw new ctor(message);
[firefox #01] ^
[firefox #01] SessionNotCreatedError: Unable to create new service: GeckoDriverService
[firefox #01] Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z'
[firefox #01] System info: host: 'DEEPGRAY', ip: '192.168.1.5', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_162'
[firefox #01] Driver info: driver.version: unknown
[firefox #01] at Object.checkLegacyResponse (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\lib\error.js:546:15)
[firefox #01] at parseHttpResponse (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\lib\http.js:509:13)
[firefox #01] at doSend.then.response (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\lib\http.js:441:30)
[firefox #01] at <anonymous>
[firefox #01] at process._tickCallback (internal/process/next_tick.js:188:7)
[firefox #01] From: Task: WebDriver.createSession()
[firefox #01] at Function.createSession (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\lib\webdriver.js:769:24)
[firefox #01] at Function.createSession (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\firefox\index.js:521:41)
[firefox #01] at createDriver (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\index.js:170:33)
[firefox #01] at Builder.build (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\selenium-webdriver\index.js:632:16)
[firefox #01] at Local.getNewDriver (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\protractor\built\driverProviders\driverProvider.js:53:33)
[firefox #01] at Runner.createBrowser (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\protractor\built\runner.js:195:43)
[firefox #01] at q.then.then (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\protractor\built\runner.js:339:29)
[firefox #01] at _fulfilled (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\q\q.js:834:54)
[firefox #01] at self.promiseDispatch.done (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\q\q.js:863:30)
[firefox #01] at Promise.promise.promiseDispatch (e:\GitHome_master\git\servoy_test\E2E_tests\node_modules\q\q.js:796:13)
[10:09:54] I/testLogger -
[10:09:54] E/launcher - Runner process exited unexpectedly with error code: 1
[10:09:54] I/launcher - 1 instance(s) of WebDriver still running
.[10:10:00] I/testLogger -
------------------------------------
[10:10:00] I/testLogger - [chrome #11] PID: 19952
[chrome #11] Specs: e:\GitHome_master\git\servoy_test\E2E_tests\geckoDriverBug_spec.js
[chrome #11]
[chrome #11] (node:19952) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[chrome #11] [10:09:55] I/local - Starting selenium standalone server...
[chrome #11] [10:09:56] I/local - Selenium standalone server started at http://192.168.1.5:55207/wd/hub
[chrome #11] Started
[chrome #11] .
[chrome #11]
[chrome #11]
[chrome #11] 1 spec, 0 failures
[chrome #11] Finished in 1.43 seconds
[chrome #11]
[chrome #11] [10:10:00] I/local - Shutting down selenium standalone server.
[10:10:00] I/testLogger -
[10:10:00] I/launcher - 0 instance(s) of WebDriver still running
[10:10:00] I/launcher - firefox #01 failed with exit code: 1
[10:10:00] I/launcher - chrome #11 passed
[10:10:00] I/launcher - overall: 1 process(es) failed to complete
[10:10:00] E/launcher - Process exited with error code 100
- Steps to reproduce the bug: just run the given protractor config and test spec.
- The URL tests run against (provided by you): http://www.protractortest.org/testapp/ng1
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 20 (7 by maintainers)
Thanks @CrispusDH, will do that.
Just FYI, #4502 is now merged so this should solve this problem too.