I have pathes to the key elements of the application under test hardcoded in the repository like the following:
Code: Select all
public static Element bobcatDataBrowserForm
{
get
{
try
{
RxPath path = new RxPath("/form[@controlname='MyForm']/container[@controlname='mRibbonControl']");
return Host.Local.Element.FindSingle(path, _timeout);
}
catch
{
WriteLog("Element not found.");
return null;
}
}
}
If I reload the application under test, sometimes the above property returns the element I search for, but again sometimes not.. I couldn't find any pattern to when it fails to find the element. I tried using RanorexSpy at the times when this property didn't work, and I observed strange things: I could browse the tree of the application as usual, but the nodes where all empty, i.e. almost every node in the tree is named as the main form and has no attributes defined... It looked like Ranorex was able to browse the elements, but couldn't read their attributes...
it started to happen with Ranorex 2RC library and I observe the same behavior with the release dllls.