5

我正在使用TestComplete。我需要截取屏幕截图并将其放在特定文件夹中。如何使用 VBScript 做到这一点?

4

2 回答 2

3

要捕获桌面屏幕截图,请使用该Sys.Desktop.Picture方法。要将生成的图像保存到文件中,请使用其SaveToFile方法:

Sys.Desktop.Picture.SaveToFile "E:\screenshot.png"

或者,您可以打开Test Visualizer以自动捕获测试操作的屏幕截图。

于 2013-03-05T09:00:27.753 回答
0
Function CaptureScreenShot(ScreenshotPath )  
  'Generate Name of the Image 
  strimgFileName="Img\Img" & Day(Date)& Month(Date) & Year(Date) & Hour(Now) & Minute(Now) & Second(Now) &".jpg"  
  strImgFile= ScreenshotPath & strimgFileName   
  'Capture failure Screen shot 
  Set objPic = Sys.Desktop.Picture()  
  'Save captured Screen shot 
  ExecutionStatus = objPic.SaveToFile(strImgFile)  
  'Return Captured image name
  CaptureScreenShot=".\" & strimgFileName  
End Function    
于 2014-08-20T07:17:05.683 回答