Skip to content

Commit d9b33dc

Browse files
committed
Update Geolocation examples
1 parent c235aac commit d9b33dc

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

examples/cdp_mode/raw_geolocation.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
def main():
88
url = "https://www.openstreetmap.org/"
99
sb = sb_cdp.Chrome(url, geoloc=(48.87645, 2.26340))
10-
sb.click("span.geolocate")
10+
sb.sleep(2)
11+
sb.click('a[aria-label="Show My Location"]')
1112
sb.assert_url_contains("48.876450/2.263400")
1213
sb.sleep(5)
1314

examples/cdp_mode/raw_geolocation_sb.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
with SB(uc=True, test=True) as sb:
55
url = "https://www.openstreetmap.org/"
66
sb.activate_cdp_mode(url, geoloc=(31.774390, 35.222450))
7-
sb.click("span.geolocate")
7+
sb.click('a[aria-label="Show My Location"]')
88
sb.assert_url_contains("31.774390/35.222450")
99
sb.sleep(5)

examples/test_geolocation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_geolocation(self):
3838
},
3939
)
4040
self.open("https://www.openstreetmap.org/")
41-
self.click("span.geolocate")
41+
self.click('a[aria-label="Show My Location"]')
4242
self.assert_url_contains("48.876450/2.263400")
4343
self.save_screenshot_to_logs()
4444
if self.headed:

0 commit comments

Comments
 (0)