QTP 11 Calling method to open a dialog doesn't complete until dialog is closed.
I'm using QTP 11 in a Java based application and I'm trying to code up a custom JavaList that has been introduced in our latest branch. See JavaList.png
The JavaList works normally as a JavaList does where if there is an item within the list you can select it by name\index. Our developers wanted to consolidate some external command buttons that allow for New and Manage options. The way they consolidated this was by adding them to the list, but they are not actually within the list. When a user select New... a newItem method event is triggered and the New dialog appears.
So with that I thought that I would call the newItem method directly via the object with this code:
Here's the code I use to click a non-selectable object within a JavaList object.
In my scenario when I click on the list option a dialog appears so I'm using that to exit the loop
Public Sub sGlobalJavaListClickNew(objJavaList,objDialogToExp ect)
Dim x,y, DC
x = objJavaList.GetROProperty("abs_x")
y = objJavaList.GetROProperty("abs_y")
width = objJavaList.GetROProperty("width")
height = objJavaList.GetROProperty("height")
x = x + width\2
y = y + height\2
Set DC = CreateObject("Mercury.DeviceReplay")
Do Until objDialogToExpect.Exist(0)
DC.MouseClick x,y, micLeftBtn
DC.MouseClick x,y+15, micLeftBtn