Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
1.2k views
by Contributing Tester (53 points)

I have got this error what I can do? I use Linux Mint 18.1, python 3

My code is:

from selenium import webdriver
driver = webdriver.Firefox()
driver.get('google.com')

Traceback (most recent call last):
  File "/home/roman/pycharm/bustabit/bustabit.py", line 38, in <module>
    driver = webdriver.Firefox()
  File "/home/roman/.env/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 140, in __init__
    self.service.start()
  File "/home/roman/.env/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 74, in start
    stdout=self.log_file, stderr=self.log_file)
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
NotADirectoryError: [Errno 20] Not a directory
Exception ignored in: <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x7f8e96974b70>>
Traceback (most recent call last):
  File "/home/roman/.env/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 173, in __del__
    self.stop()
  File "/home/roman/.env/lib/python3.5/site-packages/selenium/webdriver/common/service.py", line 145, in stop
    if self.process is None:
AttributeError: 'Service' object has no attribute 'process'

1 Answer

0 like 0 dislike
by
selected by
 
Best answer

Set firefox binay first,

from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('path/to/installed firefox binary')
browser = webdriver.Firefox(firefox_binary=binary)


Also, download and set 'geckodriver' into your PATH variable.

These should help!

by
Thanks for advice. Here's what was wrong:
I had "geckodriver" but I set it like: /path/to/geckodriver  instead of /path/to/.
It was a problem.
by
I see. Glad that is resolved and thank you for sharing your solution.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...