Forum Discussion
I'm not quite sure what you are asking, so I have a few answers 🙂
Can you use a variable as a parameter value, yes.
Can you give a variable a default value, yes.
Can you have the test default the parameter value "if I give you a value, use that, otherwise use the default", no.
Show us what you tried that didn't work and we can help fix it. It's usually easier and quicker to get you an answer if you share specifics.
The parameter input will be URL 1, 2 or 3 (from a variable)
I can insert the var in the execution plan and all is good
but I would like the default/fallback value to be URL3
can I do this, I don't appear to have the option to input this here
- Marsha_R4 years agoModerator
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
- Lee_M4 years agoCommunity Hero
a ticket has already been opened I will update the community once they reply
- Lee_M4 years agoCommunity Hero
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.
Related Content
- 4 years ago
- 6 years ago
- 7 years ago
Recent Discussions
- 4 hours ago
- 6 days ago
- 10 days ago