SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Advanced Member gencke's Avatar
    Join Date
    Feb 2008
    Location
    Seattle, Washington, United States
    Posts
    531
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Embedded screen shot

    I borrowed some code to embed a screenshot into the execution report. It works fine when I run QTP stand alone, but when I run from QC, the image shows as a red X

    Thanks
    Patience is like bread I say.... I ran out of that yesterday.

  2. #2
    Advanced Member gencke's Avatar
    Join Date
    Feb 2008
    Location
    Seattle, Washington, United States
    Posts
    531
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Embedded screen shot

    Here is the code

    RegisterUserFunc "Page", "CaptureScreenshot", "CaptureScreenshot"
    RegisterUserFunc "Browser", "CaptureScreenshot", "CaptureScreenshot"
    RegisterUserFunc "Frame", "CaptureScreenshot", "CaptureScreenshot"
    RegisterUserFunc "Dialog", "CaptureScreenshot", "CaptureScreenshot"
    RegisterUserFunc "swfWindow", "CaptureScreenshot", "CaptureScreenshot"
    'Description Captures Desktop or bit map e.g. Call CaptureScreenshot( vbNullString, micinfo, "Screenshot captured after error") for DeskTop
    Public Function CaptureScreenshot( ByRef obj, ByVal micStatus, ByVal msg )
    Dim fileNameStr, titleMsg, detailMsg
    fileNameStr = Reporter.ReportPath & "\" & DotnetFactory.CreateInstance( "System.DateTime" ).Now.ToString( "ddMMyyHHmmss" ) & ".png"
    ' ** Capturing Desktop ot Object
    If IsObject( obj ) Then
    obj.CaptureBitmap fileNameStr, True
    Else
    Desktop.CaptureBitmap fileNameStr, True
    End If
    titleMsg = "Captured Screenshot: "
    detailMsg = "<<p align='left'>" & msg & "</p><br/><img src='" & fileNAmeStr & "'>;"
    Reporter.ReportEvent micStatus, titleMsg, detailMsg
    End Function
    Patience is like bread I say.... I ran out of that yesterday.

  3. #3
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: Embedded screen shot

    This is a workaround and will not work with QC

  4. #4
    Advanced Member gencke's Avatar
    Join Date
    Feb 2008
    Location
    Seattle, Washington, United States
    Posts
    531
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Embedded screen shot

    Darn, well at least I have the saved screen shot
    Patience is like bread I say.... I ran out of that yesterday.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:49 PM.

Copyright BetaSoft Inc.