mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 00:47:45 +00:00
WebDriver: Implement GET /session/{id}/element/{id}/property/{name}
This commit is contained in:
parent
3db92885cd
commit
e87456e38f
7 changed files with 56 additions and 0 deletions
|
@ -155,4 +155,15 @@ Messages::WebDriverSessionClient::GetElementAttributeResponse WebDriverConnectio
|
|||
return { {} };
|
||||
}
|
||||
|
||||
Messages::WebDriverSessionClient::GetElementPropertyResponse WebDriverConnection::get_element_property(i32 element_id, String const& name)
|
||||
{
|
||||
dbgln("WebDriverConnection: get_element_property");
|
||||
if (auto browser_window = m_browser_window.strong_ref()) {
|
||||
auto& tab = browser_window->active_tab();
|
||||
if (tab.on_get_element_property)
|
||||
return { tab.on_get_element_property(element_id, name) };
|
||||
}
|
||||
return { {} };
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
virtual Messages::WebDriverSessionClient::GetDocumentElementResponse get_document_element() override;
|
||||
virtual Messages::WebDriverSessionClient::QuerySelectorAllResponse query_selector_all(i32 start_node_id, String const& selector) override;
|
||||
virtual Messages::WebDriverSessionClient::GetElementAttributeResponse get_element_attribute(i32 element_id, String const& name) override;
|
||||
virtual Messages::WebDriverSessionClient::GetElementPropertyResponse get_element_property(i32 element_id, String const& name) override;
|
||||
|
||||
private:
|
||||
WebDriverConnection(NonnullOwnPtr<Core::Stream::LocalSocket> socket, NonnullRefPtr<BrowserWindow> browser_window);
|
||||
|
|
|
@ -19,5 +19,6 @@ endpoint WebDriverSessionClient {
|
|||
get_document_element() => (Optional<i32> document_element_id)
|
||||
query_selector_all(i32 start_node_id, String selector) => (Optional<Vector<i32>> elements_ids)
|
||||
get_element_attribute(i32 element_id, String name) => (Optional<String> atttibute)
|
||||
get_element_property(i32 element_id, String name) => (Optional<String> property)
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue