Forum Discussion
Now I can see what you are trying to do.
That looks like something you should ask Support about. Seems like there ought to be a variable choice in there as well.
Here's the support link
https://support.smartbear.com/testcomplete/message
a ticket has already been opened I will update the community once they reply
Still waiting for TC to answer but it looks like this is not possible.
You can either
- pass in a variable to a NON OPTIONAL parameter
- test for an empty parameter and assign it a variable
https://support.smartbear.com/testcomplete/docs/keyword-testing/editor/parameters.html
https://support.smartbear.com/testcomplete/docs/keyword-testing/editor/variables.html
Parameter default value
Optional Specifies whether the parameter is optional, that is, if it can be omitted when the test is called from another test. Optional parameters must have a default value. Optional parameters always follow the required parameters in the parameter list and cannot be mixed with them. So, if a parameter is optional, all the subsequent parameters must also be optional. Marsha_R I have closed the TC ticket as they didn't understand the question
I think my solution above is the best approach
I won't bother to raise this as a feature request at this time - it took me lots of messages for them to NOT understand what you grasped in 1
Thanks anyway
- A_Roskoshnyi4 years agoContributor
You can add a new table variable to your KW and fill it with values. Then, in KW itself, give the condition "if then" where to check the value of the parameter "URL" If no url is specified, take a value from the variable as default value.
I myself often run KW tests with default parameters and there are different solutions for this. I'm just offering a one of ideas.