Micro Focus QTP (UFT) Forums
Selecting image in swftable - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Selecting image in swftable (/Thread-Selecting-image-in-swftable)



Selecting image in swftable - Taran - 09-21-2010

Hi

I am automating Windows based application through QTP with the help of .Net addin.

There is a swftable(many rows and 6 columns). I want to select the image present at Row1 and Column 1.

I have tried clickcell,selectcell and activate cell method but nothing is working. Please tell me how to click the image at(1,1).

Thanks
-Taran


RE: Selecting image in swftable - guin.anirban - 09-21-2010

Use ChildItem And ChildItemCount method, better go through QTP help manual.


RE: Selecting image in swftable - lotos - 10-04-2010

Hi Taran,
try GetCellData

object.GetCellData (Row, Column)

the sample bellow is for web, try to use it for windows elements, by changing the objects from web to windows:
Code:
Browser(..).Page(..).WebTable("micclass := WebElement" , "class := obj_Class", "Html Tag := TD", "Text := obj_Text", "Index:=obj_Index").GetCellData("1", "1")

here is a sample for .NET Windows Forms, Get Data from a Specified Cell in an 'Infragistics UltraWinGrid' Control :
Code:
Sub GetCellData_Example1()
'The following example uses the GetCellData method with Infragistics UltraWinGrid control to return the data
'contained in the second row of the "Description" column within the second band level.
MyData = SwfWindow("Layouts").SwfTable("gridOne").GetCellData("0;1", "Description")
MsgBox MyData
End Sub

and another one, Get Data from a Specified Cell in a 'DevExpress XtraGrid' Control:

Code:
Sub GetCellData_Example2()
'The following example uses the GetCellData method with DevExpress XtraGrid control to return the data contained
'in the third row of the "CustomerID" column within the "Orders" view.
SwfWindow("MasterView").SwfTable("gridControl1").SetView "3 Orders;"
SwfWindow("MasterView").SwfTable("gridControl1").SelectCell 2, "CustomerID"
MyData = SwfWindow("MasterView").SwfTable("gridControl1").GetCellData("2", "CustomerID")
MsgBox MyData
End Sub

see within the QTP Help: GetCellData Method (Swf Table)

I hope it will help you.