QTP桌面截图函数
desktop.CaptureBitmap( "C:\Program Files\HP\QuickTest Professional\Tests\ ****.bmp"),Ture每次保存的名字都一样,能不能把名字用运行时间返回?
要做如何修改? 如果是文件名的话,可以写成如下形式:
"C:\Program Files\HP\QuickTest Professional\Tests\" & now &".bmp" nowstr=now
nowstr=replace(nowstr,"-","")'去掉- : 和空格字符
nowstr=replace(nowstr,":","")
nowstr=replace(nowstr," ","")
desktop.CaptureBitmap( "C:\Program Files\HP\QuickTest Professional\Tests\ "&nowstr&".bmp"),Ture dim tmp
tmp=hour(time)&minute(time)&second(time)
desktop.CaptureBitmap( "C:\Program Files\HP\QuickTest Professional\Tests\ "&tmp&".bmp"),Ture 谢谢大家!我试试!
页:
[1]