10-07-2009, 03:19 PM
Hi,
As Basanth said you can use the Counter Variable. Below is a sample code from Flight Reservation Application, which gives the useage of Counter variable in Reporter Events.
Also, you can see the Screen Shot which gives the No. of Pop-Up's displayed for each Pop-Up Dialog's.
Cheers,
Deepak.Bhandarkar
As Basanth said you can use the Counter Variable. Below is a sample code from Flight Reservation Application, which gives the useage of Counter variable in Reporter Events.
Also, you can see the Screen Shot which gives the No. of Pop-Up's displayed for each Pop-Up Dialog's.
Code:
Dim a,k
a= DataTable.GetRowCount
For i=1 to a
DataTable.SetCurrentRow(i)
b=DataTable.Value("AgentName",dtGlobalSheet)
c= DataTable.Value("Password",dtGlobalSheet)
d= DataTable.Value("CorrectPassword",dtGlobalSheet)
e= DataTable.Value("DateofFlight",dtGlobalSheet)
f= DataTable.Value("FlyFrom",dtGlobalSheet)
Dialog("Login").WinEdit("Agent Name:").Set b
Dialog("Login").WinEdit("Password:").Set c
Dialog("Login").WinButton("OK").Click
If Dialog("Flight Reservations").Exist Then
k=k+1
Reporter.ReportEvent micPass, "Verify Flight Reservations Dialog","Flight Reservation Pop-Up dialog is displayed "&"-"&"No of Pop-Up's:" & k
End If
Dialog("Flight Reservations").WinButton("OK").Click
Dialog("Login").WinEdit("Password:").Set d
Dialog("Login").WinButton("OK").Click
wait 5
If Window("Flight Reservation").Exist Then
Reporter.ReportEvent micPass,"Verify Flight Reservation dialog","Flight Reservation Dialog is displayed"
Else
Reporter.ReportEvent micFail,"Verify Flight Reservation dialog", "Flight Reservation Dialog is Not displayed"
End If
Window("Flight Reservation").ActiveX("MaskEdBox").Type e
Window("Flight Reservation").WinComboBox("Fly From:").Select f
If Window("Flight Reservation").Dialog("Flight Reservations").Exist Then
k=k+1
Reporter.ReportEvent micPass,"Verify Flight Reservations dialog","Flight Reservation Pop-Up dialog is displayed "&"-"&"No of Pop-Up's:" &k
End If
Window("Flight Reservation").Dialog("Flight Reservations").WinButton("OK").Click
Next
Cheers,
Deepak.Bhandarkar