You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When launching a test on Saucelabs, if the maximum number of sessions is already reached, the test is put in a queue.
In such a case, the request on /wd/hub/session responds with a status 303 and the headers:
Notice that the location header is a relative url, it does not contain the hostname.
The problem
Instead of sending the next request to the Saucelabs server, it sends it to 127.0.0.1 and fails.
See the last line of the attached logs:
Connection refused to 127.0.0.1:443
Analysis from local debugging
The location header is parsed with require("url").parse() in request.js#L228 which returns { hostname: null, port:null }.
This sets the hostname of the following requests to null and later defaults to 127.0.0.1 in the following requests.
Below are the files I used to reproduce, but one really needs a Saucelabs instance with all its sessions busy to reproduce.
The redirection worked fine in versions 1.7.x.
Sample test
sampleTest.js
describe('Ecosia.org Demo',function(){before(browser=>browser.navigateTo('https://www.ecosia.org/'));it('Demo test ecosia.org',function(browser){browser.waitForElementVisible('body').assert.titleContains('Ecosia').assert.visible('input[type=search]').setValue('input[type=search]','nightwatch').assert.visible('button[type=submit]').click('button[type=submit]').assert.textContains('.mainline-results','Nightwatch.js');});after(browser=>browser.end());});
[Ecosia.org Demo] Test Suite
────────────────────────────────────────────────────────
⠋ Connecting to ondemand.eu-central-1.saucelabs.com on port 443...
Request POST https://ondemand.eu-central-1.saucelabs.com/wd/hub/session
{ desiredCapabilities:
{ browserName: 'chrome',
'sauce:options': { ... },
name: 'Ecosia.org Demo',
'goog:chromeOptions': {} },
capabilities: { ... }
⠴ Connecting to ondemand.eu-central-1.saucelabs.com on port 443...
Response 303 POST https://ondemand.eu-central-1.saucelabs.com/wd/hub/session (45452ms)
{}
Request GET https://ondemand.eu-central-1.saucelabs.com/wd/hub/session/123-sessionId
{ desiredCapabilities:
{ browserName: 'chrome',
'sauce:options': { ... },
name: 'Ecosia.org Demo',
'goog:chromeOptions': {} },
capabilities: { ... }
GET https://ondemand.eu-central-1.saucelabs.com /wd/hub/session/123-sessionId - ECONNREFUSED
⠦ Connecting to ondemand.eu-central-1.saucelabs.com on port 443...
Request GET https://ondemand.eu-central-1.saucelabs.com/wd/hub/session/123-sessionId (retry 1)
...
TEST FAILURE (45.849s):
- 1 error during execution;
- 0 tests failed;
- 0/NA tests passed
Error: An error occurred while creating a new Selenium Server session: Connection refused to 127.0.0.1:443. If the Webdriver/Selenium service is managed by Nightwatch, check if "start_process" is set to "true".
Describe the bug
When launching a test on Saucelabs, if the maximum number of sessions is already reached, the test is put in a queue.
In such a case, the request on
/wd/hub/session
responds with a status303
and the headers:Notice that the location header is a relative url, it does not contain the hostname.
The problem
Instead of sending the next request to the Saucelabs server, it sends it to
127.0.0.1
and fails.See the last line of the attached logs:
Analysis from local debugging
The
location
header is parsed withrequire("url").parse()
in request.js#L228 which returns{ hostname: null, port:null }
.This sets the hostname of the following requests to null and later defaults to
127.0.0.1
in the following requests.According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location#directives, the location header can be relative or absolute.
Below are the files I used to reproduce, but one really needs a Saucelabs instance with all its sessions busy to reproduce.
The redirection worked fine in versions
1.7.x
.Sample test
sampleTest.js
Run with command
Verbose output
debug.log
Configuration
config.js
Your Environment
nightwatch --version
npm --version
node --version
The text was updated successfully, but these errors were encountered: