cancel
Showing results for 
Search instead for 
Did you mean: 

Where to write the Utility scripts to accept the command line arguments

New Contributor

Where to write the Utility scripts to accept the command line arguments

There is a script available to accept additional command line arguments provided by the user. I am not sure where to add that script in my Project. Is it to be added in a specific file or a separate section is there for such Utility functions?

 

The Utility script is available at this location: 

https://support.smartbear.com/viewarticle/9021/

 

 

Thanks,

Yusuf

2 REPLIES 2
Community Hero

Re: Where to write the Utility scripts to accept the command line arguments

You add it as a script routine in a script unit in TestComplete.  There's no specific "utility" section of TestComplete.  

The script as presented in that article simply demonstrates how to use the BuiltIn.ParamStr and BuiltIn.ParamCount methods of TestComplete to find and parse out values.  So, if you need to obtain a commandline parameter passed to TestComplete, you would adapt that script to find that parameter and value and then pass it along to whatever variable, method, or test that needs that value.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Where to write the Utility scripts to accept the command line arguments

I would try putting it in the "OnStartTest" event first.

 

Here's a screen shot of a function that runs when the application starts.

 

image.pngOnStart

It specifically says that it will run first when you run it from CLI so it should work.

image.png

 

 

 

 

February News
Top Kudoed Authors