Forum Discussion

lsainsbury's avatar
lsainsbury
Contributor
11 years ago

Checking child item of TListBox

Hey guys/girls



I am trying to check the child items of my TListBox exist and then do something if they do, however no child items are listed in the name mapping, and the wItemList property of TListBox lists multiple items seperated by |



Basically what I am trying to achieve here is if the child item of TListBox exists then perform an action otherwise skip the action and continue with the test steps, I am just a little confused about which way to exactly go about it.



I am using the Wizard :)



Any help would be fantasitc, thanks in advance!

2 Replies


  • Hi Lee,


     


    You can create a property checkpoint to implement your task with the settings listed in the attached image. In this case, TestComplete's checkpoint will pass if the control contains the target item in the list:




     


    Please go through the "Property Checkpoint Wizard - Select Object Page" article to find more information.


     

  • Ravik's avatar
    Ravik
    Super Contributor
    Hi Lee,



    I achieved same functionality using below code (comman function) try this, it may help you.-






    Function SelectDropDown(ddl_objName, objVal)



    Dim ddlItems,ddlItems1, item



     



    If ddl_objName.Enabled Then



    ddlItems = ddl_objName.wItemList



    ddlItems1 = Split(ddlItems, ";")



    for each item in ddlItems1



    If objVal = (aqConvert.VarToStr(item))Then



    ddl_objName.Keys(aqConvert.VarToStr(item))



    Else



    log.Message("Item not found in list")



    End If



    Exit For



    Next



    End If



    End Function