Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Why must set the webdriver.gecko.driver system property? #4408

Closed
rkrisztian opened this issue Jul 27, 2017 · 5 comments · Fixed by #4412
Closed

Why must set the webdriver.gecko.driver system property? #4408

rkrisztian opened this issue Jul 27, 2017 · 5 comments · Fixed by #4412

Comments

@rkrisztian
Copy link

rkrisztian commented Jul 27, 2017

Bug report

  • Node Version: 6.10.3
  • Protractor Version: 5.1.2
  • Angular Version: 4.2.6
  • Browser(s): Firefox 52.2.0 (64-bit), Google Chrome 59
  • Operating System and Version RHEL 7
  • Your protractor configuration file: Angular CLI 1.2.0 defaults +
    capabilities: {
        browserName: 'firefox',
        marionette: true
    },
    directConnect: false,
    localSeleniumStandaloneOpts: {
        jvmArgs: ['-Dwebdriver.gecko.driver=/home/rkrisztian/projects/testProject/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.18.0']
    },
  • A relevant example test: Not needed, issue is driver-specific, and when driver is OK, tests pass.
  • Output from running the test:

When I specify no jvmArgs in the configuration file, I get:

[13:54:20] I/launcher - Running 1 instances of WebDriver
[13:54:20] I/local - Starting selenium standalone server...
[13:54:24] I/local - Selenium standalone server started at http://10.20.204.182:59199/wd/hub
[13:54:25] E/launcher - The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases

Otherwise everything is OK and tests are executed:

[13:55:03] I/launcher - Running 1 instances of WebDriver
[13:55:03] I/local - Starting selenium standalone server...
[13:55:05] I/local - Selenium standalone server started at http://10.20.204.182:33088/wd/hub
Jasmine started
(...)

But specifying the full path to the GeckoDriver defeats the purpose of the webdriver-manager which should just provide this setting for me, including whatever version is available. I shouldn't be setting this jvmArg property, it doesn't make any sense. As we don't do the same with Chrome, which just works.

  • Steps to reproduce the bug:

I'm using Angular CLI 1.2.0, and the developers there provide no support in this regard, so I came here.

@wswebcreation
Copy link
Contributor

Hi @rkrisztian

I don't have any experience with RHEL 7, but looking at the error that is thrown and the site that is shown in the error you should take a look at this

Selenium client bindings will pick up the geckodriver binary executable
from your system’s PATH environmental variable
unless you override it by setting the webdriver.gecko.driver
Java VM system property:

System.setProperty("webdriver.gecko.driver", "/home/user/bin");

Can you please check the provided info and let us know if that works for you?

@rkrisztian
Copy link
Author

rkrisztian commented Jul 27, 2017

Hi, @wswebcreation,

I hope it's clear that my real problem is that I shouldn't have to care about the webdriver.gecko.driver system property. Protractor should handle it somehow using the webdriver-manager. If I set the jvmArg myself, it will be a lot of scripting in protractor.conf.js and code duplication coming from webdriver-manager, just to fetch the right path.

Regardless, the following also works:

ln -s /home/rkrisztian/projects/testProject/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver{-v0.18.0,}
export PATH=$PATH:/home/rkrisztian/projects/testProject/node_modules/protractor/node_modules/webdriver-manager/selenium

Then I don't need the jvmArg. But of course, it's an uglier hack.

@cnishina
Copy link
Member

I just also came to the same conclusion that this is not good. Protractor should be able to get this done. With Chrome, we let users set chromeDriver in the configuration file and the local driver will use it...if not we check the webdriver-manager/selenium folder.

Proposed idea to fix this: #4411

I think I can fix this now. I've been meaning to have a distraction from writing my book.

cnishina added a commit to cnishina/protractor that referenced this issue Jul 29, 2017
- Add gecko driver as configuration option to be used in the local
  driver provider.
- Nit fixes to use string[] over Array<string> in the configParser.ts
- Add functionality to addDefaultBinaryLocs_ to use the geckoDriver
  value set in the config or to check locally in the
  webdriver-manager/selenium folder

