os:windows 7 selenium version 3.0.1 mozilla firefox:48.0.2
Traceback (most recent call last):
File "C:\Users\LENOVO\Desktop\kk2.py", line 4, in <module>
driver = webdriver.Firefox()
File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 135, in __init__
self.service.start()
File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 71, in start
os.path.basename(self.path), self.start_error_message)
WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
please give information step by step thoroughly please actually i am learner
For Linux based system, download geckodriver. Extract it and copy the driver to /usr/local/bin and finally make it executable (chmod +x geckodriver).
Linux(Ubuntu) Users should download the geckodriver and extract it in your project folder and while running your python script give the argument as
executable_path="./geckodriver"
Example:
from selenium import webdriver
class RunFFTests():
def testMethod(self):
# Initiate the driver instance
driver = webdriver.Firefox(
executable_path="./geckodriver")
driver.get("http://www.letskodeit.com")
ff = RunFFTests()
ff.testMethod()
I just download Gecko file and paste in where your python file is. It solves the problem!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With