RESOLVED FIXED323692
REGRESSION(320518@main): WebDriver returns "no such element" instead of "stale element reference" for a node reference from a previous document
https://bugs.webkit.org/show_bug.cgi?id=323692
Summary REGRESSION(320518@main): WebDriver returns "no such element" instead of "stal...
Lauro Moura
Reported 2026-09-08 14:21:58 PDT
320518@main correctly split "no such element" from "stale element reference", fixing almost 100 subtests, but the stale reference map is wiped on page navigation/refresh, as this information is stored by the AutomationSessionProxy JS instance living on the page's global object. Expected: stale element reference Actual: no such element — "Node with identifier 'node-…' was not found" Per the spec, the stale references are associated to a given navigable, surviving navigations on that navigable: > A WebDriver session has a navigable seen nodes map which is a weak map between a navigable and a set. Tests affected: imported/w3c/webdriver/tests/classic/back/back.py::test_seen_nodes[http] imported/w3c/webdriver/tests/classic/forward/forward.py::test_basic imported/w3c/webdriver/tests/classic/forward/forward.py::test_seen_nodes[http] imported/w3c/webdriver/tests/classic/navigate_to/navigate.py::test_seen_nodes[http] imported/w3c/webdriver/tests/classic/refresh/refresh.py::test_history_pushstate imported/w3c/webdriver/tests/classic/refresh/refresh.py::test_no_browsing_context imported/w3c/webdriver/tests/classic/refresh/refresh.py::test_seen_nodes[http] imported/w3c/webdriver/tests/classic/refresh/refresh.py::test_seen_nodes[https] imported/w3c/webdriver/tests/classic/refresh/refresh.py::test_seen_nodes[https coop] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_accept[alert] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_accept[beforeunload] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_accept[confirm] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_accept[prompt] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_accept_and_notify[beforeunload-None] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_default[beforeunload-None] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_dismiss[alert] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_dismiss[beforeunload] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_dismiss[confirm] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_dismiss[prompt] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_dismiss_and_notify[beforeunload-None] imported/w3c/webdriver/tests/classic/refresh/user_prompts.py::test_ignore[beforeunload] imported/selenium/py/test/selenium/webdriver/common/stale_reference_tests.py::test_old_page imported/selenium/py/test/selenium/webdriver/common/stale_reference_tests.py::test_should_not_crash_when_calling_get_size_on_an_obsolete_element imported/selenium/py/test/selenium/webdriver/common/stale_reference_tests.py::test_should_not_crash_when_querying_the_attribute_of_astale_element I have a WIP patch from a previous attempt at bug230612 (https://github.com/WebKit/WebKit/pull/61870) that keeps the stale reference map in the C++ side, keyed by frame. It could be adjusted to be a follow-up to 320518@main (e.g. using the new StaleNode error, fix conflicts, etc.).
Attachments
Lauro Moura
Comment 1 2026-09-09 07:07:57 PDT
EWS
Comment 2 2026-09-09 07:19:18 PDT
Test gardening commit 320729@main (741f1cc7772d): <https://commits.webkit.org/320729@main> Reviewed commits have been landed. Closing PR #73566 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2026-09-09 13:17:38 PDT
Brent Fulgham
Comment 4 2026-09-15 12:24:54 PDT
EWS
Comment 5 2026-09-23 15:06:23 PDT
Committed 321731@main (ff835bfba1ac): <https://commits.webkit.org/321731@main> Reviewed commits have been landed. Closing PR #74083 and removing active labels.
Brent Fulgham
Comment 6 2026-09-24 16:06:15 PDT
*** Bug 323694 has been marked as a duplicate of this bug. ***
EWS
Comment 7 2026-10-30 23:42:42 PDT
Committed 321067.651@safari-7626-branch (3200d473c5bb): <https://commits.webkit.org/321067.651@safari-7626-branch> Reviewed commits have been landed. Closing PR #7594 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.