1

I'm running a basic automated testcafe test that clicks a button (which triggers an API) and waits for a response to be displayed on the page so the test can continue. The website just fails with a 500 error coming from that API call just after clicking that button only when I run the scenario VIA TESTCAFE on latest's versions of Chrome, Firefox, Opera and Edge. The application and tests pass when running tests on older versions of the mentioned Browsers from testcafe, or when I run the test manually on the latest browser.

After some investigation I noted Chrome v89 adds two new request headers that are sent by default: sec-ch-ua and sec-ch-ua-mobile only when I run the test manually, but when I run the test via TestCafe these 2 headers are not passed which breaks the call to the API.

Found the new feature added by Chrome here:

sec-ch-ua: "Chromium";v="86", "\"Not\\A;Brand";v="99", "Google Chrome";v="86"
sec-ch-ua-mobile: ?0

enter image description here

I have "testcafe": "^1.13.0",using Chrome latest Version 89.0.4389.72 (64-bit)

Anybody knows how to make TestCAfe Tests to behave exactly the same (adding those 2 headers) as when I run the test manually using latest Chrome?

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
Esteban Balvin
  • 117
  • 3
  • 13

1 Answers1

1

try updating to testcafe v.1.14.0. If the problem still persists, please create an issue in the TestCafe repository and share an example that can be reproduced locally.