通过.vbs到QTP测试的测试参数



如何从QTP中启动测试的.vbs文件中获得测试参数?我能够在没有任何输入参数的情况下从.vbs文件运行我的测试,但是我似乎找不到一种方法将我的参数从文件中获取到测试。

到目前为止我写的是:

Set qtp = CreateObject("QuickTest.Application")
'Launch QTP
qtp.Launch
'Set QTP visible
qtp.Visible = True
'Run Mode - Fast
qtp.Options.Run.RunMode = "Fast"
'View Results - True
qtp.Options.Run.ViewResults = True
'Open the test
qtp.open "C:MYTEST", True
Set test = qtp.Test
Set params = test.ParameterDefinitions.GetParameters()
parameter1 = "par1"
parameter2 = "par2"
params.Item(par1).Value = "This is my first parameter"
params.Item(par2).Value = "This is my second parameter"
Set qtpResultsLocation = CreateObject("QuickTest.RunResultsOptions")
qtpResultsLocation.ResultsLocation = "C:SOMERESULTSFOLDER"
test.Run qtpResultsLocation
test.Close
Msgbox("Closed test.. closing application")
qtp.quit

我觉得需要一些test.ParameterDefinitions.SetParameters(),但这是我在网上找到的所有。

test.Run qtpResultsLocation实际上没有传入参数。我需要写test.Run qtpResultsLocation, True, params

最新更新