0

What is te correct way to set the user-agent in cypress Version 6 and later? Everthing i testet is not working. The Header Information is not send. Is there is a workaround? Is it possible to set the user-agent dynamically?

wutangl
  • 33
  • 7
  • 3
    Does this answer your question? [Is there a programmatic way to change user agent in Cypress.io?](https://stackoverflow.com/questions/51048880/is-there-a-programmatic-way-to-change-user-agent-in-cypress-io) – K. B. Dec 20 '20 at 11:56

1 Answers1

2

You can override your user-agent by providing its value in cypress.json file, something like:

{
  "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
}

You can get the list of Commonly used User agents from the User-Agent MDN Documentation.

Alapan Das
  • 17,144
  • 3
  • 29
  • 52