LibWeb: Form the correct representation of a WebDriver element reference

We are currently returning a JSON object of the form:

    {
        "name": "element-6066-11e4-a52e-4f735466cecf",
        "value": "foo"
    }

Instead, we are expected to return an object of the form:

    {
        "element-6066-11e4-a52e-4f735466cecf": "foo"
    }
This commit is contained in:
Timothy Flynn 2024-09-26 15:01:29 -04:00 committed by Tim Ledbetter
commit 157d41bb0d
Notes: github-actions[bot] 2024-09-27 08:47:55 +00:00
3 changed files with 10 additions and 11 deletions

View file

@ -550,7 +550,7 @@ Messages::WebDriverClient::SwitchToFrameResponse WebDriverConnection::switch_to_
// -> id represents a web element
else if (id.is_object()) {
auto element_id = id.as_object().get_byte_string("value"sv).release_value();
auto element_id = Web::WebDriver::extract_web_element_reference(id.as_object());
// 1. If session's current browsing context is no longer open, return error with error code no such window.
TRY(ensure_current_browsing_context_is_open());