We're here to help
An introduction to callable tests
It is possible to convert a test case into a Callable test case. This is recommended to encapsulate functionality and make it reusable across a number of test cases.
Callable tests also reduce test maintenance, since they provide a centralized location for regularly used functionality.
Create a callable test case
Define the main Parameters and Settings in the test case. Then set Callable on the Callable dropdown:
This will add a small red image against the test case in the Navigator to indicate that the test case is Callable.
You can now pass parameters into the Callable test and also return output parameters.
Then save the test case.
Invoke a callable test case
To invoke a Callable test case, first open the test case which should call it. Then locate the Callable test case in the Navigator and click and drag it into the Calling test:
You will note that the Call is created as a new test step, containing Input and Output Parameters. These values can then be defined as required.
Callable test value visibility
As your tests get more sophisticated, there is a danger that called test cases will start ‘stepping on each others toes’, with called test cases overwriting values on which other test cases depend.
Provar observes the following rules to mitigate these issues:
- Called test cases cannot see their Caller’s values. These need to be passed as Input Parameters if required.
- The Calling test case cannot see the Called test case’s values. These need to be returned as Output Parameters if required.
- If a Called test case defines a value with the same name as the Calling test case, these values are kept separate from each other and the one will not overwrite the other.
- Folder values and Global values are shared between test cases.