Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getROProperty("rows") : strange behaviour
#1
Solved: 11 Years, 4 Months ago
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 :
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 !
Reply
#2
Solved: 11 Years, 4 Months ago
Could be a Refresh issue. Try to kill the object reference and then re-initiate it.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Solved: 11 Years, 4 Months ago
Could you tell me how to kill an object reference ? ^^


I found a workaround. If I use "table.Object.updateUI()" and then "table.Object.getRowCount()" it's working !
But it still displays "0" with "getROProperty"...
Really strange...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple rows of test data Bhuvana 0 1,337 01-03-2020, 09:30 PM
Last Post: Bhuvana
Question Strange form, cant get it marvson 0 1,464 05-12-2016, 07:35 PM
Last Post: marvson
  Strange Behaviour of SwfTable robertosalemi 2 3,356 12-29-2015, 03:41 PM
Last Post: robertosalemi
  Adding data into rows that add dynamically with setcelldata azar81 4 5,916 04-13-2015, 05:24 PM
Last Post: vidya2k2
  Excel operation - to find usedrange of rows & col pooja 1 9,708 02-19-2015, 04:06 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)