TestCafe cannot load website with incorrect headers
See original GitHub issueWhat is your Test Scenario?
I’m trying to load https://www.freepeople.com and verify that the page loaded.
What is the Current behavior?
When I’m using node version 12 and above, the page never loads and is stuck at the “about:blank” page. If I use node 10.13.0, the page loads successfully. I am able to load other pages on node version 12, so I’m not sure why this website specifically won’t load.
What is the Expected behavior?
I am expecting the page to load.
What is your web application and your TestCafe test code?
Using node version 12.13.0, and testcafe v1.6.1
import { Selector, ClientFunction } from 'testcafe';
function getUrl() {
const clientfunction = ClientFunction(() => document.location.href);
return clientfunction();
}
fixture('Core Application Tests')
test('Should load the page', async (t) => {
await t.navigateTo('https://www.freepeople.com');
await t.wait(3000);
await t.expect(getUrl()).eql('https://www.freepeople.com');
});
Steps to Reproduce:
- Run the above code using node version 10.13.0, and testcafe v1.6.1
- Notice that the website loads correctly
- Run the above code using node version 12.13, and testcafe v1.6.1
- Notice that the website never loads, and is stuck on the about:blank page
Your Environment details:
- testcafe version: 1.6.1
- node.js version: 12.13.0
- command-line arguments:
- browser name and version: Chrome, Firefox
- platform and version: macOS 10.14. Also able to reproduce using docker
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Testcafe doesn't load certain sites, results in about:error #4833
After testcafe connects to the browser, it fails to load the page. ... that the side produces a response header with an incorrect...
Read more >Authentication and Roles | Advanced Guides - TestCafe
TestCafe can open web pages that require HTTP Basic and Windows (NTLM) authentication. Use the test. httpAuth method to specify credentials for each...
Read more >testcafe - UNPKG
38, * TestCafe incorrectly specifies the Referer HTTP request header if you ... When TestCafe revisits a website, it loads assets from this...
Read more >Cannot add header value to HTTP request via hooks
Using Testcafe, I am trying to add an HTTP Header key/value pair to all my requests, but it is not appearing in the...
Read more >TestCafe Webinar - Your Questions Answered
But we recommend using TestCafe for end-to-end rather than load testing. Can I run the tests in parallel in multiple browser windows? Yes, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue relates to node.js that works according to http specification. On the TestCafe side we will fix it in the following way:
Parse Error: Invalid header value char
.As a workaround, you can revert to the parsing header behavior on Node.js side by passing the
NODE_OPTIONS='--http-parser=legacy'
environment variable. Thanks @andrzej-kodify.@KingM1
Hello,
Thank you for the detailed information. I’ve reproduced the issue with our
testcafe-hammerhead@14.11.1
proxy:node@10.13.0
- loadednode@10.17.0
,node@12.13.1
- didn’t loadOur team will research it and check for a suitable solution.