QTP运行完之后如何自动在运行一个脚本

来源:百度知道 编辑:UC知道 时间:2024/06/01 03:38:59
QTP执行完之后怎样自动在执行一个脚本啊?
我的脚本为temp.vbs
内容是:
dim WshShell
dim s

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run "cmd"
WshShell.AppActivate"c:\windows\system32\cmd.exe"
WScript.Sleep 200

WshShell.SendKeys"ftp localhost"
WshShell.SendKeys"{ENTER}"
WshShell.AppActivate"ftp.exe "
WshShell.SendKeys"toptea"
WshShell.SendKeys"{ENTER}"
WshShell.SendKeys"toptea"
WshShell.SendKeys"{ENTER}"

'读文件
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("D:\QTP\Tests\ChinaMobileBOMC\put.txt", 1)
s = ts.ReadLine
ts.Close

'在远程生成文件夹并改变远程目录到新建文件夹下
WshShell.SendKeys"mkdir "+s
WshShell.SendKeys"{ENTER}"
WshShell.SendKe

把脚本保存成个a.vbs文件
在QTP脚本的最后面,加一句systemutil.run 路径+ "a.vbs"
systemutil是QTP的一个内置对象,可以启动运行application或者windows脚本