Page 1 of 1

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

Posted: Fri Jan 25, 2019 8:58 pm
by dhongknoa
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
---
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
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-4.png
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.

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

Posted: Mon Jan 28, 2019 9:12 am
by odklizec
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.

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

Posted: Mon Jan 28, 2019 3:53 pm
by dhongknoa
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.