mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibWeb+WebContent+WebDriver: Implement Get Active Element
Unfortunately, nothing ever calls DOM::Document::set_active_element at the moment, so this will always return ErrorCode::NoSuchElement.
This commit is contained in:
parent
269a931414
commit
cb91e6067c
7 changed files with 33 additions and 0 deletions
|
@ -359,6 +359,15 @@ Web::WebDriver::Response Client::find_elements_from_element(Web::WebDriver::Para
|
|||
return session->web_content_connection().find_elements_from_element(payload, parameters[1]);
|
||||
}
|
||||
|
||||
// 12.3.8 Get Active Element, https://w3c.github.io/webdriver/#get-active-element
|
||||
// GET /session/{session id}/element/active
|
||||
Web::WebDriver::Response Client::get_active_element(Web::WebDriver::Parameters parameters, JsonValue)
|
||||
{
|
||||
dbgln_if(WEBDRIVER_DEBUG, "Handling GET /session/<session_id>/element/active");
|
||||
auto* session = TRY(find_session_with_id(parameters[0]));
|
||||
return session->web_content_connection().get_active_element();
|
||||
}
|
||||
|
||||
// 12.4.1 Is Element Selected, https://w3c.github.io/webdriver/#dfn-is-element-selected
|
||||
// GET /session/{session id}/element/{element id}/selected
|
||||
Web::WebDriver::Response Client::is_element_selected(Web::WebDriver::Parameters parameters, JsonValue)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue