Unit testing enables you to test individual parts of your automation project in isolation. It encourages you to adopt a consistent and testable design methodology and promotes improved quality of automations, early detection of issues, and the detection of regression issues after automations are refactored. When creating a unit test, you provide the input parameters for the automation and define the expected output parameters.

Using the Test Explorer, you can create test cases, modify tests, and delete tests that you no longer need. To make it easy for you to navigate through the tests, the Test Explorer provides a tree view that is loaded with all testable automations in the project hierarchy. Listed under each automation in the tree view are all the test cases that you have created. Select a test case to view the input values and expected output values.

The Test Explorer provides the ability to run the unit tests individually or in a batch. The Unit Testing feature also allows you to display the results of test runs so that you can quickly identify any issues revealed by the tests and take corrective action. To get more detailed information about previous test runs, go to the Results tab of the test case or the automation.

With its intuitive design and robust features, the Test Explorer is an important tool for any developer who is looking to streamline the testing process and ensure the quality of the automation code.

Unit tests project structure

The Unit Testing feature integrates with your project structure, to provide an overview of the entire hierarchy along with associated test cases in a convenient tree view. This integration makes it easy to navigate through your tests and helps ensure that you create a structured approach to test case management.

The system provides an exact replica of your project folder tree structure and, for each testable automation, the system shows the associated test cases.
NOTE: A testable automation is an automation that has an entry point and an exit point. The exit point must have a result or output parameters, or both.

Right-click in the folder tree structure to run, debug, or delete test cases. You can also run and debug a group of test cases for an automation using the Folder > project > Run/Debug test cases option.