Best practices | Modules | Names
Modules represent specific parts of your application; they contain all the technical information that Tosca needs to navigate and control your application. When you design an automated TestCase, you use Modules to build your test sequence and actions.
This topic is all about names: for Modules and their attributes. It helps you to create Modules that are intuitive to use, so you can quickly grab the right one for what you're trying to do. Even in environments with many testers who create Modules.
Module names
By default, Tosca uses a window's caption as the name of the Module. In some cases, this might be impractical, and you need to rename your Module:
-
Rename your Module whenever captions aren't unique enough. For example, if the caption is always the application's name, no matter which screen you're on.
If you don't rename, you get a list of Modules with identical names and a number, and it'll be difficult to identify the right Module for a TestCase.
Avoid this! Multiple Modules with the same name make it difficult to identify the one you need.
-
Rename your Module whenever captions are too unique. For example, if a standard order confirmation page has the order number in the caption.
If you don't rename, you get a Module with an overly specific name, and it will be hard to find. Plus, it will be counter-intuitive to reuse the Module in other TestCases.
Avoid this! Modules with super specific names are difficult to find and counter-intuitive to reuse.
You can rename your Modules during the scan or after the scan. We suggest that you rename them during the scan, to save yourself the trouble of going through all Modules again and matching them with your application.
When it comes to renaming, remember this:
-
Make your Module names human-readable.
-
Make sure your Module names are descriptive, because your fellow testers need to find the right building blocks quickly and easily.
We recommend this basic naming convention:
<application name, abbreviation> | <general section that the Module's controls are in> | <what the Module covers>
Yes! Descriptive names make your Modules easy to find and intuitive to reuse.
ModuleAttribute names
A ModuleAttribute is the technical representation of a single control. A control is a screen element in your application under test: a button, a field, a table cell, a menu, and so on.
By default, Tosca uses a control's label as the name of the ModuleAttribute. If your application doesn't provide good labels, you need to rename the ModuleAttributes. If you don't, your fellow testers won't know what to do with the Module:
Avoid this! Bad ModuleAttribute names make this Module pretty much unusable.
You can rename ModuleAttributes during the scan or after the scan. We suggest that you rename them during the scan, to save yourself the trouble of going through all Modules again and matching them with your application.
Always make sure that your ModuleAttributes have simple, human-readable labels that explain the meaning of the control. That way, your testers can quickly identify screen elements and define the right test actions for them.
Yes! Good ModuleAttribute names make this Module intuitive to use.
What's next
If you haven't yet, check out our other best practices articles.