since a couple of weeks we see a non-reproducable issue which shows up in random places:
"Could not get a valid element rectangle from '{TreeItem:}', since the element is no longer valid"
As a consequence we can for example not click the element.
It happens in different areas of the AUT on different object types (treeitems, buttons, texts, tabpage...)
I browsed forum and followed suggestions like adding "@enabled='true'" to RanorexPath, but this did not help.
When it happens:
- we can see element in screenshot
- either the valid flag of adapter is false or the ScreenRectangle is 0,0,0,0
- we capture a snapshot of the adapter at runtime and in Spy it will be marked as red and "invalid"
- a workaround of recreating adapter based on the RanorexPath of the old adapter does work (e.g. the UI element is there...):
Code: Select all
newAdapter = new Button(oldAdapter.GetPath(PathBuildMode.Simple).ToString());
newAdapter.Click();
- any suggestion how to narrow down the root cause of the issue (we can't have above workaround all over the place...)
- is there a way to catch the "Could not get a valid element rectangle ..." warning in user code?
- is there a way to suppress the warning ?
Joachim
Environment:
* Ranorex 8.3.1
* Win10
* WinForms AUT