51Testing软件测试论坛

标题: 同样的VB脚本报错。(以前执行时是好着的,不知道什么原因) [打印本页]

作者: SUPERWOMEN    时间: 2009-7-30 13:05
标题: 同样的VB脚本报错。(以前执行时是好着的,不知道什么原因)
以下脚本是参考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 ’”




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2