Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in DevOps and Agile by (19.7k points)

I'm running a simple example of selenium on Linux:

from selenium import webdriver

from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()

driver.get("something")

and get an error:

FileNotFoundError: [Errno 2] No such file or directory: 'geckodriver'

How to fix it?

$ python

Python 3.5.2 (default, Jun 28 2016, 08:46:01) 

[GCC 6.1.1 20160602] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import selenium

>>> from selenium.webdriver.common.keys import Keys

>>> 

1 Answer

0 votes
by (62.9k points)

Selenium requires a geckodriver to interface with Firefox. Here's how to install the geckodriver:

You can download geckodriver from this link https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz (or if you need the 32-bit version, go to https://github.com/mozilla/geckodriver/releases to see more download options)

Extract the file into your Downloads folder

Open a console and run this command

sudo mv ~/Downloads/geckodriver /usr/bin

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium online training

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.6k users

Browse Categories

...