Forum Discussion

fkr717's avatar
fkr717
Occasional Contributor
11 years ago

Combo Box records, will not play back

Below is a video of a test I recorded, as you can see the combo fires as expected.  When you playback the test, it does not select anything the the test fails.  I mean, it looks like it going to select something, but never populates.  Below is a video of what is supposed to happen, I was unable to record during playback.  What happens is TestComplete selects say "Open One" and when it leaves the cell it goes back to blank.   The object is a windows form application using a datagridview control, with a combo box column. 

 

http://screencast.com/t/hGzmArDLhTv

 

 

 

3 Replies

  • Hi,

     

    Thanks for the video. Do you have any errors in the Test Log?

    Also, I guess you are using the name of the item in the ClickItem method. Try using the index of the item instead: ClickItem([1]). How does it work?

     

    • fkr717's avatar
      fkr717
      Occasional Contributor

      I am not sure how to do what you are suggesting, I recorded the test using the point and click method, when I look at the ClickItem it has "Open One" for the value column.  Below is a short video to show what I am talking about.  First I will show what I am doing then show what the test records. 

       

       

      http://screencast.com/t/W5yOYCiuMS

       

       

       

      • mes6073's avatar
        mes6073
        Contributor

        Not sure this will help, but here is a sample (VBScript) that might help should get you started:

         

         

        Sub TestComboBox(wndDlg)
        
           Dim arrProps : arrProps = Array("WndClass", "Visible")
           Dim arrValues : arrValues = Array("ComboBox", True)
           Dim ctrl : Set ctrl = wndDlg.FindChild(arrProps, arrValues, 10)
           Dim delim, i, iLast, iLength, iStart, itemCount, strItem, strItems
           
           If ctrl.WaitProperty("Exists", True, 999) Then
              itemCount = ctrl.wItemCount
              strItems = ctrl.wItemList
              delim = ctrl.wListSeparator
              aqString.ListSeparator = delim
                 
           	' Extract particular items and post them to the log 
              For i = 0 to (itemCount - 1)
              	' Obtain the selected item by its index
        strItem = aqString.GetListItem(strItems, i) ctrl.ClickItem strItem Next End If End Sub