Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Can't get SwfTable details
posted

Hi,

I'm using QTP 10 (fresh installation, with .NET add-in installed and loaded) with TestAdvantage 9.2CLR2.0 (licensed version).

I was trying to get the cell data from an SwfTable object but kept failing.

From a product quote console (see screen image),  the middle part (with headers like Time, Contact, Product, etc.) is an SwfTable object, as recognized by the object spy.   But I wasn't able to retrieve the data from the cells.

I tested with the following scripts:

If SwfWindow("Quote Console - YJ Energy").SwfTable("SwfTable").Exist Then
 msgbox "yes"
 cnum = SwfWindow("Quote Console - YJ Energy").SwfTable("SwfTable").GetTOProperty("ColumnCount")
 rnum = SwfWindow("Quote Console - YJ Energy").SwfTable("SwfTable").GetTOProperty("RowCount")
 msgbox "columns: " & cnum & " , rows: " &  rnum
Else
 msgbox "no"
End If

The result was: QTP was able to recognize the SwfTable object (the "yes" msgbox popped up), but the column and row counts were returned as null (see image).
 
I can't attach images to this posting. Every time I tried, it crashed the browser (FF or IE), I will try to attach them later...

Any idea?
 
Thanks,

  • 7695
    Offline posted

    Hi Xyin,

         You didn't specify what control that you were using, but I guessing it was an UltraGrid. In which case you can use SwfTable("SwfTable").RowCount and ColumnCount respectively. As to GetTOProperty that is a QTP method so I cannot comment on it in too much detail, but it seems to get a property value off of the test object. The UltraGrid does not have either RowCount or ColumnCount as a property directly off of the control.

  • 65
    posted

    I still can't insert or attach (under the Options tab) an image to the above post. My browser kept getting closed when I tried to do that.  :)