Wednesday, October 13, 2010

CoolTuts - QTP - Working with Reporter Object

Reporter Object is used to send information to test results.

ReportEvent Method: Reports an event to the test results
Reporter.ReportEvent EventStatus, ReportStepName, Details [, Reporter]
EventStatus: 0 or micPass, 1 or micFail, 2 or micDone, 3 or micWarning
If(Window("text:=Untitled - Notepad").Wineditor("Class Name:=WinEditor").Exist)Then
Window("text:=Untitled - Notepad").Wineditor("Class Name:=WinEditor").Type("hello")
Reporter.ReportEvent 0, "Notepad exists", "Editor exists for the notepad"
Reporter.ReportEvent 1, "Notepad exists", "Editor exists for the notepad"
End if

No comments:

Post a Comment