(二十四)QTP截屏

一、CaptureBitmap方法的使用【截整个桌面】
功能:Saves a screen capture of the object as a .png or .bmp image, depending on the specified file extension.

Desktop.CaptureBitmap Filename,[OverrideExisting]

应用:当Reporter.ReportEvent测试步骤为失败时,可以将截屏图片显示在步骤中,便于测试结果的分析

 Desktop.CaptureBitmap "error.png",True
 Reporter.ReportEvent micFail ,"日期是否为空","日期不为空","error.png"

二、对象截图
将Desktop改为Object

posted @ 2018-06-16 14:49  测试开发分享站  阅读(101)  评论(0编辑  收藏  举报