Skip to content

Commit 313d31c

Browse files
navin772harsha509
andauthored
[py]: add docs for get_log for chrome and edge (#2074)[deploy site]
add docs for `get_log` in python for chrome and edge Co-authored-by: Sri Harsha <[email protected]>
1 parent 79f6afb commit 313d31c

File tree

10 files changed

+48
-24
lines changed

10 files changed

+48
-24
lines changed

examples/python/tests/browsers/test_chrome.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,15 @@ def test_cast_features():
176176
pytest.skip("No available Cast sinks to test with.")
177177
finally:
178178
driver.quit()
179+
180+
181+
def test_get_browser_logs():
182+
driver = webdriver.Chrome()
183+
184+
driver.get("https://www.selenium.dev/")
185+
186+
logs = driver.get_log("browser")
187+
188+
# Assert that at least one log contains the expected message
189+
assert any("Uncaught TypeError" in log['message'] for log in logs), "No matching log message found."
190+
driver.quit()

examples/python/tests/browsers/test_edge.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,15 @@ def test_cast_features():
176176
pytest.skip("No available Cast sinks to test with.")
177177
finally:
178178
driver.quit()
179+
180+
181+
def test_get_browser_logs():
182+
driver = webdriver.Edge()
183+
184+
driver.get("https://www.selenium.dev/")
185+
186+
logs = driver.get_log("browser")
187+
188+
# Assert that at least one log contains the expected message
189+
assert any("Uncaught TypeError" in log['message'] for log in logs), "No matching log message found."
190+
driver.quit()

website_and_docs/content/documentation/webdriver/browsers/chrome.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ You can simulate various network conditions.
421421
{{< tab header="Java" >}}
422422
{{< badge-code >}}
423423
{{< /tab >}}
424-
{{% tab header="Python" %}}
425-
{{< badge-code >}}
426-
{{% /tab %}}
424+
{{< tab header="Python" >}}
425+
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}}
426+
{{< /tab >}}
427427
{{< tab header="CSharp" >}}
428428
{{< badge-code >}}
429429
{{< /tab >}}

website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ Chrome Castデバイスを操作することができ、タブの共有も含ま
415415
{{< tab header="Java" >}}
416416
{{< badge-code >}}
417417
{{< /tab >}}
418-
{{% tab header="Python" %}}
419-
{{< badge-code >}}
420-
{{% /tab %}}
418+
{{< tab header="Python" >}}
419+
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}}
420+
{{< /tab >}}
421421
{{< tab header="CSharp" >}}
422422
{{< badge-code >}}
423423
{{< /tab >}}

website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,9 @@ please refer to the
424424
{{< tab header="Java" >}}
425425
{{< badge-code >}}
426426
{{< /tab >}}
427-
{{% tab header="Python" %}}
428-
{{< badge-code >}}
429-
{{% /tab %}}
427+
{{< tab header="Python" >}}
428+
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}}
429+
{{< /tab >}}
430430
{{< tab header="CSharp" >}}
431431
{{< badge-code >}}
432432
{{< /tab >}}

website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,9 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱
424424
{{< tab header="Java" >}}
425425
{{< badge-code >}}
426426
{{< /tab >}}
427-
{{% tab header="Python" %}}
428-
{{< badge-code >}}
429-
{{% /tab %}}
427+
{{< tab header="Python" >}}
428+
{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}}
429+
{{< /tab >}}
430430
{{< tab header="CSharp" >}}
431431
{{< badge-code >}}
432432
{{< /tab >}}

website_and_docs/content/documentation/webdriver/browsers/edge.en.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ You can simulate various network conditions.
422422
{{< tab header="Java" >}}
423423
{{< badge-code >}}
424424
{{< /tab >}}
425-
{{% tab header="Python" %}}
426-
{{< badge-code >}}
427-
{{% /tab %}}
425+
{{< tab header="Python" >}}
426+
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}}
427+
{{< /tab >}}
428428
{{< tab header="CSharp" >}}
429429
{{< badge-code >}}
430430
{{< /tab >}}

website_and_docs/content/documentation/webdriver/browsers/edge.ja.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ Edge を使用して Chrome Cast デバイスを操作し、タブを共有す
408408
{{< tab header="Java" >}}
409409
{{< badge-code >}}
410410
{{< /tab >}}
411-
{{% tab header="Python" %}}
412-
{{< badge-code >}}
413-
{{% /tab %}}
411+
{{< tab header="Python" >}}
412+
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}}
413+
{{< /tab >}}
414414
{{< tab header="CSharp" >}}
415415
{{< badge-code >}}
416416
{{< /tab >}}

website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,9 @@ You can simulate various network conditions.
424424
{{< tab header="Java" >}}
425425
{{< badge-code >}}
426426
{{< /tab >}}
427-
{{% tab header="Python" %}}
428-
{{< badge-code >}}
429-
{{% /tab %}}
427+
{{< tab header="Python" >}}
428+
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}}
429+
{{< /tab >}}
430430
{{< tab header="CSharp" >}}
431431
{{< badge-code >}}
432432
{{< /tab >}}

website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,9 @@ You can simulate various network conditions.
424424
{{< tab header="Java" >}}
425425
{{< badge-code >}}
426426
{{< /tab >}}
427-
{{% tab header="Python" %}}
428-
{{< badge-code >}}
429-
{{% /tab %}}
427+
{{< tab header="Python" >}}
428+
{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}}
429+
{{< /tab >}}
430430
{{< tab header="CSharp" >}}
431431
{{< badge-code >}}
432432
{{< /tab >}}

0 commit comments

Comments
 (0)