01-18-2011, 10:14 AM
Hi,
I created external Data Table and placed 2 records in the Excel Sheet.
I inserted a For Loop in my function and called those parameters. But while execution, QTP is running more than 2 times. My external data sheet is having only 2 records.
Why QTP is running more than twice??
Below is my sample function:
Please help??
Thanks,
Ravi.
I created external Data Table and placed 2 records in the Excel Sheet.
I inserted a For Loop in my function and called those parameters. But while execution, QTP is running more than 2 times. My external data sheet is having only 2 records.
Why QTP is running more than twice??
Below is my sample function:
Quote:Public Function Sample()
Datatable.AddSheet "Test_Data"
Datatable.ImportSheet "C:\QTP\Test_Data.xls", "Test_Data", "Test_Data"
Rc = Datatable.GetSheet("Test_Data").GetRowCount
For i = 1 to Rc
DataTable.GetSheet ("Test_Data").SetCurrentRow(i)
Browser("XXX").Page("YYY").WebElement("ZZZ").SetToProperty "innertext", DataTable ("ABC", "Test_Data")
Browser("XXX").Page("YYY").WebElement("ZZZ").Click
Browser("XXX").Page("YYY").WebElement("ZZZ").WebButton("XYZ").Click
St = Timer
Browser("XXX").Page("YYY").WebElement("Loading...").WaitProperty "Visible", "False" //Is this statement correct?
Reporter.ReportEvent micDone, "Loading", "Loading completed"
Et = Timer
Rt = Et - St
Reporter.ReportEvent micPass,"Report Time", "Report is generated in: " & Rt & " Seconds."
DataTable("Report_Time", "Test_Data") = Rt
Next
DataTable.ExportSheet "C:\QTP\Test_Data.xls", "Test_Data"
End Function
Please help??
Thanks,
Ravi.