How to capture screen shots when an error occurs?

Answer Posted / deepak k

Hi use RecoveryFunction to capture the image when error
ocours.

Step1: Create a VBS file using following founction
Function RecoveryFunction1(Object, Method, Arguments,
retVal)

'Find the Test Folder Path
Set qtApp = CreateObject("QuickTest.Application")
testpath = qtApp.Folders.item(1)
'stores the image inside the test folder
image_name= testpath &"\imagename.png"
Desktop.CaptureBitmap image_name
End Function

Step2: Go to Recovery manager
step3: select "On Any error" or select u r own option
Step4: select function to call
step5: call the above mentioned file

Rest QTP will do it for you

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Plz Explain How to access Or Store Script from VSS? Explain Real time work (qtp) where you store folders and next to how to you access that folders and how you maintain folders in VSS ? What are the Menu's in VSS? Suppose in Manual, by using Checkin Checkout u can access documents. how you access in QTp REal time?

1585


How to capture a window in QTP?

1534


How to remove the associated function library?

537


How can you give wait up to 10 seconds in qtp?

598


How does you pass optional arguments in qtp?

569






How you will rate urself in QTP in the range of 0 to 5

1755


can any body give the banking domain concepts/links

3642


Where we use data driver in qtp?

617


In qtp, how you can remove the spaces from string?

555


How to carry out bit map check points in QTP

1772


descriptive program for a yahoo mail that is in yahoo mail suppose check box mailid subject assume it is like this format all things are in webtable the question is suppose some mail ids are there in that mailids i want to select the check box wich is before a@gmail.com and after that i want to click on delete button

1814


What is meant by Output Value in UFT?

571


Hello Everyone, Please provide me the practical example of business component concept of QTP.Like how to create business component,how to connect the quality center etc.... Thanks in advance, Gaytri

1419


In qtp, how you can exit for loop?

533


Is it possible to call from one action to another action in qtp?

574