Micro Focus QTP (UFT) Forums
Get row number from web table - 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: Get row number from web table (/Thread-Get-row-number-from-web-table)



Get row number from web table - amilar - 11-24-2008

Hi All,

I have a problem in retrieving row number from data table. I want to get the row no from specific data.

Code:
row= Browser(":: Cesar").Page(":: Cesar").Frame("frm_spnGrid").WebTable("1").GetRowWithCellText ("BAH-05:00-QTP")
msgbox row

BAH-05:00-QTP -
SHJ-BAH-05:00-QTP

when this code line execute, it gives wrong row no. it gives row number for the SHJ-BAH-05:00-QTP. I don’t know what is the reason. In here I have attached the web table image I used. I think both data are similar,

if any one knows how to solve this problem, please help me…
Thanks

Amilar


RE: Get row number from web table - manizkrishnan - 11-25-2008

Try with GetRowWithCellText("BAH-05:00-QTP", <column No>) ...and also try to get all the values of the web table and locate the string "BAH-05:00-QTP"


RE: Get row number from web table - amilar - 11-25-2008

thx manizkrishnan

I added column no, but it didnt work. could u please tell me how to get all values from web table and locate string what we need. thanks

Amilar


RE: Get row number from web table - manizkrishnan - 11-25-2008

_______________________________________________
try this to get all values from the table...
Code:
NumRows = Browser(BrowserName).Page(PageName).WebTable(TableName).RowCount

NumColumns = Browser(BrowserName).Page(PageName).WebTable(TableName).ColumnCount(NumRows )

for i=1 To NumRows
    For j=1 To NumColumns
print Browser(BrowserName).Page(PageName).WebTable(TableName).GetCellData(i,j )
     Next
Next



RE: Get row number from web table - amilar - 11-25-2008

thanks manizkrishnan,

I did it.. thank you very much for your help.
thanks again......