Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find a matching set of capabilities #4

Closed
Noam5 opened this issue Jun 30, 2018 · 8 comments
Closed

Unable to find a matching set of capabilities #4

Noam5 opened this issue Jun 30, 2018 · 8 comments
Assignees
Labels
selenium-related Selenium bug

Comments

@Noam5
Copy link

Noam5 commented Jun 30, 2018

I have the following issue when running these 2 lines of code:

from selenium import webdriver
wser = webdriver.Firefox()

Traceback (most recent call last):

File "", line 1, in
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 154, in init
keep_alive=True)
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 140, in init
self.start_session(desired_capabilities, browser_profile)
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 229, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 297, in execute
self.error_handler.check_response(response)
File "/home/pi/.local/lib/python2.7/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

Also, In an older version of selenium (3.3.0) I get the following error:

Traceback (most recent call last):
File "", line 1, in
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 155, in init
keep_alive=True)
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 92, in init
self.start_session(desired_capabilities, browser_profile)
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 179, in start_session
response = self.execute(Command.NEW_SESSION, capabilities)
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 238, in execute
self.error_handler.check_response(response)
File "/home/pi/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line

@dezeroku
Copy link
Owner

dezeroku commented Jul 1, 2018

First of all: which version of GeckoDriver are you using, what is your operating system and your ARM device.

@dezeroku dezeroku self-assigned this Jul 1, 2018
@Noam5
Copy link
Author

Noam5 commented Jul 1, 2018

I tried with 0.16.1, 0.19.0 and 0.21.0. My operating system is Raspberry pi zero armv6l

@Noam5
Copy link
Author

Noam5 commented Jul 1, 2018

I think the first problem is solvable with the parameter "desired_capabilities".
for example: webdriver.Firefox(desired_capabilities={'?': '?'})

@dezeroku
Copy link
Owner

dezeroku commented Jul 1, 2018

Code that worked for me about half a year ago

That's the code which worked for me about half a year ago:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

caps = DesiredCapabilities().FIREFOX
caps["marionette"] = True
driver = webdriver.Firefox(capabilities=caps, executable_path="./geckodriver")

driver.get("https://accounts.google.com/signin")

You have to keep geckodriver binary in the same folder where you run your python file.

Update your firefox

Also, from what i found, that error can be solved by upgrading your firefox.

Explicitly provide path to firefox binary

In issue #3884 in Selenium issues tracker that problem was solved by directly specyfing firefox path in code. That would look similar to this:

from selenium import webdriver
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary('path_to_firefox')
driver = webdriver.Firefox(firefox_binary=binary)
driver.get('https://google.com')

You have to run

which firefox

and replace path_to_firefox with output of that command. That program should launch firefox properly and open google.com

If above options don't help:

Raspberry pi zero armv6l is NOT an operating system. It is a device on which you run your operating system. Most probably it is Raspbian or something similar. If options above don't help, please try to find name of that OS and version of your Firefox browser.

@Noam5
Copy link
Author

Noam5 commented Jul 2, 2018

The firefox explicit path indeed works, although it was horridly slow on the Raspberry pi zero. Still having problem running firefox using the first solution. The operating system I use is Raspbian

@dezeroku
Copy link
Owner

dezeroku commented Jul 2, 2018

If it works you can use code with providing path explicitly as base for future programs, you just have to start every program with it. Talking about speed... Yeah, it was slow for me too, that's actually why i stopped using it. I don't think there is any workaround for this at the moment, except buying more powerful device. I am glad that it works in the end :)

@dezeroku dezeroku added the selenium-related Selenium bug label Jul 2, 2018
@Noam5
Copy link
Author

Noam5 commented Jul 2, 2018

Thank you so much for your help!
I think i'll move to Raspberry pi B :)

@dezeroku
Copy link
Owner

dezeroku commented Jul 2, 2018

If you really want to move to something better I would rather consider Raspberry Pi 2B or even something newer. Raspberry Pi B (the first version) has same CPU and amount of memory as RPi Zero, so selenium probably would lag terribly on it too ;) RPi 2B has 4 cores and 1 gig of RAM versus 1 core and 512 mega of ram in RPi Zero/RPi B case, so numbers speak for themselves.

@dezeroku dezeroku closed this as completed Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
selenium-related Selenium bug
Projects
None yet
Development

No branches or pull requests

2 participants