Page MenuHomePhabricator
Paste P12960

Headless Chrome giving error for Selenium tests - Failed in Chrome
ActivePublic

Authored by Hulya on Oct 10 2020, 4:33 AM.
> @ selenium-test /Users/hulyakarakaya/Desktop/core
> wdio ./tests/selenium/wdio.conf.js
Execution of 6 spec files started at 2020-10-10T04:28:56.597Z
[0-0] RUNNING in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
[0-0] (node:28073) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-0] 2020-10-10T04:28:57.770Z ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: net::ERR_CONNECTION_REFUSED
(Session info: headless chrome=86.0.4240.75)
[0-0]
Screenshot location: /Users/hulyakarakaya/Desktop/core/tests/selenium/log/BlankPage-should-have-its-title-%40daily.png
[0-0] unknown error in "BlankPage should have its title @daily"
unknown error: net::ERR_CONNECTION_REFUSED
(Session info: headless chrome=86.0.4240.75)
[0-0] FAILED in chrome - /tests/selenium/wdio-mediawiki/specs/BlankPage.js
[0-1] RUNNING in chrome - /tests/selenium/specs/page.js
[0-1] (node:28090) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-1] Error in "Page "before all" hook for "should be previewable""
connect ECONNREFUSED 127.0.0.1:8080
[0-1] FAILED in chrome - /tests/selenium/specs/page.js
[0-2] RUNNING in chrome - /tests/selenium/specs/rollback.js
[0-2] (node:28098) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-2] 2020-10-10T04:29:00.941Z ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: net::ERR_CONNECTION_REFUSED
(Session info: headless chrome=86.0.4240.75)
[0-2] unknown error in "Rollback with confirmation "before all" hook for "should offer rollback options for admin users""
unknown error: net::ERR_CONNECTION_REFUSED
(Session info: headless chrome=86.0.4240.75)
[0-2] 2020-10-10T04:29:00.986Z ERROR webdriver: Request failed with status 500 due to unknown error: unknown error: net::ERR_CONNECTION_REFUSED
(Session info: headless chrome=86.0.4240.75)
[0-2] unknown error in "Rollback without confirmation "before all" hook for "should perform rollback via POST request without asking the user to confirm""
unknown error: net::ERR_CONNECTION_REFUSED
(Session info: headless chrome=86.0.4240.75)
[0-2] FAILED in chrome - /tests/selenium/specs/rollback.js
[0-3] RUNNING in chrome - /tests/selenium/specs/specialrecentchanges.js
[0-3] (node:28115) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-3] Error in "Special:RecentChanges "before all" hook for "shows page creation""
connect ECONNREFUSED 127.0.0.1:8080
[0-3] FAILED in chrome - /tests/selenium/specs/specialrecentchanges.js
[0-4] RUNNING in chrome - /tests/selenium/specs/specialwatchlist.js
[0-4] (node:28123) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-4] Error in "Special:Watchlist "before all" hook for "should show page with new edit""
connect ECONNREFUSED 127.0.0.1:8080
[0-4] FAILED in chrome - /tests/selenium/specs/specialwatchlist.js
[0-5] RUNNING in chrome - /tests/selenium/specs/user.js
[0-5] (node:28131) DeprecationWarning: Got: "options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"
[0-5] Error in "User "before all" hook for "should be able to create account""
connect ECONNREFUSED 127.0.0.1:8080
[0-5] FAILED in chrome - /tests/selenium/specs/user.js
"dot" Reporter:
F
Spec Files: 0 passed, 6 failed, 6 total (100% completed) in 00:00:08
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ selenium-test: `wdio ./tests/selenium/wdio.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ selenium-test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hulyakarakaya/.npm/_logs/2020-10-10T04_29_04_944Z-debug.log

Event Timeline

I couldn't run the tests, searched for the issue; but I couldn't find a solution for the ERR_CONNECTION_REFUSED
(Session info: headless chrome=86.0.4240.75).

Any help would be great!

Hi @Hulya, By seeing your core location /Users/hulyakarakaya/Desktop/core I'm wondering why you placed core in desktop?
Generally, core should be placed in your default root folder of the web server for instance /Users/hulyakarakaya/var/www/html/core (if you are in linux system). and yes it depends on your operating system aswell.

Oh, I've placed the project into the root and ran with Docker and chrome driver. I am getting this response:

chromedriver --url-base=wd/hub --port=4444
Starting ChromeDriver 86.0.4240.22 (398b0743353ff36fb1b82468f63a3a93b4e2e89e-refs/branch-heads/4240@{#378}) on port 4444
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.

In another terminal, I am running npm run selenium-test and getting these errors. I am using macOS Catalina Version: 10.15.4