|
一个很简单的例子,在一个 .vbs 文件中写入:
Dim qtApp ,pDefColl ,rtParams,rtParam
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
qtApp.Open "C:\Test1"
Set pDefColl = qtApp.Test.ParameterDefinitions
Set rtParams = pDefColl.GetParameters()
Set rtParam = rtParams.Item("InParam1")
rtParam.Value = "kevin"
qtApp.Test.Run , True, rtParams
MsgBox rtParams.Item("OutParam1").Value
此vbs脚本就能自动调用QTP并打开"C:\Test1"脚本然后执行,并将VBS中的值“kevin”传入Test1中,当然Test1也要进行相应的Test及Action输入输出参数设置,具体可参见songfun老大Blog中的文章:http://www.51testing.com/?35/action_viewspace_itemid_10695.html |
|