marin
13 years agoFrequent Contributor
Problems with EvaluateXPath() and FindChild() in IE9 using TC 9.10
Hello all,
I wonder if anybody came across the following problem after updating from 9.0 to 9.10:
when searching for objects vie EvaluateXPath() or FindChild(), the searched objects will not be found in IE9, whereas in FF 15.0.1 the objects are found without issues.
Sample code:
The odd thing is that when debugging this method and stepping through, the searched object would be found...
What could be causing this?
Many thanks for any hints,
Marin
I wonder if anybody came across the following problem after updating from 9.0 to 9.10:
when searching for objects vie EvaluateXPath() or FindChild(), the searched objects will not be found in IE9, whereas in FF 15.0.1 the objects are found without issues.
Sample code:
//Prototype declaration - indexed array
Array.prototype.indexOf = function(item)
{
for (var i = 0; i < this.length; i++)
{
if ((i in this) && (this == item)) return i;
}
return -1;
}
function NewArray()
{
return new Array();
}
var lnk = FindChildNodeXPath(mappedPageObject, "A", "id", "myLinkId");
function FindChildNodeXPath(objTarget, strElement, strAttribute, strAttrValue)
{
var valueArr = NewArray();
var tmp = objTarget.EvaluateXPath("//" + strElement + "[@"+ strAttribute + " = '" + strAttrValue + "']");
if (tmp != null)
{
var arr = (new VBArray(tmp)).toArray();
valueArr[0] = arr[0];
}
else
{
Log.Message("Find child node via XPath: the element was not found.");
}
return valueArr[0];
}
The odd thing is that when debugging this method and stepping through, the searched object would be found...
What could be causing this?
Many thanks for any hints,
Marin