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

I must have some versions here that don't match up since I can't get Selenium with Python to fire up a Firefox web browser. I'm using an older version of Firefox because other people in here have the same old version of Python and for them the old version of Firefox works best.


from selenium import webdriver

from selenium import common

from selenium.webdriver import ActionChains

from import By

from import WebDriverWait

from import expected_conditions as EC

from selenium.common.exceptions import TimeoutException

from selenium.common.exceptions import NoSuchElementException

from selenium.webdriver.common.desired_capabilities import DesiredCapabilities



Traceback (most recent call last):

  File "", line 13, in <module>


  File "/Library/Python/2.7/site-packages/selenium/webdriver/firefox/", line 158, in __init__


  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/", line 154, in __init__

    self.start_session(desired_capabilities, browser_profile)

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/", line 243, in start_session

    response = self.execute(Command.NEW_SESSION, parameters)

  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/", line 311, in execute


  File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/", line 237, in check_response

    raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

Version info:

Python 2.7.10

Selenium 3.8.0

Firefox 46.0

GeckoDriver 0.19.1 (It's in a folder which is in my PATH environment variable)

MacOS 10.12.6

1 Answer

0 votes
by (62.9k points)

As you are using Selenium 3.8.0 you have to use GeckoDriver mandatorily. But again as you are using Firefox v46.0 you have to set the capability marionette to False through DesiredCapabilities() as follows :

from selenium import webdriver

from selenium.webdriver.common.desired_capabilities import DesiredCapabilities


cap = DesiredCapabilities().FIREFOX

cap["marionette"] = False

browser = webdriver.Firefox(capabilities=cap, executable_path="C:\\path\\to\\geckodriver.exe")



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 online Selenium certification

Browse Categories