Bug 230612
| Summary: | [WebDriver] Fix element references after tab switch or close | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> |
| Component: | WebDriver | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bburg, lmoura, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=230551 | ||
Carlos Garcia Campos
We return stale element reference instead of no such element.
imported/w3c/webdriver/tests/element_clear/clear.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/element_click/click.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/element_send_keys/send_keys.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/get_element_attribute/get.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/get_element_css_value/get.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/get_element_property/get.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/get_element_rect/get.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/get_element_text/get.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/get_element_tag_name/get.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/is_element_enabled/enabled.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/is_element_selected/selected.py::test_no_top_browsing_context
imported/w3c/webdriver/tests/switch_to_window/switch.py::test_element_not_found_after_tab_switch
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/83667452>
Lauro Moura
*** Bug 279099 has been marked as a duplicate of this bug. ***
Lauro Moura
Also imported/w3c/webdriver/tests/classic/switch_to_frame/switch.py::test_frame_id_null seems related to this.
Related changed in WPT by https://phabricator.services.mozilla.com/D101065 (Bug 1684827 - [wdspec] Fix switch to frame tests for "no such element" error instead of "stale element reference".)
> Element references are per browsing context. As such elements as found within a frame are not existent in any parent browsing context, and when retrieving these a "no such element" error has to be returned.
And relevant items in the spec, showing that references are checked against the current browsing context:
https://w3c.github.io/webdriver/#dfn-get-a-known-element
> To get a known element given session and reference:
> If not node reference is known with session, session's current browsing context, and reference return error with error code no such element.
> <snip>
https://w3c.github.io/webdriver/#dfn-node-reference-is-known
> A node reference is known given session, browsing context, and reference if the following steps return true:
> Let navigable be browsing context's active document's node navigable.
> Let navigable seen nodes map be session's navigable seen nodes map.
> If navigable seen nodes map contains navigable and navigable seen nodes map[navigable] contains reference, return true, otherwise return false.