Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(drivers): installing geckodriver with webdriver-manager #52

Closed
zuzusik opened this Issue Jun 21, 2016 · 16 comments

Comments

Projects
None yet
8 participants
@zuzusik
Copy link

zuzusik commented Jun 21, 2016

Geckodriver is the tool similar to Chrome's chromedriver.

It is required to run WebDriver with FF since FF 47.

UPD: it is not required with FF47 but it seems like it will be required with FF48 and Selenium < 3.0, see #52 (comment)

For now it should be installed manually on each machine. It would be really great if this process could be automated the way it is now done with chromedriver which can be installed using webdriver-manager.

@cnishina

This comment has been minimized.

Copy link
Member

cnishina commented Jun 28, 2016

@zuzusik Looking into this and trying to make a very simple Protractor test pass. Have you been able to use the gecko driver? This is my results.

  • Downloaded geckodriver-0.8.0-OSX
  • Using FF 47
  • Launched selenium server with webdriver.gecko.driver
  • Ran a simple test against it via protractor

conf.js:

exports.config = {
  seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
  capabilities: {
    'browserName': 'firefox',
    'marionette': true
  },
  framework: 'jasmine',
  specs: ['example_spec.js'],
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

example_spec.js

describe('angularjs homepage', function() {
  it('should greet the named user', function() {
    browser.get('http://www.angularjs.org');
    element(by.model('yourName')).sendKeys('Julie');
    var greeting = element(by.binding('yourName'));
    expect(greeting.getText()).toEqual('Hello Julie!');
  });
});

Launching selenium server with:

java -jar /Users/cnishina/src/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.0.jar -Dwebdriver.chrome.driver=/Users/cnishina/src/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.21 -Dwebdriver.gecko.driver=/Users/cnishina/Desktop/geckodriver-0.8.0-OSX 

Error in logs:

Driver info: org.openqa.selenium.firefox.MarionetteDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, count=1, appBuildId=20160623154057, version=47.0.1, platform=MAC, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=47.0.1, platformVersion=15.5.0, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=Darwin, device=desktop}]
Session ID: 4910007b-95ef-9941-a55f-76617a767d30
    at sun.reflect.GeneratedConstructorAccessor9.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
    at org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:575)
    at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:103)
    at com.sun.proxy.$Proxy1.executeScript(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver.executeScript(EventFiringWebDriver.java:217)
    at org.openqa.selenium.remote.server.handler.ExecuteScript.call(ExecuteScript.java:56)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
16:14:20.495 WARN - Exception: Error: Permission denied to access property "href" (WARNING: The server did not provide any stacktrace information)
@zuzusik

This comment has been minimized.

Copy link
Author

zuzusik commented Jul 1, 2016

TL;DR : from what I could found it seems like this feature will be useful in the time from the release of FF48 till the release and adoption of Selenium 3. I may be wrong.

After deeper investigation I found out that:

My assumption that GeckoDriver is required in FF47 was wrong - FF47 was just broken with FirefoxDriver and 47.0.1 is now released with the fix. GeckoDriver 0.8 is supported only with FF Nightly, DevEdition and Beta , and most likely this is the reason why @cnishina wasn't able to run tests with FF47.

Also here (in the last paragraph) it is said that Marionette will be included in Selenium 3 by default.

Also I suppose that FirefoxDriver support will be dropped with FF48 as according to https://wiki.mozilla.org/Add-ons/Extension_Signing#Timeline FF48 will require addons to be signed and according to this reply FirefoxDriver extension will stop working as it doesn't fit in requirements to be signed.

So, it seems like this feature will be useful in time from the release of FF48 till the release and adoption of Selenium 3. But I may be wrong in my conclusions.

@zuzusik

This comment has been minimized.

Copy link
Author

zuzusik commented Jul 1, 2016

@AutomatedTester could you please read my comment and point if I am wrong somewhere in my conclusions?

Thanks!

@AutomatedTester

This comment has been minimized.

Copy link

AutomatedTester commented Jul 1, 2016

Looks good to me

@cnishina

This comment has been minimized.

Copy link
Member

cnishina commented Aug 5, 2016

Since there is selenium standalone gecko driver support, there should be an option to add gecko driver.

@cnishina cnishina modified the milestones: Upcoming, 10.2.3 Aug 8, 2016

@heathkit

This comment has been minimized.

Copy link
Member

heathkit commented Aug 25, 2016

Note that Firefox 48 shipped on August 2nd, and at least for me it's not working without geckodriver. Also, the latest geckodriver (0.10) only supports Selenium 3.0. However, I was able to get firefox working with geckodriver-0.9 and Selenium 2.53.1.

@anujchaudhary1486

This comment has been minimized.

Copy link

anujchaudhary1486 commented Aug 26, 2016

Hi, mgiambalvo
Could you please explain the work around to get firefox 48.0 working with geckodriver -0.9 , selenium 2.53.1 and protractor 4.0.3

@heathkit

This comment has been minimized.

Copy link
Member

heathkit commented Aug 26, 2016

Sure. Once my PR lands, webdriver-manager will take care of this for you. But until then, you'll need to start selenium server manually and give it the path to geckodriver.

So, from your project's directory, the command would be

java -jar ./node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar \
    -Dwebdriver.chrome.driver=./node_modules/webdriver-manager/selenium/chromedriver_2.2 \
    -Dwebdriver.gecko.driver=<path to where you downloaded geckodriver>

Once my PR lands, you'll be able to download and run the gecko driver by passing webdriver-manager the "--gecko" flag.

Also, sorry, but there is currently a known issue with the geckodriver - you'll need to restart selenium server after each protractor run. I'm not sure if the issue is a bug in selenium server or geckodriver, but I'll see if I can get a fix for that soon.

@heathkit

This comment has been minimized.

Copy link
Member

heathkit commented Aug 26, 2016

Oh, also you'll need to set 'marionette: true' in the capabilities for protractor to use the new driver. so, for example.

capabilities: {
    'browserName': 'firefox',
    'marionette': 'true'
},
@Harsha509

This comment has been minimized.

Copy link

Harsha509 commented Sep 20, 2016

Hi There,
Is there any ETA for this ?

Thanks,
Harsha.

@heathkit

This comment has been minimized.

Copy link
Member

heathkit commented Sep 29, 2016

The ETA is three weeks ago, sorry for not linking the PR. You should be able to install geckodriver with the latest webdriver-manager.

@holm

This comment has been minimized.

Copy link

holm commented Oct 13, 2016

Any chance we could get a new release of webdriver-manager, so we start testing on Firefox 48+ ?

Thanks!

@digeomel

This comment has been minimized.

Copy link

digeomel commented Nov 22, 2016

Any idea why webdriver-manager may be stuck downloading the latest (0.11.1) gecko driver?
This is what I get:

webdriver-manager update [17:46:29] I/downloader - chromedriver: downloading version 2.25 [17:46:29] I/downloader - curl -o /usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.25linux64.zip https://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip [17:46:29] I/downloader - geckodriver: downloading version v0.11.1 [17:46:29] I/downloader - curl -o /usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.11.1-linux64.tar.gz https://github.com/mozilla/geckodriver/releases/download/v0.11.1/geckodriver-v0.11.1-linux64.tar.gz

And it stops there with no indication that it's doing anything.
By the way, I'm behind a proxy but all the settings for the proxy are there, I have no problem with npm or curl usually.

UPDATE: It appears all 3 files above failed to download, they had 0 size on disk. But, if I execute the curl commands manually on the command prompt, I get all of them. So I guess when they are executed through webdriver-manager the proxy settings are not picked up.

UPDATE 2 The gecko driver that it's trying to download above is actually an HTML redirect page. In order to actually download the file, you have to add the -L flag to the curl command, so that it follows the redirection.

@cnishina

This comment has been minimized.

Copy link
Member

cnishina commented Dec 13, 2016

@digeomel I'll create an issue to fix the logging with curl. This is not a difficult thing to fix...the curl command is a helpful hint that should show what you could do if you were to manually run it.

For your download: I'm not sure why your download is not working. If you are running into download issues, please open up a new issue with logging and along with command line output.

@holm Are you using Protractor to test with Firefox 48+? Just curious. We had a hot fix release recently that should get the latest version of gecko driver. However, there are still existing issues with Firefox + geckodriver (see #89).

@holm

This comment has been minimized.

Copy link

holm commented Dec 14, 2016

We tried to get it working with Firefox 48 a couple of times, but we keep running into issues. So for now we have simply given up, and will wait for things to stabilise before we waste more hours on it.

@cnishina

This comment has been minimized.

Copy link
Member

cnishina commented Dec 20, 2016

@holm Okay we are seeing the same thing. We are tracking some of the gecko driver issues in #89.

Since gecko driver is being downloaded, closing this issue as resolved. Let's track gecko driver issues separately.

@cnishina cnishina closed this Dec 20, 2016

cnishina added a commit to cnishina/webdriver-manager that referenced this issue Dec 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.