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 do u manipulating INI, DLL and / or registry files in support of your test environment? actually what do u mean by INI and DLL or registry files. plzzz its urgent do answer

1420


What is the difference between Keyword Driven test and Data Driven test?

1752


What is keyword view?

547


Hi, i run scripts in one machine those r passed.when i run the scripts in client side those r failed.Give me such a scenario when ever u faced?

1489


What is throw Object?

1517






can u explain relative path architecture framework in qtp?

1545


what is the difference btn risks & Therads in the Test plan documentation?

1560


Hi, How Accessibility checkpoint in QTP can be implemented in the test script?

1576


Hi, Can we open a test in qtp10 which is saved in qtp 9.2?

1407


How do I generate Test Results window using descriptive method ( run time ) after my test execution process? Please have a look of my below code. ========================================================= Dim qtApp Dim qtTest Dim qtResultsOpt Set qtApp = CreateObject("QuickTest.Application") qtApp.Launch qtApp.Visible = True qtApp.Options.Run.CaptureForTestResults = "Always" qtApp.Options.Run.RunMode = "Fast" qtApp.Options.Run.ViewResults = True qtApp.Open "C:\Automation\Example", True Set qtTest = qtApp.Test qtTest.Settings.Run.OnError = "NextStep" Set qtResultsOpt = CreateObject ("QuickTest.RunResultsOptions") qtResultsOpt.ResultsLocation = "C:\Automation\Example\Res1" qtTest.Run qtResultsOpt MsgBox qtTest.LastRunResults.Status qtTest.Close Set qtResultsOpt = Nothing Set qtTest = Nothing Set qtApp = Nothing ========================================================== This code is working fine, but Test Result window is not displaying after execution. Anybody can please help me regading the same. Thanks Akshaya Madali Capgemini India Pvt Ltd 9823213538

3580


Is any limitation to xml checkpoints?

535


How to do call a output parameter from one action to another action??/

1844


What is difference between Recording time object identification and Run time (Execution) time.

972


What do you mean by iteration?

604


How can you send user defined messages to test report?

566