Micro Focus QTP (UFT) Forums
Importdata and Export results - 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: Importdata and Export results (/Thread-Importdata-and-Export-results)



Importdata and Export results - shayk1985 - 12-12-2012

hi,
i want to import excelsheet into my script for which i used the below code;
Datatable.Importsheet "C:\Documents and Settings\Desktop\Excel testdata\Create.xls",1,"Results"
Now problem is my script consists of different functions like
launch browser
login
create retailer
if retailer exist then go to next
elseif retailer does not exist then create
end if
logout
here i want to import the excel and want to take no of iterations like for
i=1 to rowcount in this case where i have to place "next".also i want to create a excel function for importdata and export results so that i can use it for all tests

thanks


RE: Importdata and Export results - udayanem - 12-17-2012

It is all dependent on your Excel Content.

I am hoping the Excel sheet contains "Retailer" information in your case, you have to follow below approach.
Code:
Datatable.Importsheet "C:\Documents and Settings\Desktop\Excel testdata\Create.xls",1,"Results"
Datatable.getSheet("Results")
RowCount=DataTable.getrowcount

launch browser
login
for i=1 to RowCount
Datatable.setCurrentRow(i)
Now write your logic to create retailer etcc...
next
Regards,
Uday