Forum Discussion

obaid_shirwani's avatar
obaid_shirwani
Contributor
11 years ago

Getting null object in response of xPath

Hi guys, I am trying the following: //Set page to be the existing page: Works good. var page = Sys.Browser("*").Page("*"); //The following is working good and object i...
  • HKosova's avatar
    11 years ago
    EvaluateXPath returns VBScript-compatible arrays. To use the returned array in JScript, you need to convert it to a native JScript array like this:



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

    if (tmp != null)

    {

      var arr = (new VBArray(tmp)).toArray();

      ...

    }



    This is mentioned in the EvaluateXPath documentation.