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
382 views
in Technique[技术] by (71.8m points)

selenium - Magento2 :Unable to create new service: ChromeDriverService

I've been trying to implements functional testing in magento using mftf i followed the same steps from this documenation

but i keep getting :

[FacebookWebDriverExceptionSessionNotCreatedException] Unable to create new service: ChromeDriverService Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-58-generic', java.version: '11.0.9.1' Driver info: driver.version: unknown

  • chrome driver: 87.0.4280.88
  • chrome browser: 87.0.4280.88
  • selenium : selenium-server-standalone-3.14.0.jar

I don't know how to fix it I've tried even changing my java to 11 but it's the same.

is there anyone familiar with this error, please.

and after running

xvfb-run java -Dwebdriver.chrome.driver=/usr/bin/chromedriver -jar selenium-server-standalone-3.141.59.jar  -debug 

i get this log

04:55:49.557 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358 04:55:49.667 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444 2021-01-04 04:55:49.721:INFO::main: Logging initialized @442ms to org.seleniumhq.jetty9.util.log.StdErrLog 04:55:50.032 INFO [WebDriverServlet.] - Initialising WebDriverServlet 04:55:50.157 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444 05:09:12.118 DEBUG [WebDriverServlet.handle] - Found handler: org.openqa.selenium.remote.server.commandhandler.BeginSession@466f6f9b 05:09:12.124 DEBUG [WebDriverServlet.lambda$handle$0] - /session: Executing POST on /session (handler: BeginSession) 05:09:12.242 INFO [ActiveSessionFactory.apply] - Capabilities are: { "browserName": "chrome", "chromeOptions": { "args": [ "--window-size=1280,1024", "--disable-extensions", "--enable-automation", "--disable-gpu", "--enable-Passthrough", "--disable-dev-shm-usage", "--ignore-certificate-errors" ] }, "unhandledPromptBehavior": "ignore" } 05:09:12.244 INFO [ActiveSessionFactory.lambda$apply$11] - Matched factory org.openqa.selenium.grid.session.remote.ServicedSession$Factory (provider: org.openqa.selenium.chrome.ChromeDriverService) 05:09:12.344 DEBUG [UrlChecker.waitUntilAvailable] - Waiting for [http://localhost:30458/status] 05:09:12.345 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status 05:09:12.642 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status 05:09:12.663 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status 05:09:12.704 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status 05:09:12.786 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status 05:09:12.947 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status mkdir: cannot create directory '/run/user/0': Permission denied 05:09:13.272 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 30458 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. 05:09:13.682 DEBUG [UrlChecker.lambda$waitUntilAvailable$1] - Polling http://localhost:30458/status 05:09:13.685 DEBUG [HttpURLConnection.writeRequests] - sun.net.www.MessageHeader@22c682325 pairs: {GET /status HTTP/1.1: null}{User-Agent: Java/1.8.0_275}{Host: localhost:30458}{Accept: text/html, image/gif, image/jpeg, *; q=.2, /; q=.2}{Connection: keep-alive} 05:09:13.839 DEBUG [HttpURLConnection.getInputStream0] - sun.net.www.MessageHeader@67c4080e4 pairs: {null: HTTP/1.1 200 OK}{Content-Length: 249}{Content-Type: application/json; charset=utf-8}{cache-control: no-cache} Thank you for your time.


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

1 Reply

0 votes
by (71.8m points)

This error message...

[FacebookWebDriverExceptionSessionNotCreatedException] Unable to create new service: ChromeDriverService Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: 'ubuntu', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-58-generic', java.version: '11.0.9.1' Driver info: driver.version: unknown

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


Details

You mentioned about using selenium-server-standalone-3.14.0.jar. However as per the error trace log, the Selenium version seems to be version: '3.141.59'

On similar lines, the error:

Unable to create new service: ChromeDriverService

indicates incompatibility between the version of the binaries you are using.


Solution

Ensure that:

  • JDK is upgraded to current levels JDK 8u271.
  • Selenium is upgraded to current released Version 3.141.59.
  • ChromeDriver is updated to current ChromeDriver v87.0 level.
  • Chrome is updated to current Chrome Version 87.0 level. (as per ChromeDriver v87.0 release notes).
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.

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

...