I am automating a Java application using UFT 11.5. There is a grid in the application which can be identified as a Grid in UFT object spy. I have rows and columns in that Grid where dropdown and textboxes are placed and these objects can not be accessed using UFT (like we can access row and column combination in tables).
So I had to use virtual tables and click on the positions using x,y co-ordinates. This works. Now I want to access perticular row and column combination (like we can do for tables).
Is there any wawy to handle this in UFT? Please help
I am using this code. I click in the grid with x,y co-ordinates and once clicked i start typing value in the edit field considering cusrsor is at that position. Sample code as below -
Call clickGrid(WIN_VERTRAG_LE, 300, 55)
Public Sub clickGrid(strWinName, x, y)
JavaWindow(strWinName).JavaObject("Grid").Click x, y
End Sub
Call enterGridTabKeys(WIN_VERTRAG_LE, 1, false, "2500")
Public Sub enterGridTabKeys(strWinName, nCount, clearContent, strInput)
i = 0
Do until i = nCount
JavaWindow(strWinName).JavaObject("Grid").PressKey micTab
i = i + 1
Loop
If strInput <> "" Then
With JavaWindow(strWinName).JavaObject("Grid")
If clearContent Then
.PressKey micHome
.PressKey micEnd, micShift
.PressKey micDel
End If
End With
shortcut_senden strInput
End If
End Sub
Public Function shortcut_senden(keys)
Set shortcut_senden= CreateObject("WScript.Shell")
wait 1
shortcut_senden.sendkeys keys
wait 1
Set shortcut_senden= nothing
End Function