diff --git a/examples/python/tests/browsers/test_chrome.py b/examples/python/tests/browsers/test_chrome.py index 55667f514652..d34fe2946549 100644 --- a/examples/python/tests/browsers/test_chrome.py +++ b/examples/python/tests/browsers/test_chrome.py @@ -176,3 +176,15 @@ def test_cast_features(): pytest.skip("No available Cast sinks to test with.") finally: driver.quit() + + +def test_get_browser_logs(): + driver = webdriver.Chrome() + + driver.get("https://www.selenium.dev/") + + logs = driver.get_log("browser") + + # Assert that at least one log contains the expected message + assert any("Uncaught TypeError" in log['message'] for log in logs), "No matching log message found." + driver.quit() diff --git a/examples/python/tests/browsers/test_edge.py b/examples/python/tests/browsers/test_edge.py index 363b15ea49f8..b13fd9d7cb5f 100644 --- a/examples/python/tests/browsers/test_edge.py +++ b/examples/python/tests/browsers/test_edge.py @@ -176,3 +176,15 @@ def test_cast_features(): pytest.skip("No available Cast sinks to test with.") finally: driver.quit() + + +def test_get_browser_logs(): + driver = webdriver.Edge() + + driver.get("https://www.selenium.dev/") + + logs = driver.get_log("browser") + + # Assert that at least one log contains the expected message + assert any("Uncaught TypeError" in log['message'] for log in logs), "No matching log message found." + driver.quit() diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index 6e4f28c6a718..73e15db6b80f 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -421,9 +421,9 @@ You can simulate various network conditions. {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index 241fbb3162bc..cbeac4e63b9d 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -415,9 +415,9 @@ Chrome Castデバイスを操作することができ、タブの共有も含ま {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index e273d7f813a9..45a11b1d3490 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -424,9 +424,9 @@ please refer to the {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index cf2dde607193..b08634037c06 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -424,9 +424,9 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱 {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_chrome.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index 2bcae96e363d..f31f9e17e666 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -422,9 +422,9 @@ You can simulate various network conditions. {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index cf8098c55813..e86c9aaeaa9d 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -408,9 +408,9 @@ Edge を使用して Chrome Cast デバイスを操作し、タブを共有す {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index 23e7599d04d6..5afe7d1e32ca 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -424,9 +424,9 @@ You can simulate various network conditions. {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index cce5a9e4e36e..50e7b05b8558 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -424,9 +424,9 @@ You can simulate various network conditions. {{< tab header="Java" >}} {{< badge-code >}} {{< /tab >}} -{{% tab header="Python" %}} -{{< badge-code >}} -{{% /tab %}} +{{< tab header="Python" >}} +{{< gh-codeblock path="/examples/python/tests/browsers/test_edge.py#L186" >}} +{{< /tab >}} {{< tab header="CSharp" >}} {{< badge-code >}} {{< /tab >}}