1

when trying to launch firefox from Pycharm IDE or from Terminal with the next simple script:

from selenium import webdriver
a = webdriver.Firefox(firefox_binary='/usr/local/bin/geckodriver')

no browser session is opened and i'm getting this issue:

Traceback (most recent call last):
  File "/Users/avihaiezaguy/Desktop/a.py", line 2, in <module>
    a = webdriver.Firefox(firefox_binary='/usr/local/bin/geckodriver')
  File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 150, in __init__
    keep_alive=True)
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
    response = self.execute(Command.NEW_SESSION, capabilities)
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 104, in check_response
    status = value["status"]
KeyError: 'status'

when webdriver is called without binary from Terminal, the browser opens and i get:

Traceback (most recent call last):
  File "/Users/avihaiezaguy/Desktop/a.py", line 2, in <module>
    a = webdriver.Firefox()
  File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 150, in __init__
    keep_alive=True)
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 180, in start_session
    self.session_id = response['sessionId']
KeyError: 'sessionId'

on the other hand Chrome works fine.

can anyone help solving this issue?

1 Answer 1

4

after looking at: https://github.com/mozilla/geckodriver/releases

upgraded selenium from 3.0.2 to 3.3.1 with

pip install -U selenium

now it's working!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.