Micro Focus QTP (UFT) Forums

Full Version: Combo Box-es in table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all!

I'm using QTP with Java plugin to test Java applications. The problem is that in one JTable I have Combo box-es (one Combo Box in every cell of one column) and they were not learned in Object Repository. I solved part of that problem by adding table toolkit under "Controls to identify as separate test object". By adding that I could record on Combo Boxes, but it wouldn't be any difference between them and I would still get error that object cannot be identified when running the test...

I've also tried this:

Code:
Set table = JavaWindow("Element").JavaTable("BoardsTable").Object
Set JTableCS = table.mic_get_supp_class()
Set comp = JTableCS.getComponentAt(table, 7, 2)
                  
comp.setSelectedIndex(1)
comp.setSelectedItem("4")
But although there is no error, item in combo doesn't change.

Thanks for your help!
Could somebody please help me? I've tried everything I could think of but still can't find solution...
Hi ,

Try as given below.

Code:
JavaWindow("Element").JavaTable("BoardsTable").ChildItem(row,col,"JavaList",0).Select "4"
Hi, thanks for your reply!

This doesn't work, and I think because ChildItem function doesn't exist for JavaTable, it is for SAPTable.

Basically, my problem is that I can't learn Combo boxes in object repository. If I try to learn combo box in JTable it only sees it (and learns) as JavaTable and not JavaList...

I've spend a lot of time trying to figure that out and would appreciate any help I can get!
HI Pero,

Yes, you are correct. ChildItemmethod is not applicable for JavaTable,OracleTable,SwfTable objects so on so forth and it is applicable for SAPTable(SAP Web),WEBTables.

Hope you have selected "Context Sensitive" radiobutton from Tools > Options > Java tab > Advanced Button > Advanced Java > Record & Run Settings > Under Java Table Record Mode.(Since SetCellData, SelectRow so on could not be used when the JavaTable record mode is set to "Analog").
Hi Chilam,

Yes, I did that, and when I record on Combo boxes I get this:

Code:
JavaWindow("192.168.40.124 - RXI Element").JavaTable("BoardsTable").SelectRow "#10"
JavaWindow("192.168.40.124 - RXI Element").JavaList("JComboBox").Select "Etmc41"
JavaWindow("192.168.40.124 - RXI Element").JavaTable("BoardsTable").SelectRow "#11"
JavaWindow("192.168.40.124 - RXI Element").JavaList("JComboBox").Select "Etm4"
JavaWindow("192.168.40.124 - RXI Element").JavaTable("BoardsTable").SelectRow "#12"
JavaWindow("192.168.40.124 - RXI Element").JavaList("JComboBox").Select "Etm4"

First, it makes no difference between different combo boxes (I've recorded on three combo boxes), and second, I get error that it cannot identify the object "JComboBox"...
Please, please help me!
Hi

The post is old but i have the same problem. The QTP 11 has some supplementary option in the JAVA area of menu tools/option. There are some options in which you can set how java object are detected in a table cell. You can set to see the object as separate object. Maybe this is the solution or at list part of the solution