Wednesday, September 15, 2010

Reporter Object in QTP

Hi All,

Here iam providing an overview of Reporter Object in QTP.

Reporter Object is used for sending information to the test results. With the help of this object you can:
· Report the status of test results (like pass, fail, warning)
· Enable/Disable reporting of step(s) following the statement.
· Retrieve the folder path in which the current test's results are stored.
· Retrieve the run status at the current point of the run session.

There are some very important methods and properties associated with it.

"ReporterEvent" Method:
This is a very common method used with Reporter object.
Its syntax:
Reporter.ReportEvent EventStatus, ReportStepName, Details
Where EventStatus can be:
0 or micPass: If this step runs test passes which is shown in test report.
1 or micFail: If this step runs test fails which is shown in test report.
2 or micDone: Used to send message to the test report and does not affect status of test.
3 or micWarning: Again, used to send warning message to the test report and does not affect status of test.
ReportStepName -->name of step
Details --> are the user defined details for the given step.
For Example:
Reporter.ReportEvent micPass, "Creation Scenario Validation", " Successfully passed"


"Filter" property :
There can be situations where you don't want the full status displayed on the test report. This property can be used to selectively filter the status of your tests.
Its syntax:
Reporter.Filter = NewMode
Where NewMode can be: 0 or rfEnableAll: This is the default mode. All reported events are displayed in the Test Results.
1 or rfEnableErrorsAndWarnings: Only those events with a warning or fail status are displayed in the Test Results.
2 or rfEnableErrorsOnly: Only those events with a fail status are displayed in the Test Results.
3 or rfDisableAll: All events in the Test Results are disabled.

'ReportPath" Property :
This is used to get the path in which current test results are stored.
Its syntax:
Path_of_Results = Reporter.ReportPath

"RunStatus" Property:
This is used to get the current status of the run session
its syntax:
Reporter.RunStatus
For Example:
if Reporter.RunStatus = 0 then
flag=1;
end if

Version History of QTP

Hi All,
Here I would like to share the version history of Quick Test Pro .

1998 -> Astra QT
2000 -> QTP 5.0
2001 -> QTP 5.5
2002 -> QTP 6.0
2003 -> QTP 6.5
2004 -> QTP 8.0
2005 -> QTP 8.2
2006 Feb -> QTP 9.0
2007 Jan -> QTP 9.1
2007 Feb -> QTP 9.2
2008 Jan -> QTP 9.5
2009 Feb -> QTP 10

2010 Nov -> QTP 11


From version 9.5 HP acquired the tool from Mercury.