Selecting an item from large dropdown list

Ranorex Spy, Recorder, and Studio.
monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Selecting an item from large dropdown list

Post by monkey2012 » Wed Jan 02, 2013 7:49 pm

Hi support team,

I have a huge dropdown selection list with more than 100 different data and I cannot type anything in the text box, to find my desired data, the only way is to click the down arrow until i find it and then select it.
In this case, I don't know how many clicks I have to do, is there a way in Ranorex that I can search through all the available data in the picklist and then select it?

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Selecting an item from large dropdown list

Post by Ciege » Wed Jan 02, 2013 8:59 pm

That depends... Is the list fully populated at run time or is it "lazy loaded" (list items don't appear in the list control until they are scrolled into view).

If it is fully populated you should be able to get the list from the combo element. Check through Spy to see the proper attribute.

If it is lazy loaded you can do this...
1) Open the list box.
2) Type CTRL-HOME to go to the top of the list.
3) Check if your item is in view, if it is select it.
4) Press down arrow.
5) Return to step 3.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: Selecting an item from large dropdown list

Post by monkey2012 » Wed Jan 02, 2013 10:29 pm

Hi Ciege,

I click on the dropdown list button, check if the desired data exists, if not, then click on scrollbar + pagedown until it is visible but it is too slow in this checking. Is there a faster way?

I used the while loop:

while (!repo.MyMainForm.SelectionList.MyItemInfo.Exists())
{
repo.MyMainForm.PageDown.Click("LowerCenter");
}
repo.MyMainForm.SelectionList.MyItem.Click();

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Selecting an item from large dropdown list

Post by Ciege » Wed Jan 02, 2013 10:42 pm

Is it your .Exists that is taking too much time for your liking? Did you try changing the timeout to something shorter?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: Selecting an item from large dropdown list

Post by monkey2012 » Wed Jan 02, 2013 10:46 pm

I did not change any timeout. I can try

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Selecting an item from large dropdown list

Post by Ciege » Wed Jan 02, 2013 10:50 pm

Ya, if you left the default timeout on the repo object (probably like 30 seconds or so) then it will take that long each time Ranorex has to evaluate if the item exists. Changing the timeout to something shorter (make sure that it is long enough to succeed when/if the item does exist) then you can shorten your test dramatically.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: Selecting an item from large dropdown list

Post by monkey2012 » Wed Jan 02, 2013 11:17 pm

I changed the "Search Timeout" from 30s to 1ms, it only improved 0.5 min to search through the displayed list with only 11 values. Please let me know where else I should change the timeout besides this.

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: Selecting an item from large dropdown list

Post by monkey2012 » Wed Jan 02, 2013 11:24 pm

BTW, what is "Effective Timeout"? It is 1m and grayed out.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Selecting an item from large dropdown list

Post by Ciege » Wed Jan 02, 2013 11:33 pm

http://www.ranorex.com/support/user-gui ... rties.html

Scroll down just a bit and you will see the definition...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: Selecting an item from large dropdown list

Post by monkey2012 » Wed Jan 02, 2013 11:42 pm

Is there any more timeout value that I need to change?

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Selecting an item from large dropdown list

Post by Ciege » Wed Jan 02, 2013 11:53 pm

That depends...
You didn't answer my question of "Is it your .Exists that is taking too much time".

If it is just the .Exists that is taking the time, then changing the timeout for that repo item *should* suffice.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Selecting an item from large dropdown list

Post by Ciege » Wed Jan 02, 2013 11:57 pm

Something else you can do to try and speed things up is it create an element variable for the SelectionList. Then do a .FindSingle for your item with the SelectionList as the root object. This way it will force Ranorex to only search from your root SelectionList and down instead of from the root of your AUT down.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

monkey2012
Posts: 77
Joined: Wed Sep 26, 2012 8:15 pm

Re: Selecting an item from large dropdown list

Post by monkey2012 » Mon Jan 07, 2013 6:32 pm

Yes, .Exists took a long time to locate the item; I used .TryFindSingle, it does speed up alot.