How to capture screen shots when an error occurs?

Answers were Sorted based on User's Feedback



How to capture screen shots when an error occurs?..

Answer / lak

Objectheirarchy.CaptureBitmap "path"

for ex

to capture any window

Window("Flight Reservation").CaptureBitmap "C:\pic1.bmp"

to capture combo box(tool)

Window("Flight Reservation").WinComboBox("Fly
From:").CaptureBitmap "C:\pic2.bmp"

This is used in QTP.

www.funandknowledge.blogspot.com

Is This Answer Correct ?    3 Yes 0 No

How to capture screen shots when an error occurs?..

Answer / uday kumar_anem

In QTP8.2, we can choose the run settings
Test -> settings -> Run tab -> set ON save image of desktop
when error occurs checkbox

In QTP 9.2, follow the below navigation:
Tools -> Options -> Run tab -> In the drop down list box "On
Error"(default) is selected for "Save step screen capture
to results"

And even we can also configure, whether we have to proceed
to next step or stop the test execution by following below
navigation:
File Menu -> Settings -> Run Tab -> Choose the required
action from the "Whenever an error occurs during run
session" drop down list box.

Is This Answer Correct ?    3 Yes 0 No

How to capture screen shots when an error occurs?..

Answer / 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

How to capture screen shots when an error occurs?..

Answer / ram.polavarapu

browser("").page("").webedit("").set"ram@yahoo.com"
browser("").page("").webedit("").set"fbnjvkjnbv"
browser("").page("").webbutton("signin").click
if browser("").page("").exist then
reporter.reportevent 0,"login","login is sucess"
else
browser("").page("").capturebitmap "b.bmp"
reporter.reportevent 1,"login","lgin is not sucess","b1.bmp"
end if

note->give the wrong psw ang you will get the result in
results window

Is This Answer Correct ?    0 Yes 0 No

How to capture screen shots when an error occurs?..

Answer / laxmi

i am unable to understand can you explain in detail

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More QTP Interview Questions

how to reverse a string with out using string or predefined function,ex:string is " i love india". the output should be like this "i evol aidni"

3 Answers   Aspire,


how do u import the test cases written in excel sheet to qtp? and how do u generate the script in qtp for the testcase in excel sheet? plzzzz do answer this question thanks in advance

4 Answers  


Associated files in QTP?

1 Answers  


why the smart identification is not there in WinRunner

1 Answers   DigiTech,


when will you do debug your script? and explain that process?

0 Answers   Covansys,






What are associated files in QTP?

2 Answers  


how to test use the quality control .how to verify the image verification

0 Answers   Wells Fargo,


how many test scripts we will write in qtp? very urgent. please??? Thanks in advance..

1 Answers   Mind Tree,


How to write test cases for web applications using QTP.plz write a sample test case to show how to write.urgently needed.thanks in advance..

4 Answers   IBM,


Is QTP Object Oriented language or Object Based language? What are the OOPS concepts it will support? Why it wont support all the OOPS concepts?

1 Answers   CTS,


How to call Datable values in the QTP program. exp: I have two parameters like Email id and Password this two i would like to add multiple entries in the datable to use it. What is the difference between Gobal/Action datatable

3 Answers  


How many ways return more then one value from function?

2 Answers   Ingram Micro,


Categories