In this chapter, 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.
a. Use the ADD button.
b. Use the context menu in the test suite workspace.
c. Drag and drop from the module browser. This only works for modules and module groups.
Test suite items
In this section, learn about the items that make up a test suite. Test suite items can be separated into two groups, structure items and test action items.
Structure items form the framework of your test.
Test action items contain the actions to perform during 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.
Setup regions are always executed before anything else in the direct parent item. Populate setup regions with the modules and module groups needed to bring the AUT to the state required for the following modules to run, such as starting the AUT and logging in.
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 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. Also, group several modules to create module groups, as explained below.
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).
There are two ways to add module groups:
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.
Adding modules individually
-
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.
- Drag and drop the desired modules from the module browser to the module group.
The new module group appears in the module browser. You can rename module groups and organize them in folders in the module group view.
Test suite hierarchy
Test suite items are organized in a hierarchy. This hierarchy controls where items can be added or moved, as illustrated below: