-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Setting a different locale does not work as expected #30842
Comments
Update 1 I also added this to check what the detected locale is and the result was indeed
Update 2 Also checked the request headers and the Update 3: tried this on other websites as well and I always get redirected based on my real location and not based on the one set by Playwright |
They may be redirecting you based on your IP address or some other logic. The adidas url does redirect me to 'https://www.adidas.com/us'. If you think that Playwright is not changing some settings properly based on locale, please provide a self contained reproduction which we could run locally. |
If that is the case (it most likely is), is there another (better) way to emulate a location by using Playwright, so that we can verify that the redirect happens as expected based on location? |
IP address based geolocation detection can only be emulated on the networking level, so e.g. a proxy might work for you. Closing since thats not a bug in Playwright. |
Version
1.44.0
Steps to reproduce
I am based in The Netherlands. I am trying to write a test that checks if a redirect happens as expected based on the user's locale or location. The example I will give you below tests the Adidas website. This is just an example, I don't actually work at/for Adidas. :)
This is the test:
Expected behavior
I expect to be redirected to
https://www.adidas.de
Actual behavior
I am redirected to
https://www.adidas.nl
Additional context
It seems like the redirect happens based on my actual location/locale and not based on the one I set by using
test.use()
.Environment
I tested this with several other locales, but the redirect still always happens based on my "real" location and not based on the one I set in the test.
The text was updated successfully, but these errors were encountered: