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?
Asked
Active
Viewed 1,715 times
1 Answers
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