Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Snapshots - Test Results
#1
Rolleyes 
Hi Ankur,

I would like to check with you on this, How can we take a snapshot for every statement we mention in a script and store it in a specific location. Any idea on this?

Thanks,
Bhadra.
Reply
#2
C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\collections\Action0\SnapShots
Here collections name is the project name just open the location at ur end


Regards
Thomas
Reply
#3
Hi Thomas, Thanks for your reply,

Under Action0 of my test results does not have snapshots folder, thats the issue. Please suggest if you have any other idea.
Reply
#4
if the snapshots are not working i will send a code capturing screenshots where ever u want it contains functions should be registered at the start of script and capture screenshot line for capturing the snapshot of the script in image form just wait i will send that in next post



With Regards
Thomas Vinod

Reply
#5
Thanks man:-) I am waiting for your reply.
Reply
#6
you should start with following code
Code:
RegisterUserFunc "Page", "CaptureScreenshot", "CaptureScreenshot" RegisterUserFunc "Browser", "CaptureScreenshot", "CaptureScreenshot" RegisterUserFunc "Frame", "CaptureScreenshot", "CaptureScreenshot" RegisterUserFunc "Dialog", "CaptureScreenshot", "CaptureScreenshot" RegisterUserFunc "swfWindow", "CaptureScreenshot", "CaptureScreenshot"

use the following line where you want take screenshot or snapshot

Code:
Browser("micclass:=Browser").Page("micclass:=Page").CaptureScreenshot micPass, "<h4 align = ""Center"">Page SuccessFully Displayed</h4>"

The below code is a library file. Add the library file to the script

Code:
Public Sub CaptureScreenshot( ByRef Sender, ByVal micStatus, ByVal descriptionStr ) Dim dateTimeNow, fileNameStr, divDesc, caption Dim dicMetaDescription, qtp dateTimeNow = DotNetFactory.CreateInstance( "System.DateTime" ).Now.ToString( "ddMMyyHHmmss" ) fileNameStr = Reporter.ReportPath & "\" & dateTimeNow & ".png" Set qtp = CreateObject( "QuickTest.Application" ) qtp.Visible = False Wait 0, 500 If IsObject( sender ) Then Sender.CaptureBitmap fileNameStr, True caption = Sender.ToString & " - Capture Bitmap" Else Desktop.CaptureBitmap fileNameStr, True caption = "Desktop - Capture Bitmap" End If qtp.Visible = True divDesc = "<table align='center' border='5' cellpadding='1' cellspacing='1' width='100%' title='" & fileNameStr & "' frame='hsides'>" & _ "<caption>" & caption & "</caption>" & _ "<thead><tr><th>Application Exception Description</th></tr></thead>" & _ "<tfoot><tr><td align='center'><img border='2px' src='" & fileNameStr & "' /></td></tr></tfoot>" & _ "<tbody><tr><td>" & descriptionStr & "</td></tr></tbody></table>" Set dicMetaDescription = CreateObject( "Scripting.Dictionary" ) dicMetaDescription( "Status" ) = micStatus dicMetaDescription( "PlainTextNodeName" ) = "ApplicationException" dicMetaDescription( "StepHtmlInfo" ) = "<DIV align=center>" & divDesc & "</DIV>" dicMetaDescription( "DllIconIndex" ) = 205 dicMetaDescription( "DllIconSelIndex" ) = 205 dicMetaDescription( "DllPAth" ) = EnVironment( "ProductDir" ) & "\bin\ContextManager.dll" Call Reporter.LogEvent( "User", dicMetaDescription, Reporter.GetContext ) dicMetaDescription("User") = EnVironment ("dicMetaDescription") dicM End Sub

Bhadra I am sure the code will work because i used it in so many projects
Reply
#7
I dont want to keep any statement like capture snapshot, just how it displays in results window for every statement in the script, the same way i need. Is it possible?
Reply
#8
Hi friend,
may i know the difference between Desktop.CaptureBitmap and capture screenshot?
Reply
#9
@ 'Bhadra'


The Capture snapshot statement is used for displaying the screenshot in the results file. If you do not want to use use the different name for the function in the library and use the same name in the in the script

@ 'Sathiya'

There is difference i used the capture screenshot as name of the function in the library so i used the same thing in the script
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  capture screenshot using html code and view in QTP Test results Bhuvan 3 7,911 07-19-2013, 02:38 PM
Last Post: Bhuvan
  Get the Parent Folder name in Test Plan for a Test from Test Lab using QTP godsown 0 6,441 09-29-2011, 04:55 PM
Last Post: godsown
  how to export test results from QTP to QC uma87 5 11,515 09-29-2011, 03:35 PM
Last Post: uma87
  Changing the Default location for test results when using Test Batch Runner tool pointguard888 3 11,456 12-29-2009, 04:31 PM
Last Post: pointguard888
  QTP results in QC test lab Desh 3 7,429 10-09-2009, 12:12 PM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 1 Guest(s)