Prevent overriding default variables in sub tests

I am trying to figure out a way to use “default” variables within my subtests that do not force the parent test to pass some values when including the sub test.

Most of our testing revolves around our Dev environment, so I would like it to default to our dev environment. Perhaps I have a login Test, that has “login” parameters, then if the caller wants to override those parameters, perhaps for a QA test, they would just pass in those variables.

So the login test would have a dev url, and dev email, and a dev password.
If the test includes this “login” test, and does not pass any values, then I want the default values of the sub test used. Perhaps it’s a checkbox next to the parameters in the test that says Use default. If there is a datasource used or values are passed from the parent test, then use those values.

Right now, in the subtests, I’m having to do a “set x to y, if y is blank” for each parameter passed to the subtest, which creates much more overhead when creating the tests (and remembering to do this for each parameter).

This is really just to facilitate ease of use across the teams so that they can just grab a login test and include it without needing to know all the details for the test and having to have a whole bunch more parameters included in the parent test.

Hi @g.arch.

When adding a subtest, if the subtest contains parameters, you will see this question in the screen and you have to select “yes”:

The default value of the subtest parameters will keep the same.

If after that you want for some reason to overwrite the parameters default values, all you have to do is to add a data source with the desired value(s) and execute a data driven test.
By doing that, the parameter default value will be automatically overwrite only for this execution.

Let me know if that’s what you are looking for and if you need any help :slight_smile:

It’s not that I am unable to add parameters to the parent test, it’s that I did not want to have to pass those parameters into the subtest e.g. perhaps a nullable value in the parent. Right now it requires a value to be passed in, because if you pass in a “” value, then that blank value is used (because it is a value), so I have to check in the child test “if blank use the default value” and I was hoping for a way, within the parent test, to say something like “use child test default” and not have to set those values.

Hi, @nextechgarch.

I’m not sure I understand what do you mean.
If you don’t want to use a empty value so why did you let it empty?

Please elaborate a bit more or contact us at or in the chat here to schedule a meeting:

Sorry, replying from a new account here…but in answer to the previous question.

I am allowing it to be empty because the encompassing test may or may not care about the value being passed down to the subtest.

e.g. I have a “create account” test that uses a “create user” sub test. I don’t especially care what my user’s e-mail is, perhaps, so I can pass or not pass that value in during testing to my “create user” test. My “create user” test (included in the parent test) will auto-gen the user e-mail. If I set the “email” parameter with a default value, e.g., but in the parent test, I don’t set a parameter (blank), then blank is used in the sub-test, rather than the default value. Default seems irrelevant in the “in” parameters as it always seems like it will be either blank or the value from the parent.

I guess the question should be, How do I use the “default” value for an “in” parameter if it’s included as a sub test?