Forum Discussion

ssa's avatar
ssa
Occasional Contributor
11 years ago

Can't finding TD's DIV using EvaluateXPath Method.

My scenario is like this.. <tr>   <td>   <td>     <div>requirdText</div>   <td>   <td>     <div>STATUS</div>    <td>    .    .    ...
  • HKosova's avatar
    11 years ago
    You need to convert the EvaluateXPath result to a JScript-compatible array (this is mentioned in the EvaluateXPath method description):



    var obj = page.EvaluateXPath(...);



    if (obj != null) {

      obj = obj.toArray();

      ...

    }



    Or, you can use FindChildByXPath instead - it returns a single object instead of an array.