Micro Focus QTP (UFT) Forums
Compare webtable against database. - 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: Compare webtable against database. (/Thread-Compare-webtable-against-database)



Compare webtable against database. - LTFL - 08-27-2009

I'm new to QTP. I have a webtable in my application. I would like to compare the table contents against a database table. I wanted to compare number of rows, number of columns and cell contents. Could anybody please help me with it?


RE: Compare webtable against database. - Saket - 08-28-2009

Hi LTFL,

There are mthods in QTP for webtable object to get the required info.
RowCount- Returns the number of rows in the table.
ColumnCount- Returns the number of columns in the table.
GetCellData -Returns the text contained in the specified cell.
for more details look for webtable object in QTP help.
to compare these with database- you will need to connect to database, get the recordset using your query.
all these info will be there in recordset. which can be compared as required.

hope this info is sufficient to proceed with and let us know if you have any issue, Paste your lines of code as well so that we can help you in better way.


RE: Compare webtable against database. - LTFL - 08-28-2009

Thanks...