mfoster711
11 years agoRegular Contributor
Get Keyword Test Name from script code?
Is this possible:
I want to use the "Run Script Routine" from a Keyword test and have it call a generic function called "MyTestFunction". Within MyTestFunction, I want to be able to programmatically determine the name of the Keyword test that called the function and then use that name to determine and loop through all the Keyword test variables.
For example:
Function MyTestFunction()
KeywordTestName = GetCallingKeywordTestName???
For i = 0 to KeywordTestName.VariablesCount
VarName = KeywordTestName.Variables.GetVariableName(i)
'Now do what I want with the VarName
Next
End Function
If not possible, any alternative ideas??
I am using VBScript.
I want to use the "Run Script Routine" from a Keyword test and have it call a generic function called "MyTestFunction". Within MyTestFunction, I want to be able to programmatically determine the name of the Keyword test that called the function and then use that name to determine and loop through all the Keyword test variables.
For example:
Function MyTestFunction()
KeywordTestName = GetCallingKeywordTestName???
For i = 0 to KeywordTestName.VariablesCount
VarName = KeywordTestName.Variables.GetVariableName(i)
'Now do what I want with the VarName
Next
End Function
If not possible, any alternative ideas??
I am using VBScript.
- oops a typo - for your example it would be
eval("KeywordTests." & KeywordTests.ThisTest.Variables.sTestName & ".Variables.GetVariableName(i)")