From 26a114ee2aaa1a25a6cb1dfe3c5aef4af7ddd79b Mon Sep 17 00:00:00 2001 From: Navin Chandra Date: Wed, 27 Nov 2024 23:51:57 +0530 Subject: [PATCH] update python docs to use new site for `get_log` --- examples/python/tests/browsers/test_chrome.py | 8 ++++---- examples/python/tests/browsers/test_edge.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/python/tests/browsers/test_chrome.py b/examples/python/tests/browsers/test_chrome.py index d34fe294654..3f72785d407 100644 --- a/examples/python/tests/browsers/test_chrome.py +++ b/examples/python/tests/browsers/test_chrome.py @@ -3,7 +3,7 @@ import subprocess import pytest from selenium import webdriver - +from selenium.webdriver.common.by import By def test_basic_options(): options = webdriver.ChromeOptions() @@ -180,11 +180,11 @@ def test_cast_features(): def test_get_browser_logs(): driver = webdriver.Chrome() - - driver.get("https://www.selenium.dev/") + driver.get("https://www.selenium.dev/selenium/web/bidi/logEntryAdded.html") + driver.find_element(By.ID, "consoleError").click() 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." + assert any("I am console error" 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 b13fd9d7cb5..7a368fb5a04 100644 --- a/examples/python/tests/browsers/test_edge.py +++ b/examples/python/tests/browsers/test_edge.py @@ -3,7 +3,7 @@ import subprocess import pytest from selenium import webdriver - +from selenium.webdriver.common.by import By def test_basic_options(): options = webdriver.EdgeOptions() @@ -180,11 +180,11 @@ def test_cast_features(): def test_get_browser_logs(): driver = webdriver.Edge() - - driver.get("https://www.selenium.dev/") + driver.get("https://www.selenium.dev/selenium/web/bidi/logEntryAdded.html") + driver.find_element(By.ID, "consoleError").click() 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." + assert any("I am console error" in log['message'] for log in logs), "No matching log message found." driver.quit()