Forum Discussion

Jaspreet88's avatar
Jaspreet88
Occasional Visitor
6 years ago

Wrong ComboBox item count given by object spy

I am trying to find item combo box item count through test complete object spy and it’s giving 43 as count but actually ComboBox has only 32 items . Tried through script code via .net there also it’s showinf 43 . And object spy also shows 43. But if I click that combo box and count the items it’s 32. What can be the issue here ? It’s desktop application I am testing here. Please help asap.

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    You should be able to drill down in the mapping and see the individual items.  There's probably something like some blank items that are in the drop down but not displayed.

  • Vallalarasu_P's avatar
    Vallalarasu_P
    Frequent Contributor

    Try using FindallChildren and read the Name or Values of the dropdown exist, Which will give a better understanding of the development structure.

     

    Function ReadItemsCombobox

    set calObj=Sys.YourDesktopApp.
    PropArray = Array(“Class”)
    ValuesArray = Array(“combobox”)
    ComboListItems =calObj.findAll(PropArray,ValuesArray,30,true)
     Log.Message(“Count :” & UBound(ComboListItems ))
    for each xin ComboListItems
    Log.Message(x.Name)
    next

    End Function

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    A combo box, sometimes, may have items that are not visible on screen due to, perhaps, filters in place based upon other data.  The 43 is probably the full count but the 32 is what is currently available at the moment.