Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
612 views
in Technique[技术] by (71.8m points)

python - Message: Unable to find a matching set of capabilities error using Selenium and GeckoDriver while loading on live server

I have to build an web application on a linux webserver that will use selenium with firefox . When I run the application the the linux server "localhost:5000" it works perfectly fine . But when i tried it with "127.0.0.1:80" it is not giving me an error during webdriver loading:

driver = webdriver.Firefox(executable_path='/usr/local/bin/geckodriver')

Error:

"Message: Unable to find a matching set of capabilities"  

In nginx access.log it is producing a http 200 and there is nothing on error.log in geckodriver.log it produce:

Listening on port 41209

Environment details:

  • selenium = 3.8.0
  • geckodriver = 0.18.0
  • Firefox version 53
  • python = 3.6

nginx imageApp.conf

server {
listen 80;
server_name 127.0.0.1;

location / {
    include proxy_params;
    proxy_pass http://unix:/home/administator/imageDetectionApplication/imageDetectionApplication.sock;
    }
}

imageDetectionApplication.service

I am completely new in linux server...!!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This error message...

Message: Unable to find a matching set of capabilities

...implies that the GeckoDriver was unable to initiate/spawn a new Browsing Context i.e. Firefox Browser session.

Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • Your Selenium Client version is 3.8.0 which is almost 2.5 years older.
  • Your JDK version is unknown to us.
  • Your GeckoDriver version is 0.18.0 which is older.
  • Your Firefox version is 53 which is also pretty old.

So there is a clear mismatch between the Selenium Client v3.8.0 , GeckoDriver v0.18.0 and the Firefox Browser v53


Solution

Ensure that:

  • JDK is upgraded to current levels JDK 8u251.
  • Selenium is upgraded to current levels Version 3.141.59.
  • GeckoDriver is upgraded to GeckoDriver v0.26.0 level.
  • Firefox is upgraded to current Firefox v72.0 levels.
  • GeckoDriver is present in the desired location.
  • GeckoDriver is having executable permission for non-root users.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • If your base Web Client version is too old, then uninstall it install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your Test as a non-root user.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

References

You can find a couple of relevant discussions in:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...