Micro Focus QTP (UFT) Forums

Full Version: Write a program to Capture Desktop Screen shot
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Write a program to Capture Desktop Screen shot

HI,

you can use the QTP in-built method "Desktop.CaptureBitmap"

Code:
Desktop.CaptureBitmap("SampleImage.bmp",True)
Let me know if you need any help
try the follwing in .vbs file......




Code:
Set oWordBasic = CreateObject("Word.Basic")

oWordBasic.SendKeys "{prtsc}"

oWordBasic.AppClose "Microsoft Word"

Set oWordBasic = Nothing

WScript.Sleep 2000

set WshShell = CreateObject("WScript.Shell")

WshShell.Run "mspaint"

WScript.Sleep 2000

set shl=createobject("shell.application")  

shl.MinimizeAll  

WScript.Sleep 1000

shl.UndoMinimizeAll

Set shl=Nothing

WScript.Sleep 1000

WshShell.AppActivate "untitled - Paint"

WScript.Sleep 1000


WshShell.SendKeys "^v"

WScript.Sleep 500


WshShell.SendKeys "^s"

WScript.Sleep 500

WshShell.SendKeys "c:\scrnshot.jpeg"

WScript.Sleep 500

WshShell.SendKeys "{ENTER}", True

Set WshShell=Nothing

WScript.Quit