jr348
5 years agoContributor
Executing a test item or keyword test from script, by name or index in a variable
Does anyone know if there is any way to run a Keyword or Test Item from code with a variable name or index?
I could not find any run methods associated with either.
The only way I can think of is to have a humongous Select statement specifying the individual keyword tests.
That's far from ideal from a maintenance point of view.
The reason for it allow a random test item to be run.
Hi,
eval() or evaluate() function (whatever is provided by scripting language your project is based on) might work for you.
Sample untested pseudocode:
var strTestName = 'Check_Pass';
var strTestString = 'KeywordTests.' + strTestName + '.Run();';
evaluate(strTestString);