0

I've been reading through all the answers to this problem, but I still can't solve it.

I downloaded and extracted geckodriver.exe to "C:\rtemp". I'm using windows, so I've added "C:\rtemp\geckodriver.exe" to the Path.

When I try to run:

ff_caps = DesiredCapabilities.FIREFOX
ff_caps['marionette'] = True
driver = webdriver.Firefox(capabilities=ff_caps)

I still get an error saying:

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Is there something else that I'm missing?

ChrisG29
  • 1,501
  • 3
  • 25
  • 45

3 Answers3

1

The Path is the set of directories used to search for executable files, try adding "C:\rtemp\" to your Path

iCart
  • 2,179
  • 3
  • 27
  • 36
  • Have you tried [this answser to another question](http://stackoverflow.com/questions/8255929/running-webdriver-chrome-with-selenium#8259152) or [this one?](http://stackoverflow.com/a/25988106/1113623) – iCart Nov 03 '16 at 10:39
0

The problem was with the setup of the path. My path was pointing to the location of the directory containing "gecko.exe", it needs to point to the location of the Firefox binaries:

Path = C:\Program Files (x86)\Mozilla Firefox\
ChrisG29
  • 1,501
  • 3
  • 25
  • 45
0

As iCart said, you need to set the path to contain the directory the driver is in not the actual path to the exe itself. For example, we have all of our drivers (chrome etc in C:\Program Files\Selenium\ and the PATH variable contains C:\Program Files\Selenium\;

After updating the PATH variable you normally need to restart the command line or IDE you're using for the PATH change to be picked up; we use Selenium in C# so I had to close Visual Studio and manually kill all of it's worker processes (alternatively, restart your machine).

You can test whether or not the update to PATH has worked by just typing geckodriver into a command line; if it comes up with an error then the PATH hasn't updated. Let us know how you get on!

Dillanm
  • 876
  • 12
  • 28