selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Selenium 3.4.0 Unable to find matching capabilities

Open jricardo27 opened this issue 9 years ago • 98 comments

OS: Ubuntu Selenium Version: 3.4.0 Browser: Firefox 45 Geckodriver: 0.16.0

Hi, After updating to Selenium 3.4.0 it can't start Firefox:

File "/root/venv/3.5/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 152, in __init__
    keep_alive=True)
  File "/root/venv/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/root/venv/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 185, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/root/venv/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 249, in execute
    self.error_handler.check_response(response)
  File "/root/venv/3.5/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities

-------- Using Firefox 45 due to click not working on newer versions (https://github.com/mozilla/geckodriver/issues/322) --------

jricardo27 avatar Apr 24 '17 00:04 jricardo27

Can this be reproduced on the newest Firefox nightly build? Firefox 45 isn't expected to work with the newest versions of selenium (3.4.0) and geckodriver (0.16.0). Support for geckodriver 0.16 is best in Firefox 52.0.3 and onwards.

see: https://github.com/mozilla/geckodriver#supported-firefoxen

cgoldberg avatar Apr 24 '17 00:04 cgoldberg

It seems to work ok (Selenium 3.40 + Geckodriver 0.16.0 + Firefox 53.0).

Even the issue with the click (https://github.com/mozilla/geckodriver/issues/322) seems to be working now.

Thanks for the advice.

jricardo27 avatar Apr 24 '17 03:04 jricardo27

I'm experiencing the same issue with

OS: arch linux Python: 3.6 Selenium: 3.4.0 Geckodriver: 0.16.0 Firefox: 53.0

py.test failure

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

env/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py:194: WebDriverException

Nagasaki45 avatar Apr 24 '17 10:04 Nagasaki45

Same platform and stack as @Nagasaki45, same issue.

mfin avatar Apr 24 '17 10:04 mfin

This bug will remain closed until we can get a high quality bug report. Me too comments don't really add value

AutomatedTester avatar Apr 24 '17 10:04 AutomatedTester

@AutomatedTester I'd gladly help, but this is the only info I get. How can I gather more information about the issue?

mfin avatar Apr 24 '17 10:04 mfin

Hi, I got the same error on my Windows 10 PC. I got rid of the error by installing firefox and reverting to previous geckodriver (geckodriver-v0.15.0-win64).

Petterrolvag avatar Apr 24 '17 13:04 Petterrolvag

Unfortunately no one has given steps to reproduce. This is clearly more than just driver=webdriver.Firefox() issue.

We can't do anything until proper steps to reproduce are given as documented in Contributing.md

Selenium tree tests being run in Python 3.6.1 and are passing. I ran 4 to show session startup.

dburns in ~/development/selenium/py on master λ tox -c py/tox.ini -r -e py36-marionette -v
using tox.ini: /Users/dburns/development/selenium/py/tox.ini
using tox-2.3.1 from /usr/local/lib/python2.7/site-packages/tox/__init__.pyc
GLOB sdist-make: /Users/dburns/development/selenium/py/setup.py
  /Users/dburns/development/selenium/py$ /usr/local/opt/python/bin/python2.7 /Users/dburns/development/selenium/py/setup.py sdist --formats=zip --dist-dir /Users/dburns/development/selenium/py/.tox/dist >/Users/dburns/development/selenium/py/.tox/log/tox-0.log
py36-marionette recreate: /Users/dburns/development/selenium/py/.tox/py36-marionette
  /Users/dburns/development/selenium/py/.tox$ /usr/local/opt/python/bin/python2.7 -m virtualenv --python /usr/local/bin/python3.6 py36-marionette >/Users/dburns/development/selenium/py/.tox/py36-marionette/log/py36-marionette-0.log
py36-marionette installdeps: pytest==3.0.3, pytest-instafail==0.3.0, pytest-mock==1.5.0, pytest-xdist==1.15
  /Users/dburns/development/selenium/py$ /Users/dburns/development/selenium/py/.tox/py36-marionette/bin/pip install -v --no-index --find-links=../third_party/py pytest==3.0.3 pytest-instafail==0.3.0 pytest-mock==1.5.0 pytest-xdist==1.15 >/Users/dburns/development/selenium/py/.tox/py36-marionette/log/py36-marionette-1.log
py36-marionette inst: /Users/dburns/development/selenium/py/.tox/dist/selenium-3.4.0.zip
  /Users/dburns/development/selenium/py$ /Users/dburns/development/selenium/py/.tox/py36-marionette/bin/pip install -v --no-index --find-links=../third_party/py /Users/dburns/development/selenium/py/.tox/dist/selenium-3.4.0.zip >/Users/dburns/development/selenium/py/.tox/py36-marionette/log/py36-marionette-2.log
  /Users/dburns/development/selenium/py$ /Users/dburns/development/selenium/py/.tox/py36-marionette/bin/pip freeze >/Users/dburns/development/selenium/py/.tox/py36-marionette/log/py36-marionette-3.log
py36-marionette installed: apipkg==1.4,appdirs==1.4.3,execnet==1.4.1,packaging==16.8,py==1.4.32,pyparsing==2.2.0,pytest==3.0.3,pytest-instafail==0.3.0,pytest-mock==1.5.0,pytest-xdist==1.15.0,selenium==3.4.0,six==1.10.0
py36-marionette runtests: PYTHONHASHSEED='1420169364'
py36-marionette runtests: commands[0] | py.test -n=auto --driver=Marionette
  /Users/dburns/development/selenium/py$ /Users/dburns/development/selenium/py/.tox/py36-marionette/bin/py.test -n=auto --driver=Marionette
=================================================== test session starts ====================================================
platform darwin -- Python 3.6.1, pytest-3.0.3, py-1.4.32, pluggy-0.4.0
rootdir: /Users/dburns/development/selenium/py, inifile: setup.cfg
plugins: xdist-1.15.0, mock-1.5.0, instafail-0.3.0
gw0 [605] / gw1 [605] / gw2 [605] / gw3 [605]
scheduling tests via LoadScheduling
....^CERROR: KEYBOARDINTERRUPT

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
to show a full traceback on KeyboardInterrupt use --fulltrace
/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/threading.py:299: KeyboardInterrupt
================================================ 4 passed in 12.21 seconds =================================================
ERROR: keyboardinterrupt

AutomatedTester avatar Apr 24 '17 13:04 AutomatedTester

@AutomatedTester actually, for me it's exactly that, driver = webdriver.Firefox() issue.

#!/usr/bin/env python3

from selenium import webdriver

driver = webdriver.Firefox()
driver.get('https://google.com')
Traceback (most recent call last):
  File "test2.py", line 5, in <module>
    driver = webdriver.Firefox()
  File "/home/matjaz/env/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 152, in __init__
    keep_alive=True)
  File "/home/matjaz/env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/home/matjaz/env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 185, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/home/matjaz/env/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 249, in execute
    self.error_handler.check_response(response)
  File "/home/matjaz/env/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities

mfin avatar Apr 24 '17 13:04 mfin

unforunately... no one in my team can reproduce this issue

AutomatedTester avatar Apr 24 '17 13:04 AutomatedTester

@mfin with geckodriver 0.16 and firefox 53?

lmtierney avatar Apr 24 '17 15:04 lmtierney

On Arch linux with: python 3.6.1-1 firefox 53.0-1 geckodriver 0.16.0-1 python-selenium 3.4.0-1

@mfin's test produces the same result for me.

Traceback (most recent call last):
  File "./test.py", line 5, in <module>
    driver = webdriver.Firefox()
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 152, in __init__
    keep_alive=True)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 98, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 185, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 249, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities

