|
我在桌面有两个vbs文件,hello.vbs和run.vbs,代码如下:
hello.vbs:
Sub hello
msgbox "hello"
End Sub
run.vbs:
Dim qtApp
Set qtApp = createObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
'Set Run Options
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
qtApp.Test.Settings.Resources.Libraries.RemoveAll
qtApp.Test.Settings.Resources.Libraries.Add "C:\Documents and Settings\liuf\桌面\hello.vbs"
qtApp.Test.SetAssociatedAddins(Array("Web","Visual Basic","ActiveX"))
qtApp.Test.Actions("Action1").SetScript "hello"
qtApp.Test.Run
我想通过run.vbs启动QTP再调用hello.vbs,最后打出hello,但是我运行的时候报错如截图:
是不是我的版本太低不支持SetScript方法,还是其他什么原因,我的版本是9.2.如果不支持,那么在较低的版本怎样实现这样的功能呢? |
|