Search code examples
vbscripthp-quality-center

how to get current VAPI XP Test ID using VBScript?


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?


Solution

  • 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 !