Quantcast
Channel: LoadRunner Practitioners Forum topics
Viewing all articles
Browse latest Browse all 3978

Truclient Ajax FF - document.evaluate does not work; complains that XPathResult is not defined

$
0
0

I am trying to use document.evaluate to obtain a reference to a set of elements via use of an XPath expression.

 

Whenever TruClient runs the step, the script stops with the same error:
 ReferenceError: XPathResult is not defined

 

I have tried several code permutations but always get the same result.  I have asked HP Support to confirm that document.evaluate and XPathResult are both supported.

 

In the meantime, can anyone say why this will not work?

 

 

//----------------------------------------------------------------------
//Permutation 1
 var professions =
 document.evaluate(
 "//a[@target='_self']", document, null, XPathResult.ANY_TYPE, null
 );

 //Permutation 2
 var xpr;
 document.evaluate(
 "//a[@target='_self']", document, null, XPathResult.ANY_TYPE, xpr
 );

 //Permutation 3
 var xpr = new XPathResult();
 document.evaluate(
 "//a[@target='_self']", document, null, XPathResult.ANY_TYPE, xpr
 );

 //Permutation 4
 var xpr = XPathResult.create();
 document.evaluate(
 "//a[@target='_self']", document, null, XPathResult.ANY_TYPE, xpr
 );
//----------------------------------------------------------------------

 


Viewing all articles
Browse latest Browse all 3978


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>