In what situations is an element 'Invalid'?

Ask general questions here.
cosmicluna
Posts: 5
Joined: Tue May 16, 2017 4:46 pm

In what situations is an element 'Invalid'?

Post by cosmicluna » Tue Jul 04, 2017 9:05 pm

I was using Ranorex spy to highlight some elements on our UI and noticed that it no longer worked to highlight tree items. So, I clicked on the tree to find out why and I see this (Image attached). The tree items are invalid, why is this? And how can I get them to be valid again?
Attachments
Screen Shot 2017-07-04 at 4.03.21 PM.png
Screen Shot 2017-07-04 at 4.03.21 PM.png (37.36 KiB) Viewed 606 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3921
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: In what situations is an element 'Invalid'?

Post by odklizec » Thu Jul 06, 2017 7:39 am

Hi,

Typically, an element becomes invalid when it's no longer available in UI. In case of tree elements, it may happen if the content of tree is scrolled. Simply put, the no longer visible tree items are not in memory anymore. Usually, it happens with lazy loaded lists (tree elements, combo boxes, etc).
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

cosmicluna
Posts: 5
Joined: Tue May 16, 2017 4:46 pm

Re: In what situations is an element 'Invalid'?

Post by cosmicluna » Thu Jul 06, 2017 7:50 pm

odklizec wrote:Hi,

Typically, an element becomes invalid when it's no longer available in UI. In case of tree elements, it may happen if the content of tree is scrolled. Simply put, the no longer visible tree items are not in memory anymore. Usually, it happens with lazy loaded lists (tree elements, combo boxes, etc).
This happens when any tree element is clicked. It is still on the screen, why would it not be considered visible or in memory?

ahoisl
Certified Professional
Certified Professional
Posts: 125
Joined: Fri Sep 07, 2007 8:16 am

Re: In what situations is an element 'Invalid'?

Post by ahoisl » Thu Jul 06, 2017 10:52 pm

"Invalid" means that the UI actually changed since the element has been found by Ranorex and the element is no longer connected to the UI. This typically happens if you track an element with Ranorex Spy, then change something (substantially) in the application, e.g. navigate to another web page or the UI is refreshed.

You did not mention the exact sequence of steps to reproduce this, nor did you post a Ranorex snapshot of the UI. Could you possibly provide both?

Besides, if that happens while using Spy, you can try to refresh the element tree by clicking the toolbar item or pressing F5. Ranorex Spy does not refresh automatically, unless you track another element.

Regards,
Alex
Ranorex Team