webdriver.gecko.driver exception in Selenium 3.0.0 Beta, for Firefox!

webdriver.gecko.driver exception in Selenium 3.0.0 Beta, for Firefox!

Follow 'Software Testing Studio' at LinkedIn & learn Selenium on the way!

Many of you must have encountered a geckodriver error as you start scripting for Mozilla Firefox using the latest Selenium 3.0.0 Beta release. WHAT! It used to work perfectly fine with Selenium 2.0. What has changed now? What is gecko and what’s the relation with Selenium scripting?

Exception in thread “main” java.lang.IllegalStateException : 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

What has changed now?

If you are getting the above error, you must have downloaded Selenium 3.0.0 Beta and Firefox browser version > 48.0. Right? Yeah! It should be.

  • Earlier Scenario: To use Firefox with Selenium, use the “old” legacy Selenium FirefoxDriver provided and maintained by the Selenium project. The legacy driver is implemented as a Firefox extension. This extension is installed in the profile used by the driver when WebDriver launches Firefox.
  • Current Scenario: Starting Selenium 3.0.0 Beta and Firefox browser version > 48.0, you will no longer be able to use the legacy FirefoxDriver provided by the Selenium project. Why? Mozilla has introduced two new features in Firefox browser that has disabled the legacy FirefoxDriver. The most important being – all browser extensions must be signed by Mozilla before the browser will allow them to load. The Selenium WebDriver Firefox extension introduces several valid security concerns for the browser, and as such, will not be signed by Mozilla’s security team. This, in turn, renders the extension inoperable, and thus Selenium can no longer communicate with Firefox using this legacy FirefoxDriver.

Then how to automate Firefox > 48.0 with Selenium 3.0.0 Beta?

Just like the other BrowserDrivers available to Selenium from other browser vendors, from Firefox 48.0 onwards, Mozilla itself (instead of Selenium project) has developed a new Firefox driver called Marionette-based Geckodriver, i.e. the mechanism used to drive the browser is now part of Mozilla Firefox itself. This driver code is entirely open source, and the geckodriver executable provided by Mozilla acts as a translator to take the HTTP calls from existing Selenium WebDriver to use a Marionette communication protocol over TCP that the browser understands natively. From Firefox 48.0 onwards it is mandatory to use this new Marionette-based Geckodriver developed by Mozilla.

What is Gecko?

Read full article here...

要查看或添加评论,请登录

Deepanshu Agarwal的更多文章

社区洞察

其他会员也浏览了