实现代码:
path1="E:\UFT\APITest\APITest.st"
path= "C:\Program Files (x86)\HP\Unified Functional Testing\bin\UFT.exe"
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.run path1,1,true
TimeOut=10
StartTime=Now()
WScript.sleep 500
Do While DateDiff("s", StartTime, Now()) < TimeOut
WScript.sleep 50
MsgBox "no"
WshShell.appactivate("Unified Functional Testing")
If WshShell.appactivate("Unified Functional Testing")=true Then
WshShell.SendKeys "{ESC}"
Exit Do
End If
Loop
把run参数的true改成false,即可继续执行一下代码