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

How can I find out the cursor position through QTP suppose I am keep tabbing(Pressing the tab key continuously) and stoped at a position Now I want to find out where the cursor position is

6298


What VBScript operators, functions, and statements do you use in QuickTest Professional?

2163


QTP script is not working on other's machine..

1531


am not having intrest in coding lang like c c++ java etc can i choose Testing tools as my carrier and please suggest me which tool is good (suitable for me)

1273


What is meant by a Check Point in UFT? Also, explain the applicable Check Points.

701






Can anybody let me know how to test the Drag and drop feature of the column in a .net application...eg..i hav to test the drag and drog feature of a table(swftable) in a application..plze help!!

1742


What is object repository in qtp?

556


How to replay a script in qtp?

610


terminal services client

1786


Tell me about your project? please help me how to tell about insurance project

1522


What is the significance of “action 0” in qtp?

561


what is the diff b/w assistive and mandatary rules of object repository in QTP???

1599


Hi Friends... By using QTP , can we test .net products...and that product supports different languages.. thanx in advance..

4125


Hi! Using Descriptive Programming How do we get Parent object for an object by writing script(DP). Say, i want to get a parent object for a "Link" in a web page by writing script in Descriptive Programming.

2093


What is the difference between run time object and test object?

571