You are on page 1of 2

QTPWorld http://www.qtpworld.com/index.php?

cid=92

Login | Search QTPWorld.com

Chapters Reporting Defect


Upcoming Trainings
Defining our own Result in result summary:
QTP Interview Questions
QTP has 4 types of result status:
VB Script - Part I
Pass
VB Script - Part II Fail
Done
VB Script - Part III
Warning
Working with Files using FSO

Excel Result is captured using ReportEvent Method:

Actions Generally QTP provides, test results, if we use qtp tool features like checkpoints. Suppose if we use flow control statements
(conditional and Loop statements), then we have to define our own result.For defining our own results, QTP is providing an
Functions utility object called "Reporter" by using reporter, we can define our own results.
Difference between Action and
Function Syntax:

Parameterization Reporter.ReportEvent EventStatus, ReportStepName, Details [, Reporter]

Object Repository Arguments:


Descriptive Programming
EventStatus: Status of the report step.Different types of event status are mentioned below:
Regular Expression
0 or micPass: Causes the status of this step to be passed and sends the specified message to the report.
Error Handling & Recovery
Scenario 1 or micFail: Causes the status of this step to be failed and sends the specified message to the report. When this step
runs, the test fails.
Output Values
2 or micDone: Sends a message to the report without affecting the pass/fail status of the test.
Database Connections

Automation Object Model 3 or micWarning: Sends a warning message to the report, but does not cause the test to stop running, and does not affect
the pass/fail status of the test.
Synchronization
ReportStepName: (String)Name of the intended step in the report (object name).
Environment Variables
Details: (String)Description of the report event. The string will be displayed in the step details frame in the report.
XML

Outlook
Ex 1: The following example use the ReportEvent method to report a Passed step with different format of Event status
Reporting Defect Reporter.ReportEvent 0, "User Login", "Passed as the Login functionality worked as per the requirment"

'OR

Contact Us Reporter.ReportEvent micPass, "User Login", "Passed as the Login functionality worked as per the requirment"

Ex 2: The following example use the ReportEvent method to report a Failed step with different format of Event status
info@qtpworld.com
Reporter.ReportEvent 1, "User Login", "Failed as the Login functionality didn't work as per the requirment"
+91- 9886477710
'OR

Reporter.ReportEvent micFail, "User Login", "Failed as the Login functionality didn't work as per the requirme

Ex 3: The following example use the ReportEvent method to report a Done step with different format of Event status

Reporter.ReportEvent 2, "User Login", "The Login functionality is validated"

'OR

Reporter.ReportEvent micDone, "User Login", "The Login functionality is validated"

Ex 4: The following example use the ReportEvent method to report a Warning step with different format of Event status

Reporter.ReportEvent 3, "User Login", "Warning : No input provided"

'OR

Reporter.ReportEvent micWarning, "User Login", "Warning : No input provided"

1 of 2 1/29/2016 9:42 AM
QTPWorld http://www.qtpworld.com/index.php?cid=92

Copyright QTPWorld.com 2013 Home | Demo videos | Students | Training | FAQ's | Feedback | About Us Designed By WebZone

2 of 2 1/29/2016 9:42 AM

You might also like