Page 1 of 1

Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 7:49 pm
by monkey2012
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?

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 8:59 pm
by Ciege
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.

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 10:29 pm
by monkey2012
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();

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 10:42 pm
by Ciege
Is it your .Exists that is taking too much time for your liking? Did you try changing the timeout to something shorter?

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 10:46 pm
by monkey2012
I did not change any timeout. I can try

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 10:50 pm
by Ciege
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.

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 11:17 pm
by monkey2012
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.

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 11:24 pm
by monkey2012
BTW, what is "Effective Timeout"? It is 1m and grayed out.

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 11:33 pm
by Ciege
http://www.ranorex.com/support/user-gui ... rties.html

Scroll down just a bit and you will see the definition...

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 11:42 pm
by monkey2012
Is there any more timeout value that I need to change?

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 11:53 pm
by Ciege
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.

Re: Selecting an item from large dropdown list

Posted: Wed Jan 02, 2013 11:57 pm
by Ciege
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.

Re: Selecting an item from large dropdown list

Posted: Mon Jan 07, 2013 6:32 pm
by monkey2012
Yes, .Exists took a long time to locate the item; I used .TryFindSingle, it does speed up alot.