Question

I have a piece of code in VB Script to add test parameters

Dim supportParamTest
Set supportParamTest = TDConnection.TestFactory.Item(1404)
Set testParamsFactory = supportParamTest.TestParameterFactory
Set parameter = testParamsFactory.AddItem(Null)
parameter.Name   ="Name"
parameter.Description = "desc"
parameter.Post

in line no : 2 TDConnection.TestFactory.Item(1404) here "1404" is hard coded test id , i.e the above code will add test parameters to test id 1404 Now i need to get the TestID of the current Test to make it generic

Can any one help me out?

Was it helpful?

Solution 2

Dim TestName 
Dim supportTests 
Set supportTests = TDConnection.TestFactory 
Set Test = TestFactory.Fields 
TestName = ID 
TDOutput.Print(TestName)

Successfully retrieves the current Test ID. It works !

OTHER TIPS

This is an old post, but in case anyone needs to know: In a VAPI script, the global ID is available from the start. No need to 'retrieve' anything. So answer from Ganeshja works, but only because ID was already available. The global variable ThisTest is available. So for the above question, it would make more sense to use: Set testParamsFactory = ThisTest.TestParameterFactory

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top