DataSheet Import in QTP

In QTP very often we need to import the run time data contents into some external excel sheet for genuinely important reason that is report generation as well as status tracking.

How can we import a datatable is been outlined as under?

Dim strFileName
strFileName ="C:\AutomationProject1\Report.xls"
datatable.ImportSheet strFileName,"sheet1","Global"
rCount=Datatable.GetRowCount
Datatable.GetSheet("Global").Addparameter "C",""
For i=1 to rCount
 datatable.SetCurrentRow(i)
 x=datatable.Value("A",Global)
 y=datatable.Value("B",Global)
 val=cint(x)+cint (y)
 msgbox val
datatable.Value("C", Global)= val
Next
datatable.Export strFileName

For gaining more insights in the automation using QTP log on to below url :

Automation Testing Using QTP


0 comments:

Post a Comment