aurum: add getXPath method 54/273254/2
authorHosang Kim <hosang12.kim@samsung.com>
Thu, 31 Mar 2022 09:12:40 +0000 (18:12 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Mon, 4 Apr 2022 06:53:21 +0000 (15:53 +0900)
Change-Id: Icaa35e6d9b9d66f16183d6104ad981fff816e5db

libaurum/inc/Accessibility/AccessibleNode.h
libaurum/inc/UiObject.h
libaurum/src/Accessibility/AccessibleNode.cc
libaurum/src/UiObject.cc
org.tizen.aurum-bootstrap/src/Commands/DumpObjectTreeCommand.cc
protocol/aurum.proto

index 0c47a2e..2077d23 100644 (file)
@@ -183,6 +183,10 @@ public:
      * @copydoc UiObject::getStyle()
      */
     std::string getStyle() const;
+    /**
+     * @copydoc UiObject::getXPath()
+     */
+    std::string getXPath() const;
 
     /**
      * @copydoc UiObject::getScreenBoundingBox()
index ea84cad..4065bda 100644 (file)
@@ -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
index d4bfb68..60f6baa 100644 (file)
@@ -150,6 +150,11 @@ std::string AccessibleNode::getStyle() const
     return mStyle;
 }
 
+std::string AccessibleNode::getXPath() const
+{
+    return mXPath;
+}
+
 Rect<int> AccessibleNode::getScreenBoundingBox() const
 {
     return mScreenBoundingBox;
index 6e25fa7..ccf60ef 100644 (file)
@@ -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);
index f455f89..48e8dee 100644 (file)
@@ -59,6 +59,7 @@ void DumpObjectTreeCommand::traverse(::aurum::Element *root, std::shared_ptr<Nod
     root->set_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());
index 6b66794..a6edb59 100644 (file)
@@ -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
+}