MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / toXPath

Method toXPath

native/desc/Widget.cpp:156–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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();

Callers 2

toStringMethod · 0.95
buildFullXpathMethod · 0.95

Calls 3

emptyMethod · 0.80
toStringMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected