|
以下脚本是参考QTP自带的自动化对象模型帮助文档中的列子,很奇怪以前执行都好着呢,我今天执行就报错了,还去各位前辈给与指点,谢谢。脚本如下:
Dim qtApp ,pDefColl,pDef ,rtParams,rtParam
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
qtApp.Open "C:\dingjicaozou"
Set pDefColl = qtApp.Test.ParameterDefinitions
cnt = pDefColl.Count
msgbox cnt
Indx = 1
While Indx <= cnt
Set pDef = pDefColl.Item(Indx)
MsgBox "Param name: " & pDef.Name & "; Type: " & pDef.Type & "; InOut: " & pDef.InOut & "; Description: " & pDef.Description & "Default value: " & pDef.DefaultValue
Indx = Indx + 1
Wend
Set rtParams = pDefColl.GetParameters()
Set rtParam = rtParams.Item("InParam1")
rtParam.Value = "songfun"
qtApp.Test.Run , True, rtParams
MsgBox rtParams.Item("OutParam1").Value
执行脚本时报错“对象不支持此属性或方法‘Test.ParameterDefinitions ’” |
|