How to get the number/count of items within the combo

Is there a way to get the number/count of items within the combo box/list box in the application thereby selecting a specific item which is dynamic.

Unfortunately, I can’t think of a good way of doing this – I can come up with some methods that could probably be made to work, but they are awkward and complicated. I’m going to have to leave this as a challenge to our other users.

You can usually click to open the combo box and then use “typetext downarrow” to move down through the items. So if you wanted a specific ordinal item, such as the 5th, you could do this:

Click "comboBox"
repeat 4 times // assumes the first item is already selected
    typeText downArrow
end repeat
typeText returnKey

You could make this a handler with the item number as a parameter so that you could select any item in the list.

Thanks for that,in the meanwhile if you come across any better solution.Please do update the post.

Keep in mind that a text image may also be used to click an item in a list, provided your script has the title of the item, even if it is dynamically generated during the run.

click (text:titleOfItemToSelect, textStyle:comboBox)

If there are more than one combo box in same window or page . how to handle then uniquely?

You can either identify the combo boxes by their labels and use the relative hot spot technique to click on them, or if the combo boxes look exactly the same, you could look for all instances of the combo box and then click on them by index:

// find all the combo boxes and store their locations
put everyImageLocation("comboBox") into cbl
click item 1 of cbl // click the first one found
// do something
click item 2 of cbl // click the second one found
// do something