Skip to content

Commit 7aad3e1

Browse files
committed
Add: Adding py code samples for devtools #612 [deploy site]
1 parent 320c6b6 commit 7aad3e1

File tree

8 files changed

+96
-8
lines changed

8 files changed

+96
-8
lines changed

docs_source_files/content/support_packages/chrome_devtools.de.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ public void geoLocationTest(){
3535
}
3636
{{< / code-panel >}}
3737
{{< code-panel language="python" >}}
38-
# Please raise a PR to add code sample
38+
from selenium import webdriver
39+
from selenium.webdriver.chrome.service import Service
40+
41+
def geoLocationTest():
42+
driver = webdriver.Chrome()
43+
Map_coordinates = dict({
44+
"latitude": 41.8781,
45+
"longitude": -87.6298,
46+
"accuracy": 100
47+
})
48+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
49+
driver.get("<your site url>")
3950
{{< / code-panel >}}
4051
{{< code-panel language="csharp" >}}
4152
using System.Threading.Tasks;

docs_source_files/content/support_packages/chrome_devtools.es.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ public void geoLocationTest(){
3535
}
3636
{{< / code-panel >}}
3737
{{< code-panel language="python" >}}
38-
# Please raise a PR to add code sample
38+
from selenium import webdriver
39+
from selenium.webdriver.chrome.service import Service
40+
41+
def geoLocationTest():
42+
driver = webdriver.Chrome()
43+
Map_coordinates = dict({
44+
"latitude": 41.8781,
45+
"longitude": -87.6298,
46+
"accuracy": 100
47+
})
48+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
49+
driver.get("<your site url>")
3950
{{< / code-panel >}}
4051
{{< code-panel language="csharp" >}}
4152
using System.Threading.Tasks;

docs_source_files/content/support_packages/chrome_devtools.fr.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ public void geoLocationTest(){
3535
}
3636
{{< / code-panel >}}
3737
{{< code-panel language="python" >}}
38-
# Please raise a PR to add code sample
38+
from selenium import webdriver
39+
from selenium.webdriver.chrome.service import Service
40+
41+
def geoLocationTest():
42+
driver = webdriver.Chrome()
43+
Map_coordinates = dict({
44+
"latitude": 41.8781,
45+
"longitude": -87.6298,
46+
"accuracy": 100
47+
})
48+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
49+
driver.get("<your site url>")
3950
{{< / code-panel >}}
4051
{{< code-panel language="csharp" >}}
4152
using System.Threading.Tasks;

docs_source_files/content/support_packages/chrome_devtools.ja.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,18 @@ public void geoLocationTest(){
3939
}
4040
{{< / code-panel >}}
4141
{{< code-panel language="python" >}}
42-
# Please raise a PR to add code sample
42+
from selenium import webdriver
43+
from selenium.webdriver.chrome.service import Service
44+
45+
def geoLocationTest():
46+
driver = webdriver.Chrome()
47+
Map_coordinates = dict({
48+
"latitude": 41.8781,
49+
"longitude": -87.6298,
50+
"accuracy": 100
51+
})
52+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
53+
driver.get("<your site url>")
4354
{{< / code-panel >}}
4455
{{< code-panel language="csharp" >}}
4556
using System.Threading.Tasks;

docs_source_files/content/support_packages/chrome_devtools.ko.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ public void geoLocationTest(){
3535
}
3636
{{< / code-panel >}}
3737
{{< code-panel language="python" >}}
38-
# Please raise a PR to add code sample
38+
from selenium import webdriver
39+
from selenium.webdriver.chrome.service import Service
40+
41+
def geoLocationTest():
42+
driver = webdriver.Chrome()
43+
Map_coordinates = dict({
44+
"latitude": 41.8781,
45+
"longitude": -87.6298,
46+
"accuracy": 100
47+
})
48+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
49+
driver.get("<your site url>")
3950
{{< / code-panel >}}
4051
{{< code-panel language="csharp" >}}
4152
using System.Threading.Tasks;

docs_source_files/content/support_packages/chrome_devtools.nl.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ public void geoLocationTest(){
3535
}
3636
{{< / code-panel >}}
3737
{{< code-panel language="python" >}}
38-
# Please raise a PR to add code sample
38+
from selenium import webdriver
39+
from selenium.webdriver.chrome.service import Service
40+
41+
def geoLocationTest():
42+
driver = webdriver.Chrome()
43+
Map_coordinates = dict({
44+
"latitude": 41.8781,
45+
"longitude": -87.6298,
46+
"accuracy": 100
47+
})
48+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
49+
driver.get("<your site url>")
3950
{{< / code-panel >}}
4051
{{< code-panel language="csharp" >}}
4152
using System.Threading.Tasks;

docs_source_files/content/support_packages/chrome_devtools.pt-br.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ public void geoLocationTest(){
2929
}
3030
{{< / code-panel >}}
3131
{{< code-panel language="python" >}}
32-
# Por favor inclua um PR para adicionar um exemplo de código
32+
from selenium import webdriver
33+
from selenium.webdriver.chrome.service import Service
34+
35+
def geoLocationTest():
36+
driver = webdriver.Chrome()
37+
Map_coordinates = dict({
38+
"latitude": 41.8781,
39+
"longitude": -87.6298,
40+
"accuracy": 100
41+
})
42+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
43+
driver.get("<your site url>")
3344
{{< / code-panel >}}
3445
{{< code-panel language="csharp" >}}
3546
using System.Threading.Tasks;

docs_source_files/content/support_packages/chrome_devtools.zh-cn.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ public void geoLocationTest(){
2929
}
3030
{{< / code-panel >}}
3131
{{< code-panel language="python" >}}
32-
# Please raise a PR to add code sample
32+
from selenium import webdriver
33+
from selenium.webdriver.chrome.service import Service
34+
35+
def geoLocationTest():
36+
driver = webdriver.Chrome()
37+
Map_coordinates = dict({
38+
"latitude": 41.8781,
39+
"longitude": -87.6298,
40+
"accuracy": 100
41+
})
42+
driver.execute_cdp_cmd("Emulation.setGeolocationOverride", Map_coordinates)
43+
driver.get("<your site url>")
3344
{{< / code-panel >}}
3445
{{< code-panel language="csharp" >}}
3546
using System.Threading.Tasks;

0 commit comments

Comments
 (0)