Forum Discussion
TanyaYatskovska
9 years agoSmartBear Alumni (Retired)
Hi Tandreys,
Could you please share the problematic code with us?
- rrivest9 years agoContributor
The basic problem is the DOM Model not updating fast enough.... this often occures in IE....
Instead, use a timed search for that xPath..... Here's a sample code in C# that I use as a generic function
function TimedSearchXPath(msdelay,source,ElementType,StrValue) {
var ellapse = HISUtils["StopWatch"];
ellapse["Start"]();
var UIObject = null;
while ((UIObject == null) & (ellapse["Split"]() < msdelay)) {
var UIObject = source["FindChildByXPath"]("//"+ElementType+"[contains(@data-ui-test,'"+StrValue+"')]",true);
}
if (UIObject == null) {
Log["Message"]("Search delay has expired");
return null;
}else
return UIObject;
}
Related Content
Recent Discussions
- 3 days agoMW_Didata