(Note: First manually need to
prepare input.xls file with list of valid and invalid values and save in
desired path.)
Option Explicit
Dim rowCnt,rowNum
Datatable.ImportSheet
"D:\input.xls",1,2
rowCnt=Datatable.GetSheet(2).GetRowCount
For rowNum=1 to rowCnt
SystemUtil.Run "C:\Program Files\Mercury
Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
Dialog("Login").WinEdit("Agent
Name:").Set datatable("uname",2)
Dialog("Login").WinEdit("Password:").Set
datatable("pwd",2)
Dialog("Login").WinButton("OK").Click
If Dialog("Login").Dialog("Flight
Reservations").Exist Then
Reporter.ReportEvent micFail,"Verify login
functionality","Login functionality is not working"
Dialog("Login").Dialog("Flight
Reservations").Close
Dialog("Login").WinButton("Cancel").Click
datatable("result",2)="Fail"
Else
Window("Flight Reservation").Close
Reporter.ReportEvent micPass,"Verify login
functionality","Login functionality is working"
datatable("result",2)="Pass"
End If
Datatable.SetNextRow
Next
Datatable.ExportSheet
"D:\output.xls",2 Contributed by: Vamshi Gowtham
m.vamsigowtham@gmail.com