steve_hall
12 years agoContributor
TestComplete command line, and functions with parameters
Hi All,
I'm trying to work out how, from the command line I can:
Start TC, pointing to suite, project, script, and function, where the function takes a string parameter.
For easy explanation purposes imagine a test function:
function test2(msgtxt)
{
MessageDlg(msgtxt,0,0,0);
}
I want to be able to do something like:
TestComplete.exe mysuite.pjs /r /p:myproject /u:scriptname /rt:test2("Hi Steve!") /exit /ns
But this produces 2 TC error dialogs: "The command line is invalid", and then "The command line is invalid. The test cannot be found".
PLEASE tell me what I am trying to do CAN be done? If so, how? The only alternative I can think of is setting "Hi Steve" to some temporary system env variable, and getting TC function to pick that sys var up... But that seems rather "over the top" as solutions go?
Thanks
Steve
- I think you should create another function that will parse the TestComplete's command line arguments, and you will specify its name in command line along with the desired parameter value using the custom command line argument.
See example of parsing command line arguments here: TestComplete Command Line (ParamStr, ParamCount functions).