sufen2315 发表于 2009-4-16 09:09:00

QTP桌面截图函数

desktop.CaptureBitmap( "C:\Program Files\HP\QuickTest Professional\Tests\ ****.bmp"),Ture
每次保存的名字都一样,能不能把名字用运行时间返回?
要做如何修改?

dreamever 发表于 2009-4-16 09:29:42

如果是文件名的话,可以写成如下形式:
"C:\Program Files\HP\QuickTest Professional\Tests\" & now &".bmp"

blueeagle9999 发表于 2009-4-16 09:35:37

nowstr=now
nowstr=replace(nowstr,"-","")'去掉- : 和空格字符
nowstr=replace(nowstr,":","")
nowstr=replace(nowstr," ","")

desktop.CaptureBitmap( "C:\Program Files\HP\QuickTest Professional\Tests\ "&nowstr&".bmp"),Ture

peterz 发表于 2009-4-16 09:52:16

dim tmp
tmp=hour(time)&minute(time)&second(time)

desktop.CaptureBitmap( "C:\Program Files\HP\QuickTest Professional\Tests\ "&tmp&".bmp"),Ture

sufen2315 发表于 2009-4-16 10:09:23

谢谢大家!我试试!
页: [1]
查看完整版本: QTP桌面截图函数