Introduction
One of the biggest challenges in test automation is reusability. While Tricentis Tosca addresses this with its Module-Based Test Automation approach, there are times when creating a Generic Module is even more beneficial. Generic Modules reduce maintenance, accelerate test case creation, and improve overall scalability.
By designing modules that are parameterized and reusable across different applications and screens, you can dramatically cut down maintenance effort while speeding up test design.
The Challenge Without Generic Modules
Imagine automating a “Create Lead” screen that contains 15 dropdown fields. A typical approach might involve creating a separate Tosca module for each dropdown. The problem?
-
Too many modules: Each control scanned and stored individually.
-
High maintenance: Any UI change (e.g., attribute update) requires fixing multiple modules.
-
Slower test design: Building test cases becomes repetitive and error-prone.
Multiply this across dozens of screens and you’ll quickly see why automation teams spend more time maintaining tests than creating new ones.
Example: Generic Dropdown Module
Let’s take a dropdown example. Without a Generic Module, you might need 10–15 separate module attributes for different dropdowns across your application. With a Generic Module:
-
You define the dropdown name (e.g., Country, Industry) as a parameter.
-
You set the value dynamically (e.g., USA, Technology).
-
Tosca executes the same module logic, regardless of which dropdown field is being tested.
This not only reduces the number of modules, but also makes your test cases data-driven and far easier to maintain.
Why This Matters
Generic Modules aren’t just a nice-to-have. They directly impact your automation program’s efficiency:
-
Reduced Maintenance – Instead of updating 20 modules when a screen changes, you only update one.
-
Accelerated Test Case Creation – New test cases can be assembled quickly by reusing existing blocks.
-
Improved Scalability – Teams can expand automation coverage faster with fewer bottlenecks.
-
Cross-Application Reuse – Works across custom web apps, and enterprise platforms like SAP, Salesforce, Oracle, and Workday.
How to Create a Generic Module in Tosca
Step 1 – Create the Base Module
Scan the application once and capture the control you want to make generic (e.g., dropdown, textbox, or button). Keep the module lean by removing non-essential attributes so it can be reused across multiple screens.
Step 2 – Add TBOX Set Buffer
Add the TBOX Set Buffer Module inside your Generic Module. Use it to store dynamic values:
-
Buffer the UI element name (e.g.,
DropdownName
). -
Buffer the list item value (e.g.,
DropdownValue
).
This allows Tosca to substitute the correct element and value at runtime, making the module reusable.
Note: Drag the TBox Set Buffer Module from the Standard Modules folder on top of the new Generic Module
Next Parameterize the Generic Item InnerText value
Step 3 – Create Resuable Test Step Block
Step 4 – Add Business Parameters
Define Business Parameters that make the module configurable:
-
Element name → identifies which UI element Tosca should interact with.
-
Selection value → defines the item to select.
Example: