TestProject Forum

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.