Please ensure to include your code between [code][/code] tags while asking or replying to questions.

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Capture screen shot for unexpected Errors.

08-10-2011, 02:23 PM
Post: #1
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago Capture screen shot for unexpected Errors.

Hi,

While running my tests, i get some unexpected Errors like " Error found click here to go back " . for this situation i added a recovery senario. but my requirement is can i capture or make a note of such errors to confirm that error has occured/exists . Also is there any option to check after which step it occured?
Find all posts by this user
Quote this message in a reply
08-10-2011, 02:31 PM
Post: #2
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
U can capture the screen shot for the error.
Use this in the recovery scenario u had created, and save at desired location.

Code:
Desktop.CaptureBitmap(Imagename,True)

Correct me if wrong

Regards,
Sankalp
Find all posts by this user
Quote this message in a reply
08-10-2011, 02:49 PM
Post: #3
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
If i Write this line "Desktop.CaptureBitmap(Imagename,True)" at the start or end of the script will it capture all the errors and save in required loaction or i have define this every time through out the script?
Image name here is the one which we save in recovary scenario?
Find all posts by this user
Quote this message in a reply
08-10-2011, 02:53 PM
Post: #4
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
Desktop.CaptureBitmap(Imagename,True) will take the screen shot of the current active screen.
If its an error msg box it will capture it.
So its better 2 use it in recovery scenario.
When error occurs recovery scenario will triggers and this will capture the screen shot of the error.

Correct me if wrong

Regards,
Sankalp
Find all posts by this user
Quote this message in a reply
01-07-2012, 02:50 AM (This post was last modified: 01-07-2012 02:51 AM by akankhyap@yahoo.co.in.)
Post: #5
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
HI,
The method suggested by you to include the screenshot code in the function invoked by recovery scenario is just taking the screenshot of the QTp window without the runtime error window.
I am unable to figure out how to take the screenshot of the runtime error window (thrown due to object identification failing) and save it in a location. I am able to invoke my recovery scenario and call the function (below is the code for the function called by the recovery scenario):

Code:
Function RecoveryFunction1(Object, Method, Arguments, retVal)

path_error_file="C:\automation\qtp_screenshot\screenshot_app.png"
Desktop.CaptureBitmap path_error_file,True
Reporter.ReportEvent micFail,"Recovery scenario invoked","Recovery scenario invoked due to runtime error", path_error_file
End Function


But unfortunately its not takeing the screenshot of the runtime error window.
Can anyone pls help!!!
Thanks
Akankhya
Find all posts by this user
Quote this message in a reply
01-07-2012, 10:17 AM
Post: #6
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
Go to tools--->options--->Run-->ScreenCapture then select the check box "Save still image captures to result" and choose "for errors and warnings" in dropdown
you will then see the Error snapshot in the result file generated.
Find all posts by this user
Quote this message in a reply
Yesterday, 02:00 PM
Post: #7
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
hiii.
I am facing same problem.
I want application screenshot along with error message that QTP/UFT popup showing(screenshot of error message)
Please help me
Thank you
Find all posts by this user
Quote this message in a reply
Today, 02:34 PM
Post: #8
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
@ ravi.gajul

Not showing error popup
Only showing application screenshot
Find all posts by this user
Quote this message in a reply
Today, 03:19 PM
Post: #9
Solved: 1 Year, 2 Months, 3 Weeks, 3 Days, 7 Hours, 11 Minutes, 37 Seconds ago RE: Capture screen shot for unexpected Errors.
I doubt in your case whether this would work.This is mainly for object based errors and checkpoints.However, if you are using QTP 9.5 or above, you have an option to save the entire test run as a movie. It definitely is an overhead in terms of space and performance but it really helps when debugging becomes a nightmare.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Using QTP to capture screen shot ravi.gajul 7 16,648 08-28-2012 02:52 PM
Last Post: vinod123
  Run time errors in SAP when QTP running dverlaque 3 2,053 07-25-2012 11:26 AM
Last Post: Ankesh
  Unexpected file Format vinayaksarode 3 3,014 01-30-2012 09:49 PM
Last Post: ravi.gajul
  Getting unexpected Pop up message while using Datatable.import Punam K 2 1,844 08-20-2011 08:48 PM
Last Post: Arul
Shy Attach screen shot to QC with QTP test run in QC santu.qtp 2 3,442 03-22-2011 03:28 PM
Last Post: chandu



User(s) browsing this thread: 1 Guest(s)