thewinduppirate avatar Apr 24 '17 16:04 thewinduppirate

@lmtierney yes. @thewinduppirate interesting, this looks to be Arch specific.

mfin avatar Apr 24 '17 17:04 mfin

If I add the capabilities suggested by @jrbenny35, I get this:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    driver = webdriver.Firefox(capabilities=caps)
  File "/home/matjaz/Playground/test/env/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 169, in __init__
    self.binary, timeout)
  File "/home/matjaz/Playground/test/env/lib/python3.6/site-packages/selenium/webdriver/firefox/extension_connection.py", line 52, in __init__
    self.binary.launch_browser(self.profile, timeout=timeout)
  File "/home/matjaz/Playground/test/env/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 73, in launch_browser
    self._wait_until_connectable(timeout=timeout)
  File "/home/matjaz/Playground/test/env/lib/python3.6/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 114, in _wait_until_connectable
    % (self.profile.path))
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Possible firefox version mismatch. You must use GeckoDriver instead for Firefox 48+. Profile Dir: /tmp/tmpvt157u03 If you specified a log_file in the FirefoxBinary constructor, check it for details.

mfin avatar Apr 24 '17 18:04 mfin

@mfin That looks like an outdated firefox version error. That was my problem. I removed a line in my test and it was using FF47.

