Micro Focus QTP (UFT) Forums
data sheet row count - 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: data sheet row count (/Thread-data-sheet-row-count)



data sheet row count - rushil - 12-06-2012

I am using the below steps to get the rows count of a table. Instead of printing once the vlue of the rows count the print statment is printed "rowVal" times. That is if I have 8 rows in the data sheet it prints 8 times. Any help appreciated.
Thank you

Code:
DataTable.ImportSheet "C:\QTPD1\QTPcomplete\flights.xls" ,1 ,"Global"
rowVal = DataTable.GetSheet("Global").GetRowCount
print "there are "&rowVal & " rows in the table"



RE: data sheet row count - SteveS - 12-06-2012

Under Test Settings\Run you have it set to run on all rows, change this to Run one iteration only.


RE: data sheet row count - rushil - 12-07-2012

Thank you. It worked.