Forum Discussion
AlexanderM
14 years agoStaff
Hello Adam,
You don't need to convert your keyword test to a script. Instead, handle the command line parameters in a separate script procedure, and call this procedure from your keyword test using the Run Script Routine operation.
The Pass parameters via the command line "How To" article describes how to process command line parameters. As you see, the parameters are processed and posted to the Test Log within the ProcessCommandLineArgument procedure. Instead of posting the parameters to the Test Log, you can create project variables for them and initialize the variables within the ProcessCommandLineArgument procedure. For example, suppose that you have a project variable called fileName and you need to initialize it with the FileName command line parameter:
function ProcessCommandLineArgument(arg)
{
var items;
items = arg.split("=");
if(items.length != 2)
{
return;
}
switch(aqString.ToLower(aqString.Trim(items[0])))
{
case "FileName":
Project.Variables.fileName = aqString.Trim(items[1]);
break;
}
}
After that, you will be able to use the Project.Variables.fileName variable in your keyword test.
Related Content
- 6 years ago
- 6 years ago
Recent Discussions
- 18 hours ago
- 7 days ago
- 10 days ago