closes angular#4408 and closes angular#4411.
@cnishina
Copy link
Member

Huzzah! PR in.

cnishina added a commit to cnishina/protractor that referenced this issue Jul 30, 2017
- Add gecko driver as configuration option to be used in the local
  driver provider.
- Nit fixes to use string[] over Array<string> in the configParser.ts
- Add functionality to addDefaultBinaryLocs_ to use the geckoDriver
  value set in the config or to check locally in the
  webdriver-manager/selenium folder

closes angular#4408 and closes angular#4411.
@wswebcreation
Copy link
Contributor

Tnx @cnishina ,

Didn't saw that, sorry

cnishina added a commit to cnishina/protractor that referenced this issue Jul 30, 2017
- Add gecko driver as configuration option to be used in the local
  driver provider.
- Nit fixes to use string[] over Array<string> in the configParser.ts
- Add functionality to addDefaultBinaryLocs_ to use the geckoDriver
  value set in the config or to check locally in the
  webdriver-manager/selenium folder
- Fix transpile errors in locator. Missing toString in ProtractorLocator
  interface
- Fix transpile errors in element. Cast wdpromise.Promise<{}> to
  wdpromise.Promise<T>

closes angular#4408 and closes angular#4411.
cnishina added a commit to cnishina/protractor that referenced this issue Jul 30, 2017
- Add gecko driver as configuration option to be used in the local
  driver provider.
- Nit fixes to use string[] over Array<string> in the configParser.ts
- Add functionality to addDefaultBinaryLocs_ to use the geckoDriver
  value set in the config or to check locally in the
  webdriver-manager/selenium folder
- Fix transpile errors in locator. Missing toString in ProtractorLocator
  interface
- Fix transpile errors in element. Cast wdpromise.Promise<{}> to
  wdpromise.Promise<T>

closes angular#4408 and closes angular#4411.
cnishina added a commit to cnishina/protractor that referenced this issue Jul 31, 2017
- Add gecko driver as configuration option to be used in the local
  driver provider.
- Nit fixes to use string[] over Array<string> in the configParser.ts
- Add functionality to addDefaultBinaryLocs_ to use the geckoDriver
  value set in the config or to check locally in the
  webdriver-manager/selenium folder
- Fix transpile errors in locator. Missing toString in ProtractorLocator
  interface
- Fix transpile errors in element. Cast wdpromise.Promise<{}> to
  wdpromise.Promise<T>

closes angular#4408 and closes angular#4411.
cnishina added a commit to cnishina/protractor that referenced this issue Jul 31, 2017
- Add gecko driver as configuration option to be used in the local
  driver provider.
- Nit fixes to use string[] over Array<string> in the configParser.ts.
- Add functionality to addDefaultBinaryLocs_ to use the geckoDriver
  value set in the config or to check locally in the
  webdriver-manager/selenium folder.
- Fix transpile errors in locator. Missing toString in ProtractorLocator
  interface.
- Fix transpile errors in element. Cast wdpromise.Promise<{}> to
  wdpromise.Promise<T>.
- xit spec/basic/action_spec.js based on
  [selenium-webdriver issue angular#3693](SeleniumHQ/selenium#3693).
  Added a // TODO comment to remove xit when selenium-webdriver resolves issue.

closes angular#4408 and closes angular#4411.
cnishina added a commit that referenced this issue Jul 31, 2017
…ig (#4412)

- Add gecko driver as configuration option to be used in the local driver provider. 
- Nit fixes to use `string[]` over `Array<string>` in the configParser.ts.
- Add functionality to `addDefaultBinaryLocs_` to use the `geckoDriver` value
  set in the config or to check locally in the `webdriver-manager/selenium` folder.
- Fix transpile errors in locator. Missing toString in ProtractorLocator interface.
- Fix transpile errors in element. Cast wdpromise.Promise<{}> to wdpromise.Promise<T>.
- xit spec/basic/action_spec.js based on
  [selenium-webdriver issue #3693](SeleniumHQ/selenium#3693). 
  Added a // TODO comment to remove xit when selenium-webdriver resolves issue.

closes #4408 and closes #4411.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants