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.

e.g.
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”:
image

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:

Hi,
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 support@testproject.io or in the chat here to schedule a meeting: