错误图片捕获

上一篇 / 下一篇  2011-12-09 16:38:26 / 个人分类:QTP进阶

object.CaptureBitmapFullFileName, [OverrideExisting]

object :一个测试对象

FullFileName:以.png 或.bmp存储的文件全称或绝对路径加全称

OverrideExisting:一个Boolean 值,设置图片是否会被覆盖

True:覆盖前一个图片

False(default) :不会覆盖以前的图片

 

示例一:

SubCaptureBitmap_Example()
'The following example uses the CaptureBitmap method to capture
'a screen shot of the No. of Passengers edit box. The file will
'automatically be saved to a different folder (the test run
'results folder) in each test run.

Browser("Mercury Tours").Page("Find Flights").WebEdit("numPassengers").CaptureBitmap"edit_4.bmp"

EndSub

示例二:

SubCaptureBitmap_Example()
'The following example uses the CaptureBitmap method to capture
'a screen shot of the No. of Passengers edit box and save the
'image to an absolute path. Each time the CaptureBitmap statement
'runs, QuickTest overwrites the previous image with the new one.

Browser("Mercury Tours").Page("Find Flights").WebEdit("numPassengers").CaptureBitmap"C:\ScreenCaps\edit_4.bmp",True

EndSub

示例三:

SubCaptureBitmap_Example()
'The following example uses the CaptureBitmap method to capture an image, after which the image is
'uploaded to the database.

Browser("Browser").Page("The official site for").Image("PURE NEW ZEALAND").CaptureBitmap ("c:\NewZealand.bmp")
UploadImageToDataBase ("c:\NewZealand.bmp")

EndSub


TAG:

 

评分:0

我来说两句

Open Toolbar