Failed to find a DNS-record for the resource at "http://localhost:8080"
Closed this issue · 3 comments
What is your Scenario?
Node version: 18.12.1
testcafe version: 3.6.2
when I try to run testcafe it gives me following error:
Failed to load the page at "http://localhost:8080".
Increase the value of the "pageRequestTimeout" variable, enable the "retryTestPages" option, or use quarantine mode to perform additional attempts to execute this test.
You can find troubleshooting information for this issue at "https://go.devexpress.com/TestCafe_FAQ_ARequestHasFailed.aspx".
Error details:
Failed to find a DNS-record for the resource at "http://localhost:8080".
Windows 10
What is the Current behavior?
base url is "http://localhost:8080" but testcafe is returning DNS error
What is the Expected behavior?
testcafe should run the tests on "http://localhost:8080"
What is the public URL of the test page? (attach your complete example)
What is your TestCafe test code?
import { Selector } from 'testcafe';
fixtureSetup test E2e
;
test('Load the page', async t => {
const container = Selector('.test-div').addCustomDOMProperties({
outerHtml: el => el.outerHtml
});
await t.expect(container.exists).ok();
});
Your complete configuration file
{
baseUrl: 'http://localhost:8080',
src: ["tests/e2e/**/*.test.js"],
browsers: ['chrome'],
skipJsErrors: true
}
Your complete test report
- AssertionError: expected false to be truthy
Node version: 18.12.1
testcafe version: 3.6.2
when I try to run testcafe it gives me following error:
Failed to load the page at "http://localhost:8080".
Increase the value of the "pageRequestTimeout" variable, enable the "retryTestPages" option, or use quarantine mode to perform additional attempts to execute this test.
You can find troubleshooting information for this issue at "https://go.devexpress.com/TestCafe_FAQ_ARequestHasFailed.aspx".
Error details:
Failed to find a DNS-record for the resource at "http://localhost:8080".
Windows 10
Screenshots
No response
Steps to Reproduce
- npm install testcafe (version 3.6.2)
- npm testcafe
TestCafe version
3.6.2
Node.js version
18.12.1
Command-line arguments
testcafe
Browser name(s) and version(s)
chrome 129
Platform(s) and version(s)
No response
Other
No response
Hello,
I did not manage to reproduce the issue.
We need a simple and reliable example showing the issue from start to end. In your case, preferably, in the form of a repository.
The repository should contain all information and files necessary to reproduce the issue. Any user should be able to follow your instructions. Something like this:
Please refer to the following article:
The issue is related to Node 18 and how it (in)correctly resolves 'localhost'.
if you try 127.0.0.1 instead of localhost, i'm pretty sure it will work.
Or switch to Node 20.
This issue was automatically closed because there was no response to our request for more information from the original author. Currently, we don't have enough information to take action. Please reach out to us if you find the necessary information and are able to share it. We are also eager to know if you resolved the issue on your own and can share your findings with everyone.