Ensuring an item in a scrollable panel is visible : Automation API

Ensuring an item in a scrollable panel is visible

Class library usage, coding and language questions.

Ensuring an item in a scrollable panel is visible

Postby deepblue » Mon Jul 19, 2010 10: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
deepblue
 
Posts: 6
Joined: Fri Jul 02, 2010 12:24 pm

Re: Ensuring an item in a scrollable panel is visible

Postby Support Team » Mon Jul 19, 2010 10: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
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Ensuring an item in a scrollable panel is visible

Postby deepblue » Mon Jul 19, 2010 11: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.
deepblue
 
Posts: 6
Joined: Fri Jul 02, 2010 12:24 pm

Re: Ensuring an item in a scrollable panel is visible

Postby Support Team » Mon Jul 19, 2010 11: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
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Ensuring an item in a scrollable panel is visible

Postby Support Team » Mon Jul 19, 2010 1: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
how-to-scroll-to-a-flex-item-if-ensurevisible-is-not-working-t1521.html

Regards,
Peter
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4840
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Ensuring an item in a scrollable panel is visible

Postby deepblue » Mon Jul 19, 2010 3:06 pm

Select seems to do the trick.

Thanks for the help!
deepblue
 
Posts: 6
Joined: Fri Jul 02, 2010 12:24 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests