Solution to geckodriver executable needs to be in path

This error comes up when the automation environment does not find the PATH to be available for geckodriver to run tests on Firefox browser.
What is GeckoDriver?
GeckoDriver acts as Man in the middle between Firefox and application under test. Initiating Firefox browser engine, in turn, calls the gecko driver engine. That's the reason when we see the error  "geckodriver executable needs to be in path" indicates that the geckodriver path is either missing or not set correctly in environmental variables on Windows/Linux/Mac
On mac,
You can install the geckodriver using below command
brew install geckodriver
Windows:
You can try below solutions:
  1. Go to Environmental variables-> PATH and set the path of the geckodriver.exe correctly
2. Copy geckodriver into the firefox folder. In my case, the location of firefox is as below:
C:\Users\BLR153\AppData\Local\Programs\Python\Python3632\selenium\webdriver\firefox
3. Downgrade your selenium from the current version to lower version, do this only when you are using selenium 3
You can use below command to downgrade the selenium
pip install selenium==2.53.6
Some useful references to resolve this issues:
https://stackoverflow.com/questions/40048940/geckodriver-executable-needs-to-be-in-path/40253692
https://stackoverflow.com/questions/6682009/selenium-firefoxprofile-exception-cant-load-the-profile
https://github.com/seleniumhq/selenium/issues/2739
https://python-forum.io/Thread-Getting-error-geckodriver-executable-needs-to-be-in-PATH

Comments

Popular Posts