Page 1 of 1

How does EnsureVisible really work?

Posted: Mon Sep 17, 2012 4:14 pm
by Aracknid
I've got a control that is scrolled off screen. When I look at the info in the Spy tool. It says the screen location is "451, -2791". Yes, that's minus. But right under is says "Visible = True". How is that possible?

When I run my script and call my lower function to act upon this control, in the function I say "MyControl.EnsureVisible" which I would expect to scroll it into view, but that doesn't happen. I assume because it is "visible" even though it is not.

What's going on under the covers?

Aracknid

Re: How does EnsureVisible really work?

Posted: Mon Sep 17, 2012 11:52 pm
by Ciege
It's possible you AUT is the one who is reporting the element as visible.

Also, the negative number is due to the X,Y coordinates on the element. So the negative number is the distance down the negative side of the Y axis. So if your AUT does indeed report visible incorrectly you can check the X,Y coordinates of your elements and scroll them into view yourself...

Re: How does EnsureVisible really work?

Posted: Tue Sep 18, 2012 2:26 pm
by Aracknid
So does the Ranorex function called "EnsureVisible" just check the controls "Visible" property, and if that property is "True", it does nothing? To be honest, I thought it was doing more than just that. I've never had a problem with it until recently, so I figured it must be the way the HTML elements are laid out in my AUT. This particular place is quite complex with many IFrames in Divs in Iframes in Divs.... Part of the Iframe is visible, even though the control is not, so I thought maybe this was causing the confusion.

Alternatively, I would think it could be smarter and detect that negative coordinates (or coordinates that are outside of the screen resolution) imply the item is not visible.

Aracknid

Re: How does EnsureVisible really work?

Posted: Tue Sep 18, 2012 4:46 pm
by Ciege
I'm afraid I can't answer your question about if EnsureVisible just checks the Visible property... Will need someone from support to answer that...
Quite honestly, I've seen several issues with EnsureVisible in the past with different tests I've run. Enough so that my framework does most of the scrolling into view for me.

Re: How does EnsureVisible really work?

Posted: Tue Sep 18, 2012 6:06 pm
by Aracknid
Yeah, I have problems with EnsureVisible too and I've also written lots of code to manually scroll. Guess I'll have to do the same with this specific troublesome area of my AUT.

Hmm.. maybe they should rename it to "AttemptVisible"...hahaha... :lol:

Re: How does EnsureVisible really work?

Posted: Wed Sep 19, 2012 3:41 pm
by Support Team
Hello,

The functionality depends very much on the technology, which is used. We not only check the 'Visible' property of the control. Ranorex tries to move forms to visible region of desktop by, e.g. scrolling.

Which technology is used for you controls? Could you send us a Ranorex Snapshot file from the control please.
Thank you!

Regards,
Bernhard
Ranorex Support Team