Forum Discussion

escap89's avatar
escap89
Contributor
8 years ago
Solved

PB12 - How to work with combobox/dropdown/panel(combobox)

Hi,
I have read alot of sites but didnt found any solution :/ how to solve these problems:

 


Problem number 1(attachemnts with "p1"):

I have a object ComboBox("rodzaj") that have properties like wItem,wItemCount,wSelectedItem but still its not posibble to select any item from the list. If i read wSelectedItem property it always giving "-1" in ouput even if i change selected item.

Refresh() not helps - looks like TC "remember" selected as default value.

 

ComboBox=ParentWindow.ComboBox("rodzaj")
ComboBox.Refresh()
Log.Message(ComboBox.wSelectedItem)#Always "-1"

 If i try:

    Log.Message(ComboBox.wItem(1))

I get that error:

TypeError 'IDispatchIndexedPropertyWrapper' object is not callable


Problem nr 2(attachemnts with "p2"):

In this case our "combobox" is a panel and I have no clue how to choose a specific value from it.


Problem nr 3(attachemnts with "p3"):

In this case we have to work with dropdown object, I have no clue how to choose a specific value from it.

 

Actually in every case I am using "down" keys but as we know its weak solution.

I already seen that: https://support.smartbear.com/viewarticle/72444/

 

I would be very grateful for your help

 

  • escap89's avatar
    escap89
    8 years ago

    Developer said that there is not anything like that.

    The only way  to get data is put DataWindow inside combobox cause DataWindow is "datasource" in PB.

     

    There is way to make combobox  cooperate with TC but it would take too much time.

    Put DataWindow somewhere in a window as hidden object and  let it communicate with combobox, so combobox would create a list based on that.

     

     

    Well thanks for help for all of you :)

23 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Try recording a test where you select something out of the combo box and see what object you get.

    • escap89's avatar
      escap89
      Contributor

      Thanks for concern.

      I started from recording

      Recorder see rows inside as (x,y) - attached screen.

       

      Below recorded test converted to script:

      def Example():
      Parent.ComboBox("rodzaj").Click(109, 4)
      Parent1.Window("pbdwlb120", "", 1).Click(68, 34)

       
      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        Above Selected Item in object spy there is Item with some params.  What's in there?