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 ); //----------------------------------------------------------------------