WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
300462
[WebDriver] Elements references nested in arrays or objects are not extracted when executing scripts
https://bugs.webkit.org/show_bug.cgi?id=300462
Summary
[WebDriver] Elements references nested in arrays or objects are not extracted...
Lauro Moura
Reported
2025-10-09 13:40:46 PDT
Currently, `Session::executeScript` calls `Session::extractElement` (to unwrap the element references) only for top level arguments, not taking in account that the references can be nested in an array or object also passed as argument. Due to this, those nested references are not translated correctly by the browser, which will show them as plain objects instead of the actual DOM elements they refer to. This affects, for example, the `relative_by` Selenium selectors, as they might pass element references nested in a JS object as the parameter to their own JS snippets. With the broken references, usually the operation fails with "Message: Unsupported locator strategy: element-6066-11e4-a52e-4f735466cecf". We should traverse the incoming arrays and objects, processing the references accordingly (kinda similar to the "JSON deserialize" algorithm:
https://www.w3.org/TR/webdriver/#dfn-json-deserialize
). Patch incoming.
Attachments
Add attachment
proposed patch, testcase, etc.
Lauro Moura
Comment 1
2025-10-12 21:10:44 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/52213
EWS
Comment 2
2025-10-13 20:02:08 PDT
Committed
301445@main
(7b619594eed4): <
https://commits.webkit.org/301445@main
> Reviewed commits have been landed. Closing PR #52213 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2025-10-13 20:03:13 PDT
<
rdar://problem/162571946
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug