How to capture screenshots of Exceptions/Errors during run-
time?

Answer Posted / ravi_kanakam

When error occurs you can take screenshot of the desktop
and send the bitmap to result file.

if error occurs then

Desktop.CaptureBitmap("c:\bitmap.bmp")

Reporter.ReportEvent micFail, "Error Name", "&lt;<img
src="c:\bitmap.bmp>"

end if

The above code will send the screen shot to the Result File.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the latest version of QTP? Main difference between 9.2 and 10 version

1554


How can i use virtual objects? If have i created one new virtual object in a virtual object manager by following instructions.

1450


How to use userdifined environment variables.Once we created in Environment tab which is at File--> Settings-- >Environment-->Userdifined

1467


What is an expert view and keyword view?

573


Can launch two instances of qtp on the same machine?

583






Please guide me release notes of Automation once scripts are completed

1466


If created one virtual object? Next time I changed the window position will it work?

585


How do I lauch my test website using code from qtp in different environmet, uat and PPTE?

1462


Object repositories types, which and when to use?

580


What is the synchronization point in qtp?

565


Hi, Can anyone please tell me how to connect the QC with QTP using QTP script? Thanks in advance

1525


How to get popup error message.

1030


When and why to use descriptive programming?

610


How to export quicktest professional results to an .xls file?

574


Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?

1693