Skip to content

Commit f1332d5

Browse files
committed
fixed issue with missing XPathLookupError
1 parent 2546d6a commit f1332d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/webdriver/extension_qt/widget_view_executor.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -860,9 +860,9 @@ void QWidgetViewCmdExecutor::FindNativeElementsByXpath(QWidget* parent, const st
860860
pugi::xpath_query query_nodes(query.c_str());
861861
pugi::xpath_node_set found_nodes = query_nodes.evaluate_node_set(doc);
862862

863-
if (NULL == query_nodes.result().error) {
864-
//pugi::xpath_node_set found_nodes = doc.select_nodes(query.c_str());
865-
printf("!!!!!!!! found nodes: %d\n", found_nodes.size());
863+
if ( (NULL == query_nodes.result().error) &&
864+
(pugi::xpath_type_node_set == query_nodes.return_type()) ) {
865+
866866
for (pugi::xpath_node_set::const_iterator it = found_nodes.begin(); it != found_nodes.end(); ++it) {
867867
pugi::xpath_node node = *it;
868868

@@ -880,7 +880,7 @@ void QWidgetViewCmdExecutor::FindNativeElementsByXpath(QWidget* parent, const st
880880
}
881881
}
882882
} else {
883-
std::string error_descr = "Cant evaluate XPath: ";
883+
std::string error_descr = "Cant evaluate XPath to node set: ";
884884
error_descr += query_nodes.result().description();
885885
session_->logger().Log(kWarningLogLevel, error_descr);
886886
*error = new Error(kXPathLookupError);

0 commit comments

Comments
 (0)