| 154 | |
| 155 | |
| 156 | std::string Widget::toXPath() const { |
| 157 | if (this->_text.empty() && this->_clazz.empty() |
| 158 | && this->_resourceID.empty()) { |
| 159 | BDLOG("widget detail has been clear"); |
| 160 | return ""; |
| 161 | } |
| 162 | |
| 163 | std::stringstream stringStream; |
| 164 | stringStream << "{xpath: /*" << |
| 165 | "[@class=\"" << this->_clazz << "\"]" << |
| 166 | "[@resource-id=\"" << this->_resourceID << "\"]" << |
| 167 | "[@text=\"" << this->_text << "\"]" << |
| 168 | "[@content-desc=\"" << this->_contextDesc << "\"]" << |
| 169 | "[@index=" << this->_index << "]" << |
| 170 | "[@bounds=\"" << this->_bounds->toString() << "\"]}"; |
| 171 | return stringStream.str(); |
| 172 | } |
| 173 | |
| 174 | std::string Widget::buildFullXpath() const { |
| 175 | std::string fullXpathString = this->toXPath(); |
no test coverage detected