mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
WebDriver: Coerce window handles to strings when activating a tab
This allows the session to reject the request with "no such window", instead of crashing by assuming the JSON value was already a string.
This commit is contained in:
parent
9608bfb576
commit
6d331389ad
|
@ -323,7 +323,7 @@ Web::WebDriver::Response Client::switch_to_window(Web::WebDriver::Parameters par
|
||||||
if (!handle.has_value())
|
if (!handle.has_value())
|
||||||
return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::InvalidArgument, "No property called 'handle' present");
|
return Web::WebDriver::Error::from_code(Web::WebDriver::ErrorCode::InvalidArgument, "No property called 'handle' present");
|
||||||
|
|
||||||
return session->switch_to_window(handle->as_string());
|
return session->switch_to_window(handle->to_deprecated_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
// 11.4 Get Window Handles, https://w3c.github.io/webdriver/#dfn-get-window-handles
|
// 11.4 Get Window Handles, https://w3c.github.io/webdriver/#dfn-get-window-handles
|
||||||
|
|
Loading…
Reference in a new issue