How to take screenshot of failed QTP step?

Guys, always take screenshot of the failed steps when creating a QTP test, it will saves your time in identifying the issue thru Result Viewer, and reduce the result analysis time. Below is the simple code to achieve that

screenShot = “TestScreenShot”+ ".bmp"
Browser("Test").CaptureBitmap screenShot
Reporter.ReportEvent micFail,  “Failed Reason”,  “Failed Reason in Detail”, screenShot

Comments

Popular posts from this blog

How to maximize FireFox browser from QTP

How to search and click a link in a WebTable?