From f9fab106b08e7d0c03eade6adfeff886cc42459d Mon Sep 17 00:00:00 2001 From: Hosang Kim Date: Thu, 31 Mar 2022 18:12:40 +0900 Subject: [PATCH] aurum: add getXPath method Change-Id: Icaa35e6d9b9d66f16183d6104ad981fff816e5db --- libaurum/inc/Accessibility/AccessibleNode.h | 4 ++++ libaurum/inc/UiObject.h | 9 +++++++++ libaurum/src/Accessibility/AccessibleNode.cc | 5 +++++ libaurum/src/UiObject.cc | 5 +++++ org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc | 1 + protocol/aurum.proto | 3 ++- 6 files changed, 26 insertions(+), 1 deletion(-) diff --git a/libaurum/inc/Accessibility/AccessibleNode.h b/libaurum/inc/Accessibility/AccessibleNode.h index 0c47a2e..2077d23 100644 --- a/libaurum/inc/Accessibility/AccessibleNode.h +++ b/libaurum/inc/Accessibility/AccessibleNode.h @@ -183,6 +183,10 @@ public: * @copydoc UiObject::getStyle() */ std::string getStyle() const; + /** + * @copydoc UiObject::getXPath() + */ + std::string getXPath() const; /** * @copydoc UiObject::getScreenBoundingBox() diff --git a/libaurum/inc/UiObject.h b/libaurum/inc/UiObject.h index ea84cad..4065bda 100644 --- a/libaurum/inc/UiObject.h +++ b/libaurum/inc/UiObject.h @@ -265,6 +265,15 @@ public: std::string getRole() const; /** + * @brief Gets object's XPath. + * + * @return string + * + * @since_tizen 7.0 + */ + std::string getXPath() const; + + /** * @brief Sets object's text. * * @param[in] text string diff --git a/libaurum/src/Accessibility/AccessibleNode.cc b/libaurum/src/Accessibility/AccessibleNode.cc index d4bfb68..60f6baa 100644 --- a/libaurum/src/Accessibility/AccessibleNode.cc +++ b/libaurum/src/Accessibility/AccessibleNode.cc @@ -150,6 +150,11 @@ std::string AccessibleNode::getStyle() const return mStyle; } +std::string AccessibleNode::getXPath() const +{ + return mXPath; +} + Rect AccessibleNode::getScreenBoundingBox() const { return mScreenBoundingBox; diff --git a/libaurum/src/UiObject.cc b/libaurum/src/UiObject.cc index 6e25fa7..ccf60ef 100644 --- a/libaurum/src/UiObject.cc +++ b/libaurum/src/UiObject.cc @@ -194,6 +194,11 @@ std::string UiObject::getRole() const return getAccessibleNode()->getRole(); } +std::string UiObject::getXPath() const +{ + return getAccessibleNode()->getXPath(); +} + bool UiObject::setText(std::string text) { return getAccessibleNode()->setValue(text); diff --git a/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc b/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc index f455f89..48e8dee 100644 --- a/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc +++ b/org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc @@ -59,6 +59,7 @@ void DumpObjectTreeCommand::traverse(::aurum::Element *root, std::shared_ptrset_widget_style(obj->getElementStyle()); root->set_text(obj->getText()); + root->set_xpath(obj->getXPath()); root->set_automationid(obj->getAutomationId()); root->set_package(obj->getApplicationPackage()); root->set_role(obj->getRole()); diff --git a/protocol/aurum.proto b/protocol/aurum.proto index 6b66794..a6edb59 100644 --- a/protocol/aurum.proto +++ b/protocol/aurum.proto @@ -60,6 +60,7 @@ message Element { string widget_style = 6; string text = 7; + string xpath = 8; string automationId = 9; string package = 10; string role = 11; @@ -461,4 +462,4 @@ message ReqSetFocus { message RspSetFocus { RspStatus status = 1; -} \ No newline at end of file +} -- 2.7.4