Forum Discussion

mnelsonwhite's avatar
mnelsonwhite
New Contributor
2 years ago

TestComplete using Appium with EvaluateXPath

When trying to use EvaluateXPath with appium I get an error back stating:

 

"Unable to find the object EvaluateXPath(<xpath for child object>). See Details for additional information. 14:39:19 Normal 10.83"

 

But the appium logs show it was successful and found an element

 

 

 

 

[debug] [SafariDriver@0872 (88ad58d2)] Proxying [POST /session/88ad58d2-78ef-4e3d-85fd-1a9afc3e84d6/execute/sync] to [POST http://127.0.0.1:5100/session/0F5B9917-E4DB-4580-AF73-19E2AA122890/execute/sync] with body: {"script":"var el = arguments[0];var name = arguments[1];if (el.hasAttribute(name))return el.getAttribute(name);return '{B96DE553-EC7A-4A88-83C5-3F339474BF2F}';","args":[{"element-6066-11e4-a52e-4f735466cecf":"node-84585152-AC19-4120-A396-E4C1E6B82F80","ELEMENT":"node-84585152-AC19-4120-A396-E4C1E6B82F80"},"EvaluateXPath"]}
[debug] [SafariDriver@0872 (88ad58d2)] Got response with status 200: {"value":"{B96DE553-EC7A-4A88-83C5-3F339474BF2F}"}

 

 

 

 

 

Directly on the browser I am able to validate the query by using document.Evaluate

 

 

 

 

document.evaluate(
  "<xpath for child object>",
  $x("<xpath for parent object>")[0],
  null,
  XPathResult.ANY_TYPE,
  null
).iterateNext();