b4handjr avatar Apr 24 '17 20:04 b4handjr

Same issue here, latest selenium, Firefox 53 (latest update today), geckodriver v0.16.0, MacOs (latest, updated)

moranl avatar Apr 24 '17 22:04 moranl

Hi. I have the same issue with geckodriver v0.16.0, Firefox 52.0.2, Python 3.5.3 and selenium 3.4.0 on Fedora 25.

frenzymadness avatar Apr 25 '17 08:04 frenzymadness

Same problem as @jricardo27:

>>> window.run_command('run_selenium')
11:23:09 DEBUG selenium.webdriver.remote.remote_connection:478             _request() POST http://127.0.0.1:1646/session {"capabilities": {"firstMatch": [], "alwaysMatch": {"acceptInsecureCerts": true, "browserName": "firefox"}}, "desiredCapabilities": {"acceptInsecureCerts": true, "browserName": "firefox"}}
11:23:10 DEBUG selenium.webdriver.remote.remote_connection:565             _request() Finished Request
Traceback (most recent call last):
  File "D:\Sublime Text 3 x64\sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "D:\Sublime Text 3 x64\Data\Packages\TestPlugin\Selenium.py", line 26, in run
    run_tests(self.view)
  File "D:\Sublime Text 3 x64\Data\Packages\TestPlugin\Selenium.py", line 19, in run_tests
    browser = webdriver.Firefox()
  File "C:\Python36\Lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 152, in __init__
    keep_alive=True)
  File "C:\Python36\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 98, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "C:\Python36\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 185, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Python36\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 249, in execute
    self.error_handler.check_response(response)
  File "C:\Python36\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities

Environment

Operating system and version: Windows 10 Enterprise LTSB 64-bit EN Python: 3.6.1 Selenium: 3.4.0 Firefox: 53.0 (64-bit) geckodriver: 0.16.0

Thanks.

Kristinita avatar Apr 25 '17 08:04 Kristinita

For users experiencing this problem on Linux, can you tell me the following things:

  • What's the firefox path i.e. the result of runing which firefox?
  • What's the result of running file on the output of the above? i.e. file $(which firefox).
  • Does the directory containing the firefox binary (after following any symlinks) contain an application.ini and platfom.ini file?
  • What's the contents of the above files?

I suspect that a short term workaround for the bug may be to pass in an explicit path to the Firefox binary, after following any symlinks, in the capabilities i.e. something like {moz:firefoxOptions: {binary: /usr/lib/firefox/firefox}.

jgraham avatar Apr 25 '17 09:04 jgraham

@jgraham firefox is in /bin, which is linked to /usr/bin, no *.ini files there also.

matjaz ~ $ which firefox
/bin/firefox
matjaz ~ $ file /bin/firefox
/bin/firefox: POSIX shell script, ASCII text executable
matjaz ~ $ ls -lah /bin
lrwxrwxrwx 1 root root 7 mar 26 23:57 /bin -> usr/bin
matjaz ~ $ ls /usr/bin/*.ini
/bin/ls: cannot access '/usr/bin/*.ini': No such file or directory

mfin avatar Apr 25 '17 09:04 mfin