EnsureVisible ("Use Ensure Visible") is causing menu to close and element to scroll to a hidden area

Ranorex Spy, Recorder, and Studio.
dhongknoa
Posts: 2
Joined: Fri Jan 25, 2019 5:04 pm

EnsureVisible ("Use Ensure Visible") is causing menu to close and element to scroll to a hidden area

Post by dhongknoa » Fri Jan 25, 2019 8:58 pm

I am currently using Ranorex to perform testing on an application called SuccessFactors from SAP (I'm not from SAP).
The problem is that when I am running test in one of the screen, I start getting several warning messages like this in the report:
Could not get a valid element rectangle from '{ATag:}', since the element is no longer valid.
And realize that the element was not clicked because Ranorex could not find the element.
After much tinkering and hair pulling, I've finally figured out the source of the issue was the "Use Ensure Visible" option on each object. When I set this to "False" for the problematic objects, then Ranorex had no problem finding the element and clicking on them. Of course, now I've lost the ability to bring these elements into view if it goes out of view for whatever reason.

---
Here are 2 issue types that I've come across. First one generates the "Element is no longer valid" warning", and second one does not show any warning but just fails to click the right item.

Issue 1:
I'm trying to get Ranorex to click on the menu item highlighted below but it appears Ranorex doesn't think it's visible because it caused the page to shift as if trying to scroll it into view. That caused the menu to be closed just as Ranorex was about to click it and it resulted in the warning message above.
screenshot-2.png
screenshot-2.png (11.19 KiB) Viewed 81 times
---
Issue 2:
This issue is a bit difficult to describe in words but I'll give it a shot. I'm trying to get Ranorex to click on the "Goal Name" column header in the following screenshot:
screenshot-3.png
screenshot-3.png (12.8 KiB) Viewed 81 times
Again, it appears Ranorex doesn't think it's in view and tries to scroll it to the stop of the viewable area in the browser frame (i.e. right under the address bar). But, when it does that, it scrolls it right under the section header like this:
screenshot-3.png
screenshot-3.png (12.8 KiB) Viewed 81 times
The screenshot is what happened when I tried to highlight it. The red square in the second screenshot is highlighting by Ranorex, not me.
So, during the actual test run, the same thing happens and the click occurs on the "Best Practice Admin" dropdown menu because target element is behind the menu element.
Attachments
screenshot-4.png
screenshot-4.png (15.77 KiB) Viewed 81 times

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

Re: EnsureVisible ("Use Ensure Visible") is causing menu to close and element to scroll to a hidden area

Post by odklizec » Mon Jan 28, 2019 9:12 am

Hi,

In my opinion, in case like this, you must selectively disable EnsureVisible for the problematic elements? So then the menu stays open. Unfortunately, it's hard to suggest something else, without seeing the app under test. And I'm afraid, snapshot would not be helpful this time at all ;) So If you are still struggling to make the app to work as you want, I would suggest to contact directly Ranorex support (via their support form) and request a remote session with them. Via remote session, they may be able to analyze the problem and find a better solution, than just disabling EnsureVisible.
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

dhongknoa
Posts: 2
Joined: Fri Jan 25, 2019 5:04 pm

Re: EnsureVisible ("Use Ensure Visible") is causing menu to close and element to scroll to a hidden area

Post by dhongknoa » Mon Jan 28, 2019 3:53 pm

Thank you for your reply. Yes, I've been selectively disabling Ensure Visible for such elements and either taking other steps to make sure the element is visible or just hope that they stay visible during test run.

I will look into contact Ranorex support directly. Thank you for your suggestion.