How to pass variables to USEUNIT command to dynamically load external script units
In my test project, All my test scripts have a method named "Test()" which perform the test activity.
I am currently working on creating a Driver script which will read the names of the script files to be executed from an excel file and then invoke TestcaseName.Test() method for all the script names returned from the excel file.
scriptName = ... read script names one by one from excel ...
strCommand = scriptName + ".Test"
Runner.CallMethod(strCommand);
This snippet is being iterated for all the script names returned by the excel file.
Currently, using the Runner.CallMethod, I am conveniently able to eliminate the need for having a "//USEUNIT <scriptname>" call. Since the Runner.CallMethod is deprecated, I am looking for an alternative method to iterate executing the Test() method for all the script files.
To achieve that, I am thinking of approach where I call the USEUNIT at runtime with the specific script name as a parameter. However, I am not able to pass a variable as a parameter to USEUNIT command. Could any of the experts help me resolve this problem?
How do I achieve this:
var scriptName = "TestScript_TC01"
//USEUNIT scriptName
Regards, Dev