SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Apr 2012
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Take screenshots between steps.

    Hello there,

    Im new in qtp and vbscript, i need help about capturing screenshots between test steps and saving them into a specific folder (it isnt a web browser, but a .net application so i guess i should use VK_SNAPSHOT, but i have no idea how to do the full process). I was searching for some information but i didnt find information about this.

    Thank you very much for your help!

  2. #2
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Your Post title violates the Forum guidelines. Refer Forum Guidelines.

    Have you searched this forum?
    Rajkumar

  3. #3
    Member
    Join Date
    Apr 2012
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Yes i did, and obviously that's why i ask for help as i said at the end of my post.

    Anyways i changed the title.

  4. #4
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Not sure what keywords you had used. I used the keyword 'Capture Screenshot QTP' & I could see several results.

    Anyways, you can use the Desktop.CaptureBitmap object.
    Rajkumar

  5. #5
    Member
    Join Date
    Apr 2012
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Thx you for your help.

    So should i use it like..
    Desktop.CaptureBitmap "C:\Screenshot.bmp"

    I've tried but it doesnt works.

  6. #6
    Moderator
    Join Date
    Oct 2010
    Location
    Norway
    Posts
    3,265
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Try C:\Temp\Screenshot.bmp.
    May be you don't have access to save it in the root.
    Rajkumar

  7. #7
    Member
    Join Date
    Apr 2012
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Ok this time worked perfectly, thank you a lot Rajkumar [img]/images/graemlins/smile.gif[/img]

    I have a last question:

    I know already that is possible to repeat an action such taking screenshot with Loop function, but, it is possible to repeat automatically Desktop.CaptureBitmap "C:\Temp\Screenshot.bmp"
    with different screenshot names so i dont need to write them?
    At the end of the execution i should have severals screenshots named like "screenshot1" "screenshot2" etc...

    Thank you again!

  8. #8
    Member
    Join Date
    May 2009
    Posts
    162
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Assuming you have N test steps

    <font class="small">Code:</font><hr /><pre>
    For i = 0 to N
    'Your code here
    strTeststrFileName = "C:\Temp\Screenshot" &amp; i &amp; ".bmp"
    Desktop.CaptureBitmap strTeststrFileName
    Next i
    </pre><hr />

  9. #9
    Member
    Join Date
    Apr 2012
    Posts
    53
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Help please! (screenshots)

    Ok, thank you everyone for all! [img]/images/graemlins/smile.gif[/img]

 

 

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 10.71%
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 08:04 PM.

Copyright BetaSoft Inc.