How to update test step status in QC using QTP script?

by Community Manager on ‎01-08-2013 02:08 PM

Question

My Requirement:
I want to update test execution status of each step in Test set.
Step Name, Description and Expected Result should be displayed in Test Instance Properties like they are displayed when we manually execute the test execution.

In simple words, I just need to update the Status as Pass/Fail for each step. Rest everything should be displayed as in manual.

Answer

Try using this:

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

Status of the report step:
0 or micPass: Causes the status of this step to be passed and sends the specified message to the report.
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.
2 or micDone: Sends a message to the report without affecting the pass/fail status of the test.
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.


Example:
The following examples use the ReportEvent method to report a failed step.

Reporter.ReportEvent 1, "Custom Step", "The user-defined step failed."

or

Reporter.ReportEvent micFail, "Custom Step", "The user-defined step failed."

Search
Showing results for 
Search instead for 
Do you mean 
HP Blog

HP Software Solutions Blog

Featured


Follow Us
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.