Showing results for 
Search instead for 
Did you mean: 

Script Routine Comments/Default values

New Contributor

Script Routine Comments/Default values

I'm curious if it is possible to add comments or default values for script routines.


Also if you can make your script routines use an enum so parameters could be picked from a dropdown similar to pmLower in the example. It looks like this should be possible but I just can't find how to do it.

I have a function like:

def generic_function(param1="A String", 
    # do the thing

but when I go to run script routine in the keyword test it just defaults all the parameters to None





Community Hero

Re: Script Routine Comments/Default values

@tristaanogre Any ideas about this?

Community Hero

Re: Script Routine Comments/Default values

In JavaScript this works:


function defaultParams(parm1 = 'test', param2 = 3){

2019-01-31 13_34_42-Operation Parameters.png


So, this tells me that the problem is not in TestComplete necessarily.  The code you posted is in Python.  I'm not 100% certain what the proper answer is for Python script.  But I do know that, at least default "basic" data types work.  An enumerated data like a key/value pair... I don't think that will work.


If you WANT to go that route...instead of a script routine, create a Keyword Operation Script Extension with a custom User Form to prompt for parameters where you can set up the pre-defined values and drop downs.  See



Robert Martin
[Hall of Fame]
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
Vegas Thrill Rider
Extensions available
Community Manager

Re: Script Routine Comments/Default values

Hi @mhowerto,


It is strange that the same behavior works for JavaScript routines, and it doesn't work for a Python one.

I've reported this behavior to our R&D team. 

Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete


How to execute remote test and obtain results via Test Runner REST API


Comparing content of HTML table with Excel file data


Compare HTML table with Excel file and correct data in the file

Top Kudoed Authors