Problem: Our selenium scripts started failing when we were running our tests on Firefox browser version 47 or higher. After a little bit of research we came to know that Selenium WebDriver 2.53.0 is not compatible with Firefox 47.0 or higher. The WebDriver component which handles Firefox browsers will be discontinued and we had to use geckodriver instead.
Why this post?
We learnt we need to upgrade to Selenium 3 and use Marionette or geckodriver to interact with Firefox version 47 or higher. In this post we would like to share set up issue which we faced and how we overcame them while setting up geckodriver in our system.
What is Geckodriver?
A Proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers. It provides HTTP API described by the WebDriver protocol to communicate with Gecko browsers, such as Firefox (Version above 47).
Issue:
When you are trying to install geckodriver and end up facing the below exception you need to make sure you have taken care of the below 3 steps. The common exception thrown is
“The path to the driver executable must be set by the webdriver.gecko.driver system property;”
a) Upgrade your selenium to latest version as geckodriver works with selenium 3 or higher
pip install selenium |
b) Just like Chrome, Opera, Internet Explorer or Microsoft Edge, Firefox will also require an executable that will run alongside the browser.
Download geckodriver using this link
c) The Selenium client bindings will try to locate the geckodriver or wires executable path from the system path. Therefore you will need to add the directory containing it to the system path.
From the path where your firefox is installed (In my case its installed in $\python\Lib\site-packages\selenium\webdriver\firefox.webdriver.py), check for the attribute ‘executable_path’.
If you liked what you read, know more about Qxf2.
I am an experienced engineer who has worked with top IT firms in India, gaining valuable expertise in software development and testing. My journey in QA began at Dell, where I focused on the manufacturing domain. This experience provided me with a strong foundation in quality assurance practices and processes.
I joined Qxf2 in 2016, where I continued to refine my skills, enhancing my proficiency in Python. I also expanded my skill set to include JavaScript, gaining hands-on experience and even build frameworks from scratch using TestCafe. Throughout my journey at Qxf2, I have had the opportunity to work on diverse technologies and platforms which includes working on powerful data validation framework like Great Expectations, AI tools like Whisper AI, and developed expertise in various web scraping techniques. I recently started exploring Rust. I enjoy working with variety of tools and sharing my experiences through blogging.
My interests are vegetable gardening using organic methods, listening to music and reading books.
This article was extremely helpful, thank you Indira. Others who are struggling with this issue should also take a look at the following link: https://stackoverflow.com/questions/40208051/selenium-using-python-geckodriver-executable-needs-to-be-in-path
Thanks a lot, Indira for this article!! Helped me with an issue I was stuck on…