Skip to content

Commit

Permalink
update python docs to use new site for get_log
Browse files Browse the repository at this point in the history
  • Loading branch information
navin772 committed Nov 27, 2024
1 parent e05fcb4 commit 26a114e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions examples/python/tests/browsers/test_chrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
8 changes: 4 additions & 4 deletions examples/python/tests/browsers/test_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

0 comments on commit 26a114e

Please sign in to comment.