summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-03-13 12:03:56 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-03-18 10:52:01 +0100
commitafbb8c709d40e77b3f71c152d363c5ad95ceec2d (patch)
tree23d8bc0c3b77ae4dbd4a4755dbb825fad4e31f65
parent8f400a7ff086b9ea2a20e69826d211f965b31185 (diff)
Handled WebDriverException from Chrome driver version 113+.
-rw-r--r--django/contrib/admin/tests.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py
index 636a6ffdf2..f64a4c47f8 100644
--- a/django/contrib/admin/tests.py
+++ b/django/contrib/admin/tests.py
@@ -123,13 +123,21 @@ class AdminSeleniumTestCase(SeleniumTestCase, StaticLiveServerTestCase):
"""
Block until a new page has loaded and is ready.
"""
+ from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as ec
old_page = self.selenium.find_element(By.TAG_NAME, "html")
yield
# Wait for the next page to be loaded
- self.wait_until(ec.staleness_of(old_page), timeout=timeout)
+ try:
+ self.wait_until(ec.staleness_of(old_page), timeout=timeout)
+ except WebDriverException:
+ # Issue in version 113+ of Chrome driver where a WebDriverException
+ # error is raised rather than a StaleElementReferenceException, see:
+ # https://issues.chromium.org/issues/42323468
+ pass
+
self.wait_page_ready(timeout=timeout)
def admin_login(self, username, password, login_url="/admin/"):