09-04-2009, 04:38 PM
Hello,
First I just would like to say that the AUT is quite weird. When a window is opened, closed and reopen in it there are 2 instances of this window. The second one is normal and the first one is not displayed and not reachable by any means (but it still exists).
I don't know if it will help but since I really don't know why my code is not working...
Description :
In a test I would like to add a row in a JTable and display the number of rows before and after this operation.
The problem is that in some cases, it works fine and in other cases the number of rows that I get thanks to getROProperty("rows") is the same before and after.
1 - It's ok if I open the application and then do the test :
2 - It's ok if the application is opened before the text.
(the code is the same without the two first lines and it displays "1")
3 - It doesn't work if the application is already opened and if the window is closed but have been opened before
I'm using QTP 9.5 with the Java add-in.
The window and the table are in the OR and their identification work fine.
Thanks in advance !
First I just would like to say that the AUT is quite weird. When a window is opened, closed and reopen in it there are 2 instances of this window. The second one is normal and the first one is not displayed and not reachable by any means (but it still exists).
I don't know if it will help but since I really don't know why my code is not working...
Description :
In a test I would like to add a row in a JTable and display the number of rows before and after this operation.
The problem is that in some cases, it works fine and in other cases the number of rows that I get thanks to getROProperty("rows") is the same before and after.
1 - It's ok if I open the application and then do the test :
Code:
openMyApplication
openMyWindowInTheApplication
Set table = JavaWindow("Test").JavaTable("Test")
rowBefore = table.getROProperty("rows")
'Add one row in the JTable
addRow
rowAfter = table.getROProperty("rows")
msgbox rowAfter - rowBefore 'Display "1"
2 - It's ok if the application is opened before the text.
(the code is the same without the two first lines and it displays "1")
3 - It doesn't work if the application is already opened and if the window is closed but have been opened before
Code:
openMyWindowInTheApplication
Set table = JavaWindow("Test").JavaTable("Test")
rowBefore = table.getROProperty("rows")
'Add one row in the JTable
addRow
rowAfter = table.getROProperty("rows")
msgbox rowAfter - rowBefore 'Display "0"
I'm using QTP 9.5 with the Java add-in.
The window and the table are in the OR and their identification work fine.
Thanks in advance !