Gecko is a browser engine for Firefox that has been in usage since the year 1998. But Gecko was initially developed and maintained by a company called ‘America Online’. In the year 2003, Mozilla Corporation took control of Gecko development. Since then, the Firefox browser has improved a lot over the years. Firefox Quantum was released back in October of 2016 with multiple performance and rendering-related improvements. Quantum is an improvement project for the Gecko engine. Being a leading software testing company, we maintain automated test suites for multiple web products. You should be familiar with how Selenium WebDriver works for different browsers in order to achieve multi-browser execution. So in this blog article, you will learn a few important details about the Gecko Driver. (A proxy between WebDriver & Marionette Driver)
Marionette allows you to automate Gecko-based browsers. Marionette has namely two components, they are the Client and the Server. The server is bundled in the Firefox browser, and the client is your test code. The Marionette client driver is available in Python. Now, let’s take a look at the codes you will need to use the Marionette Driver.
How to use Marionette Driver
1. Install the Marionette client driver by using the below code
pip install marionette_driver
2. Use the below code to Run the Marionette enabled Firefox build
./mach run -marionette
3. Once you execute the below test code, it will launch Firefox browser
from marionette_driver.marionette import Marionette client = Marionette('127.0.0.1', port=2828) client.start_session()
The Gecko Driver is written in Rust programming language. Here, the Gecko driver is responsible to translate WebDriver commands and redirect them to the Marionette driver.
System.setProperty("webdriver.gecko.driver", "drivers/geckodriver"); WebDriver driver = new FirefoxDriver(); driver.get("https://google.com");
By default, Marionette is enabled when you launch Firefox using WebDriver. You can even see Marionette-related logs during the execution.
You do have the option to turn off Marionette using the System property. However, it is not supported with the latest version of Firefox.
It is worth mentioning that Selenium has started supporting the Gecko driver from v3.0.0.
We, as an automation testing company, run automation test scripts across multiple browsers. As stated earlier, Selenium WebDriver is an important tool that will help you achieve multi-browser testing. To achieve that, you should know how each implementation of the WebDriver works on different browsers. When you know the enhancement details of a browser and its driver, you will be in a position to plan and accommodate the changes in the test automation framework well ahead of time without any hassle.