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:

  1. Element name → identifies which UI element Tosca should interact with.

  2. Selection value → defines the item to select.  

Example:  

{B[DropdownName]} = Country
{B[DropdownValue]} = USA  
 

Step 5 – Use in Test Cases

When designing a test case, drag in the Test Step Block and supply the parameters you need:

  • DropdownName = Industry

  • DropdownValue = Technology

You can also use Tosca’s randomization feature (e.g., {B[RandomNumber]}) to dynamically select list items during execution.  

 

 

 

Best Practices for Generic Modules

To get the most value from this approach:

  • Keep it lean: Don’t overload your Generic Module with too many attributes.

  • Use descriptive buffer names: This makes test cases easier to read and maintain.

  • Organize Test Step Blocks in a Library: Create a reusable repository that your whole team can use.

  • Standardize naming conventions: Consistency across modules helps avoid confusion.


Conclusion

Generic Modules in Tosca are a game-changer for any automation team looking to scale efficiently. By creating reusable, parameterized modules, you can:

  • Reduce the time spent maintaining tests.

  • Accelerate new test case design.

  • Ensure consistency across your automation projects.

If you’re looking to take your Tosca automation to the next level, start with a simple Generic Module—like a dropdown control—and expand from there. Your future self (and your team) will thank you.