The test suite structure
In this chapter, you’ll learn about the items that make up a test suite, how to add them, their purpose and functions, and the hierarchy they follow.
Add test suite items
There are three ways to add items to a test suite.
Use the ADD button.
Note
Test suite items
In this section, you’ll learn about the items that make up a test suite. Test suite items can be separated into two groups, structure items
Structure items form the framework of your test.
The test suite
The test suite item serves as the root structuring item. It contains all other items and cannot be cut, copied, pasted, or deleted. It can contain only other structuring items as direct children, i.e. no modules or module groups.
The test suite item is where you configure global parameters and report settings for the test suite. Access these through the context menu.
Test cases
A test case is a structuring item. Each test case represents a primary function of your test suite, such as adding an entry to a database. Build test cases by populating them with modules and module groups. You can also add smart folders to test cases to organize them further. Test cases cannot contain other test cases.
You can configure error behavior, data bindings, and conditions for test cases through their context menu.
Test cases are the only items counted in the test report success counter.
Smart folders
A smart folder is a structuring item. Use smart folders to organize your test suite as you would in a folder hierarchy. You can populate smart folders with modules and module groups, but only if the smart folder is a child of a test case.
You can configure error behavior, data bindings, and conditions for smart folders through their context menu.
Setup/teardown regions
Setup and teardown regions are structuring items. You can add one of each to the test suite item, test cases, and smart folders. The setup region will always be placed at the beginning of an item and the teardown region at the end.
To add a setup or teardown region:
Right-click the desired item.
Click Add setup or Add teardown.
Adding setup & teardown regions
Teardown regions are always executed after everything else, or when an error occurs in the direct parent item. Populate teardown regions with the modules and module groups needed to clean up the AUT after a test run, such as deleting all entered data and closing the AUT.
Modules
Modules are test data items. They contain the actions performed during a test. You can add modules to all structure items except the test suite item and smart folders that aren’t the child of a test case.
There are two types of modules:
Recording and code modules
- Contain actions you’ve recorded or added using the Ranorex Recorder and its action table.
Code modules
- Contain actions programmed in code.
You can configure data bindings for modules through their context menu. You can also group several modules to create module groups, as
Note
Module groups
Module groups are test data items. Use them to group modules that logically belong together, such as data validations that usually occur together. You can add module groups to all structure items except the test suite item and smart folders that aren’t the child of a test case.
All module groups are stored in a separate file. You can locate this file under the project in the projects view. By default, it’s named
[Project name].rxtmg
(for Ranorex test module group).
Module group file
Direct grouping
In the test suite view, select one or more modules that you want to group.
Right-click one of them and click Group selected modules.
The newly created module group opens in the module group view.
The module group view opens with the new module group selected. The new module group also appears in the module browser.
Creating a module group with direct grouping
In the test suite view, right-click the structure item to contain the new module group.
Click Add > New module group. The module group view opens with the new module group selected.
Creating a module group using the context menu
The new module group appears in the module browser. You can rename module groups and organize them in folders in the module group view.
Note
Test suite hierarchy
Test suite items are organized in a hierarchy. This hierarchy controls where items can be added or moved, as illustrated below:
Test suite hierarchy
Note
- Test cases can never be a child of another test case.
- When you move a test case into another test case, Ranorex will automatically convert it to a smart folder for you.
- A smart folder can contain modules or module groups only when it is the child of a test case.