Ensuring an item in a scrollable panel is visible

Class library usage, coding and language questions.
deepblue
Posts: 6
Joined: Fri Jul 02, 2010 11:24 am

Ensuring an item in a scrollable panel is visible

Post by deepblue » Mon Jul 19, 2010 9:05 am

Hi Guys,
I'm in the process of writing a test which iterates over a TreeView, but I'm having trouble making sure that the items are visible because the user has to scroll to get to the bottom of the list.

Does anyone have a cunning way to do this?

Cheers

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ensuring an item in a scrollable panel is visible

Post by Support Team » Mon Jul 19, 2010 9:53 am

Hi,
deepblue wrote:Does anyone have a cunning way to do this?
Please try to use the method EnsureVisbile(). This method ensures that the element is visible to the user. This is usually accomplished by bringing the element or one of its ancestors to foreground.
http://www.ranorex.com/Documentation/Ra ... isible.htm
If EnsureVisible() doesn't work please take a look to the Focus() method.
http://www.ranorex.com/Documentation/Ra ... _Focus.htm

Regards,
Peter
Ranorex Support Team
.
Image

deepblue
Posts: 6
Joined: Fri Jul 02, 2010 11:24 am

Re: Ensuring an item in a scrollable panel is visible

Post by deepblue » Mon Jul 19, 2010 10:10 am

Yes, I tried using these two methods. The parent tree is indeed visible and focussed, but the element of the tree that I want isn't visible to the user because they need to scroll down the tree to see it.

I guess the question is applicable to any kind of control which uses scroll bars.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ensuring an item in a scrollable panel is visible

Post by Support Team » Mon Jul 19, 2010 10:26 am

Hi,

Please can you post me a Ranorex Snapshot of the tree.
http://www.ranorex.com/support/user-gui ... html#c2072
And please can you post me which version of Ranorex is in use.

Thanks in advance.
Regards,
Peter
Ranorex Support Team
.
Image

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ensuring an item in a scrollable panel is visible

Post by Support Team » Mon Jul 19, 2010 12:23 pm

Hi,

Ensure Visible is not working because it is a MSAA element. Have you tried the Select() method of the tree item itself.
http://www.ranorex.com/Documentation/Ra ... eeItem.htm
Using this method you should be able to select even non visible items. If this method is not working, please take a look to following post
http://www.ranorex.com/forum/how-to-scr ... t1521.html

Regards,
Peter
Ranorex Support Team
.
Image

deepblue
Posts: 6
Joined: Fri Jul 02, 2010 11:24 am

Re: Ensuring an item in a scrollable panel is visible

Post by deepblue » Mon Jul 19, 2010 2:06 pm

Select seems to do the trick.

Thanks for the help!