selenium: Selenium 3.4.0 Unable to find matching capabilities
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) --------
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 7
- Comments: 98 (13 by maintainers)
Links to this issue
- Selenium and Geckodriver issue with creating a webdriver in Python - Stack Overflow
- python - Selenium - How to import all settings from an existing Firefox profile - Stack Overflow
- python - Selenium "Unable to find a matching set of capabilities" despite driver being in /usr/local/bin - Stack Overflow
- Unable to find a matching set of capabilities with selenium 3.4.3, firefox 54.0 and gecko driver 0.17 - Stack Overflow
Commits related to this issue
- Read Firefox version by launching binary if mozversion fails (#685) In some circumstances mozversion's attempt to read the Firefox version from ini files can fail. This can be, for example, when the... — committed to mozilla/geckodriver by jgraham 7 years ago
- geckodriver: Read Firefox version by launching binary if mozversion fails (#685) In some circumstances mozversion's attempt to read the Firefox version from ini files can fail. This can be, for examp... — committed to mozilla/gecko-dev by jgraham 7 years ago
- geckodriver: Read Firefox version by launching binary if mozversion fails (#685) In some circumstances mozversion's attempt to read the Firefox version from ini files can fail. This can be, for examp... — committed to aethanyc/gecko-dev by jgraham 7 years ago
- geckodriver: Read Firefox version by launching binary if mozversion fails (#685) In some circumstances mozversion's attempt to read the Firefox version from ini files can fail. This can be, for examp... — committed to JerryShih/gecko-dev by jgraham 7 years ago
- Updated the firefox object creation in browser_factory for a bug in certain Firefox+Gecko-Driver+Python combinations. Using capabilities matrix implemented fix from https://github.com/SeleniumHQ/sele... — committed to shawnjburke/browser_driver by deleted user 6 years ago
- geckodriver: Read Firefox version by launching binary if mozversion fails (#685) In some circumstances mozversion's attempt to read the Firefox version from ini files can fail. This can be, for examp... — committed to marco-c/gecko-dev-wordified-and-comments-removed by marco-c 5 years ago
- geckodriver: Read Firefox version by launching binary if mozversion fails (#685) In some circumstances mozversion's attempt to read the Firefox version from ini files can fail. This can be, for examp... — committed to marco-c/gecko-dev-comments-removed by marco-c 5 years ago
- geckodriver: Read Firefox version by launching binary if mozversion fails (#685) In some circumstances mozversion's attempt to read the Firefox version from ini files can fail. This can be, for examp... — committed to marco-c/gecko-dev-wordified by marco-c 5 years ago
This bug will remain closed until we can get a high quality bug report. Me too comments don’t really add value
unforunately… no one in my team can reproduce this issue
@AutomatedTester actually, for me it’s exactly that,
driver = webdriver.Firefox()
issue.I was experiencing the same issue.
I downloaded my geckogriver from: https://github.com/mozilla/geckodriver/releases/download/v0.16.1/geckodriver-v0.16.1-linux64.tar.gz (same as @krzysztofzuraw), but my binary did say it was version 0.16.1 (geckodriver --version).
Arch: linux (ubuntu 14.04) Python: 2.7.6 selenium: 3.4.0 firefox: 51.0.1
Running (either the commented code or) the normal code from:
yields (at line 5 or 7)
However, following @alimp5’s suggestion, the following code worked:
I used technique below, and selenium is working now.
capabilities = webdriver.DesiredCapabilities().FIREFOX capabilities[“marionette”] = False binary = FirefoxBinary(r’/usr/bin/firefox’) driver = webdriver.Firefox(firefox_binary=binary, capabilities=capabilities)
Reference (Idea): http://seleniumsimplified.com/2017/03/changes-in-selenium-webdriver-3-1-0-3-2-0-3-3-0-and-3-3-1-for-java/
Thanks
@jgraham Thanks for the info.
Firefox now launches correctly after amending the test
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).
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
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
OK, so we didn’t consider the possibility of the
firefox
executable being a shell script outside thefirefox
directory. As a short term workaround, if you look in that shell script you should be able to find the real binary path and use that as a capability when you launch geckodriver.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.
If you have Firefox 64-bits version, then download Gecko 64-bits version, same for 32-bits. This solved my problem.
Exception in thread “main” org.openqa.selenium.WebDriverException: connection refused Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’ System info: host: ‘KARTIK-PC’, ip: ‘192.168.43.111’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_131’ Driver info: driver.version: FirefoxDriver remote stacktrace: stack backtrace: 0: 0x489f6f - <no info> 1: 0x48ad59 - <no info> 2: 0x43a15d - <no info> 3: 0x440de2 - <no info> 4: 0x443f9a - <no info> 5: 0x41ddb1 - <no info> 6: 0x4091c7 - <no info> 7: 0x6bc939 - <no info> 8: 0x415a19 - <no info> 9: 0x6b6e43 - <no info> 10: 0x7798652d - BaseThreadInitThunk at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57) at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$22(ProtocolHandshake.java:365) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:191) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:108) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104) at NewPackage.WebDriverDemo.main(WebDriverDemo.java:14)
Great! Thanks for the debugging information. I’ll try to come up with a good solution for this and get a release of geckodriver out with it fixed.
Maybe you should Chrome. I use Google Chrome with chromedriver. It’s fine
driver = webdriver.Chrome()
Here: Arch: OSX ElCapitain 10.11.6 Python: 2.7.10 Selenium: 3.4.1 Firefox: 53.0 (64-bit)
Worked like a charm.
Same problem as @jricardo27:
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.
Install latest firefox and install latest geckodriver fixed it
Ubuntu 16: “apt install firefox” did the trick.
Guys download the firefox binary from here https://ftp.mozilla.org/pub/firefox/releases/46.0.1/ Then use the following code by assigning the binary path to the one you just downloaded:
For me, the cause of this problem was the incorrect binary path. I am using Firefox Developer Edition and the path of binary is
/usr/bin/firefox-developer-edition
on Arch Linux. If someone steps on the same problem using Firefox Developer Edition, take care of the path.Mac user here. If it helps anyone I fixed this by making sure Firefox was named “Firefox” and in the Applications folder. I had the error when it was named “Firefox 58” (I have multiple versions).
on MAC os I had also got into this and back to back into series of multiple issues After trying multiple versions compatibility. This is what starts my app, can be useful.
Gecko: v0.19.0, Selenium: 3.6.0, Firefox: 55.0.3, 56.0
Gecko: v0.16.0, Selenium: 3.6.0, Firefox: 53.0.3 & 55.0.3 & 56.0
I also faced similar issue “Unable to find matching capabilities”, Soluiton was use following version Selenium: 3.6.0.0 Firefox: 53.0 geckodriver: 16.1 This works fine for me on firefox
Thanks 😃
@danger89 Is this the complete content of geckodriver.log? The next line should be like
1502893059721 geckodriver::marionette INFO Starting browser C:\Program Files\Mozilla Firefox\firefox.exe with args ["-marionette"]
I can reproduce the issue if geckodriver attempts to start Firefox ESR 52. Yes, the error message is misleading in this case, but it’s a diferent issue.
Try to specify path to the browser explicitly:
driver = webdriver.Firefox(firefox_binary="C:/Program Files/Mozilla Firefox/firefox.exe")
… that means a configuration issue, Selenium found too old browser version and could not run it normally. Providing path to a more recent browser version fixed the issue.
selenium 3.4.3 firefox 54.0.1 python 2.7.13 geckodriver 0.16.0 0.17.0
same issue
webdriver 3.4.0 geckodrover 16.0 firefox 52.0
Still gettin gthe error
Exception in thread “main” java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases at com.google.common.base.Preconditions.checkState(Preconditions.java:738) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:124) at org.openqa.selenium.firefox.GeckoDriverService.access$100(GeckoDriverService.java:41) at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:115) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:330) at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:207) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:108) at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:104) at SeleniumTask.main(SeleniumTask.java:13)
On Wed, May 31, 2017 at 2:15 AM, Bob Frankston notifications@github.com wrote:
Yes, I was about to comment that we made a release to address this bug. Glad it helped 😃
geckodriver has been fixed (v0.16.1) and this issue is gone!
@jgraham firefox is in /bin, which is linked to /usr/bin, no *.ini files there also.
@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.
@lmtierney yes. @thewinduppirate interesting, this looks to be Arch specific.
Same platform and stack as @Nagasaki45, same issue.
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.