Micro Focus QTP (UFT) Forums
Retrieve columnname position from webtable - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Retrieve columnname position from webtable (/Thread-Retrieve-columnname-position-from-webtable)



Retrieve columnname position from webtable - SrinuKodi - 06-25-2012

Hi Team,

I want to retrieve columnname position(row*column) from Webtable on web application.Could anyone suggest me please.


Thanks
Srinu Kodi


RE: Retrieve columnname position from webtable - supputuri - 06-25-2012

I don't understand what do you mean by "columnname POSITION". Do you want to get the x,y coordinates ? or the column number based on the column name?

If you can provide clear info we will give you the best ans.


RE: Retrieve columnname position from webtable - SrinuKodi - 06-26-2012

I mean,If there are 10 columns in webtable,and we know only column name like Invoive.No.But we don't know in which cloumn it is.I want find that position whether 1st or 2nd or 10th column.


Thanks
Srinu Kodi



RE: Retrieve columnname position from webtable - ssvali - 06-26-2012

Try the below code
Code:
rCnt = Browser("").Page("").WebTable("").GetROProperty("rows")
For i = 1 to rCnt - 1
   cCnt = Browser("").Page("").WebTable("").GetROProperty("columns")
     For j = 1 to cCnt - 1
        Col_Name = Browser("").Page("").WebTable("").GetCellData(i,j)
        If Col_Name = "Invoive.No" Then
           Msgbox "Column Number" & j
        End IF
     Next
Next