PB12 - How to work with combobox/dropdown/panel(combobox)
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
