Ask a Question

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

SOLVED
escap89
Contributor

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
escap89
Contributor

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

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 🙂

View solution in original post

23 REPLIES 23
Marsha_R
Community Hero

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

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


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
escap89
Contributor

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

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
Community Hero

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

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


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
escap89
Contributor

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

There is just "index"=0

 

PS.

ComboBox.wItem[2] returns name of  position with index 2, in my case "sprawy zakreślone" but how i can choose that?

 

Just read that:

Use case-sensitive parameters - Sets whether methods that simulate user actions (ClickItem, DblClickItem, SelectItem, etc.) will process their string parameters as case-sensitive. These methods belong to objects that correspond to various controls supported by TestComplete (for instance, Win32ListView).

But checking that option in properties didnt help.

escap89
Contributor

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

Ehh somehow my reply gone 😕

 

 

That Item params is just index=0 (attachment)

 

Log.Message(ComboBox.wItem[2])   it returns name of position with index=2 correctly but still dont know how to choose that.

 

 

Marsha_R
Community Hero

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

Take that whole name that shows in ObjectSpy next to the Search window and ends in .wItem

 

add on to the end so it looks like

 

wItem(2).Click

 

 

I think that will do it.  

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
escap89
Contributor

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

NameMapping.Sys.Process("wpius").Form("SAWA - Wydział Pracy i Ubezpieczeń dla I instancji V Wydział Pracy i Ubezpieczeń Społecznych, Wersja: 2.16.5.0 (MS SQL)").Panel("Workspace").MDIWindow("Repertorium P").Window("pbdw120", "", 12).ComboBox("rodzaj").wItem(2).Click

 

 

If i do that /\ im getting that error 😉 as it's written in first post

'IDispatchIndexedPropertyWrapper' object is not callable

 

 

Maybe developer did smth wrong with accessibility properties to that object?

Marsha_R
Community Hero

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

I looked up our combo box routine:

 

we look through the list of items in the box using the value of Items.Count until we find the one we want 

then we use that count = i for

comboobj.set_SelectedIndex(KeywordTests.ComboBox.Variables.i)

 

So you could try set_SelectedIndex = 2 for your object and see if that gets you the choice you want

 

 

 


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
escap89
Contributor

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

Find indexx number by row name is at the moment no problem but if i find it and i try:

ComboBox=NameMapping.Sys.Process("wpius").Form("SAWA - Wydział Pracy i Ubezpieczeń dla I instancji V Wydział Pracy i Ubezpieczeń Społecznych, Wersja: 2.16.5.0 (MS SQL)").Panel("Workspace").MDIWindow("Repertorium P").Window("pbdw120", "", 12).ComboBox("rodzaj")
ComboBox.set_SelectedIndex(2)

 

I get that:

Unable to find the object set_SelectedIndex(2)

cancel
Showing results for 
Search instead for 
Did you mean: