Forum Discussion

jr348's avatar
jr348
Contributor
4 years ago
Solved

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 o...
  • AlexKaras's avatar
    AlexKaras
    4 years ago

    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);