DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 671 forks source link

Failed to find a DNS-record for the resource at "http://localhost:8080" #8282

Open krushitagangani opened 2 weeks ago

krushitagangani commented 2 weeks ago

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)

http://localhost:8080

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

1) AssertionError: expected false to be truthy 2) 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

  1. npm install testcafe (version 3.6.2)
  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

Bayheck commented 5 days ago

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:

image

Please refer to the following article:

https://testcafe.io/documentation/402636/faq/general-info#how-to-create-a-minimal-working-example-when-you-submit-an-issue

stefanlivens commented 16 hours ago

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.