5

TestComplete を使用しています。スクリーンショットをキャプチャして、特定のフォルダーに配置する必要があります。VBScript を使用してこれを行う方法は?

4

2 に答える 2

3

To capture a desktop screenshot, use the Sys.Desktop.Picture method. To save the resulting image to a file, use its SaveToFile method:

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

Alternatively, you can turn on the Test Visualizer to automatically capture screenshots for your test actions.

于 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 に答える