Why Firefox requires GeckoDriver?

三世轮回 提交于 2019-11-26 18:01:23
DebanjanB

Let me try to answer your Questions one by one:

  1. Why does Firefox require GeckoDriver? - For Mozila Firefox till version 47.x it was the legacy browser and we didn't need gecko driver. Mozila Firefox from version 47.x onwards it comes with Marionette, which is an automation driver for Mozilla's Gecko engine. It can remotely control either the UI or the internal JavaScript of a Gecko platform, such as Firefox.

  2. With Chrome and IE works out of the box - Ideally neither Chrome nor IE should have worked. But as you have added the location of the binaries in the Environment Variables knowingly/unknowingly while installation/configuration of Google Chrome & MS Internet Explorer or other dependent softwares, those binaries are easily located & used automatically.

  3. Why only for Firefox do we have to download/configure this driver? - It is not only Firefox but also for Google Chrome & MS Internet Explorer to work with Selenium 3.4.0 you need to mandatory download gecko driver v0.16.0 (or above) from here or Chrome driver or IEDriverServer and save it in your machine. Upgrade your Mozila Firefox or Google Chrome or MS Internet Explorer to the latest stable version. Use the absolute path of the geckodriver/chromedriver/iedriver in your code while System.setProperty as follows:

    System.setProperty("webdriver.gecko.driver",  "C:\\Utility\\BrowserDrivers\\geckodriver.exe");
    

Let me know if this answers your question.

FireFox is Mozilla based and selenium needs the driver to interface with gecko based drivers - see the README file at geckodriver

Your statement is really incorrect, chromedriver needs to be put in path as well. I think you have set the chromedriver before so it seems to work out of the box.

The path for geckodriver / chromedriver could also be set inside your code

The reason why we need this, AFAIK since firefox > 47, firefox webdriver plugin is not shipped with the browser, and thus it should be executed from geckodriver, and selenium 3+

Marionette as automation driver in Firefox supports a custom socket protocol, which is not compatible with the WebDriver specification. As such geckodriver needs to be used which acts as a proxy between Selenium and Firefox. Implemented as a small HTTP server it accepts commands which are conforming to the WebDriver specification, and forwards those to Marionette. Same applies to responses from Marionette which are getting transformed back into a WebDriver compatible HTTP response.

With the upcoming integration of Quantum (Rust components) in Firefox, geckodriver will not be necessary in the future because it will be integrated by default.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!