Bug 300462
| Summary: | [WebDriver] Elements references nested in arrays or objects are not extracted when executing scripts | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Lauro Moura <lmoura> |
| Component: | WebDriver | Assignee: | Lauro Moura <lmoura> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bburg, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Lauro Moura
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
Pull request: https://github.com/WebKit/WebKit/pull/52213
EWS
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
<rdar://problem/162571946>