From the course: Playwright Essential Training: Abstractions, Fixtures, and Complex Scenarios
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Localization and geolocation in Playwright - Microsoft Playwright Tutorial
From the course: Playwright Essential Training: Abstractions, Fixtures, and Complex Scenarios
Localization and geolocation in Playwright
- [Instructor] While our practice site doesn't have any automatic geolocation or localization changes, many modern web apps will respond differently based on location or time zone of the browser. Let's take a look at geolocation first to get an understanding of what Playwright is doing. To do this, let's go ahead and open up a Chrome window in incognito mode and we are going to right click and click inspect. This is the Chrome dev tools. We are going to find the three dots over here on the right hand side. Click this button. We are going to click more tools and we're going to scroll down to sensors and click this. So this is going to add a new sensor area and what this allows you to do is set your location. There are a bunch of presets in here, so let's just choose Tokyo and let's go ahead and just go to bing.com. As you can see, the site is rendering in Japanese. This is because of the location that we set here. If we change this to Berlin, potentially that will change. So we're not…
Contents
-
-
-
-
-
(Locked)
Overview of network routing in Playwright5m 8s
-
(Locked)
Intercepting HTTP requests with Playwright13m 32s
-
(Locked)
Mocking HTTP responses with Playwright11m 14s
-
(Locked)
Browser emulation in Playwright9m 35s
-
(Locked)
Localization and geolocation in Playwright3m 45s
-
(Locked)
Injecting JavaScript in Playwright11m 11s
-
(Locked)
Challenge: Mocking and emulation in Playwright1m 29s
-
(Locked)
Solution: Mocking and emulation in Playwright6m 53s
-
(Locked)
-
-
-