Allow setting the browser language
See original GitHub issueIs your feature request related to a problem? Please describe.
Our application behaves differently according to the language of the browser. Currently, we have no way of influencing the language.
Describe the solution you’d like
Ideally, it would be possible to set environment variables when starting an element test in the cloud which are then consumed by the browser. Also effectively setting the browser language in elements would be a solution (either using the TestSettings or the browser interface).
Describe alternatives you’ve considered
Methods I tried:
- setting parameters for chromium using
--lang=
doesn’t work due to restrictions of chromium itself - setting of environment variables is not supported when running in the cloud
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Setting language preferences in a browser - W3C
Chrome. Open the browser settings, and in the advanced section scroll down to find Languages . Open Language and Input Settings and add...
Read more >How to Change the Default Language of an Internet Browser.
On the right side of the Settings window, scroll down to the Languages section and click the Language option. Language option in Opera...
Read more >How to change the locale in chrome browser - Stack Overflow
Open chrome, go to chrome://settings/languages. On the left, you should see a list of languages. Use mouse to drag the language you want...
Read more >Change language in Chrome: step-by-step guide - IONOS
Quick overview: changing the Chrome browser language · Open the menu item “Settings.” · Expand the displayed settings and scroll down to the...
Read more >How to change the language in the Google Chrome browser
Run Google Chrome. · Click the three-dot icon beside your profile icon. · In the drop-down menu, select Settings. · In the left...
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
Hi @torfmaster,
The
--lang
launchArg doesn’t work due to a bug of Puppeteer. However, as @honglax suggested, you can set the browser language by usingextraHTTPHeaders
in the TestSettings. In my case, this is what I used:and this is the screenshot that I got when running the test on Flood (cloud), targeting Google. You can see that the language has been set to Bangla (Bangladesh)
Please try it out and let us know if you still have any problems.
Hi @torfmaster
Have you ever tried
extraHTTPHeaders: {'Accept-Language': 'en, fr, vi'}
withTestSettings
like this image below?