Thursday, 29 December 2016

GeckoDriver -The new girl in town

The new buzz word in QA town is GeckoDriver. You have come across these words quite a few times in last few days.So what is this GeckoDriver?

 Firefox driver which was the default web driver for firefox is no longer supported with Firefox 47 and further. To drive Firefox from now on you have to use Marionette GeckoDriver.


How to use Marionette GeckoDriver?

  •   Download GeckoDriver from Github
  •   Unzip the zipped file and extract the executable file for GeckoDriver.
  •   Rename the executable file to wires.exe (Official recommendation )
  •   Set the path of "webdriver.gecko.driver" using setProperties method.
  •   Initiate your MarionetteDriver.
Below is the code snippet you can use to work with Marionette Driver.

    System.setProperty("webdriver.gecko.driver", "D://work folder//wires.exe");
    WebDriver driver = new MarionetteDriver(); 


How to open Firefox with a custom profile with help of Marionette Driver?

Marionette driver  does not support passing a profile object as a argument to driver constructor like FirefoxDriver(ProfileObject). In order to do that you have to first instantiate a capability object and then add the profile object to the capability.
Once you have done that you can now instantiate your MarionetteDriver with the capability object as constructor argument.





 More updates on GeckoDriver is coming as I get more time to check her out! Adios!