我是VBScript新手,目前我已经创建了一个新的VAPI-XP测试>测试计划,创建VAPI测试后,我已经使用测试参数选项卡向我的测试添加了参数,现在在测试脚本(VBSCRIPT)选项卡下,我需要获取添加的参数
谁能帮帮我!请给我
VBSCRIPT
Sub Test_Main(Debug, CurrentTestSet, CurrentTSTest, CurrentRun)
On Error Resume Next
TDOutput.Clear
return = XTools.run("D:\ACoE RnD Team\Eclipse Workspace\SilkTest\InitScript.bat","Scenario1 TC1 Regression RunAllIterations 0 0 firefox 3.6 WINDOWS") 我需要把我的测试参数带到Xtools.run,而不是Scenario1,TC1,回归...
我无法使用参数,因为它已被弃用,而且我不知道要使用TestParameterFactory对象。
//从测试脚本添加参数的示例vbscript,但不起作用
Set testParamsFactory = supportParamTest.TestParameterFactory
Set parameter = testParamsFactory.AddItem(Null)
parameter.Name = "name"
parameter.Description = "desc"
parameter.Post有人能建议我使用CurrentTSTest obj获取参数吗?
发布于 2013-01-22 14:26:04
已成功从测试参数选项卡中检索到Default_Value参数
Set SetTestParameter = TestFactory.Item(intTestID)
Set TestParamsFactory = SetTestParameter.TestParameterFactory
Set IterateparameterValue = TestParamsFactory.NewList("")
for each IterateParam in gobjIterateparameterValue
ParamFieldDefaultValue = IterateParam.DefaultValue
TDOutput.Print (ParamFieldDefaultValue)
next它起作用了!不使用Test,只需传递当前CurrentTSTest ID (intTestID)即可访问参数选项卡
发布于 2013-01-08 23:48:59
你应该可以这样做:
Set aParam = CurrentTSTest
Set paramValueFct = aParam.ParameterValueFactory
Set lst = paramValueFct.NewList("")
For Each param In lst
With param
TDOutput.Print("Name: " & .Name & ", Value: " & .DefaultValue)
End With
Next不过,您的里程数可能会随DefaultValue格式的不同而不同。
https://stackoverflow.com/questions/13874563
复制相似问题