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. Refer to Configure Parameters for more information.
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