Depending on the type of code and type of listbox being used, your repository may capture the listbox as a listbox type. I have found that if you use the Repository/Populate Repository and open the listbox then click into it, your repostitory may capture it. If it does, then you can select by item number rather than the text itself,
When I create a new product in my database, dynamically, using QAWP, later in the script I want to find that product in a listbox and select it.
However, since I, by definition, have not populated the repository with the new item (it was created earlier in the same script), I get a message something like "QAWP cannot obtain real-time information about this item."
Seapine helped me find a solution:
'First, define this function
Function GetItemNumberFromListBox( controlname, seekvalue )
' This gets all of the items in the combobox
ITM = 0
LISTITEMS = Window( nextwindow ).ListBox( controlname ).Property("ListItems")
' This tell QA Wizard Pro to loop through and select the choosen item via the regular expression ("seekvalue")
NUM = Arraysize( LISTITEMS, 1 )
for X = 1 to NUM
if EvaluateRegExpression( seekvalue, LISTITEMS( X ) ) = true then
'So once you call that function, you can use its return 'value to select an item from a textbox or listbox.
ITEM_NUM = GetItemNumberFromListBox( controlname, seekvalue )
Window( WINDOW_MAIN ).ListBox( controlname ).Item( ITEM_NUM ).Select()