How to Create and Reuse Modules in Tosca

How to Create and Reuse Modules in Tosca

Boost your automation with modular, reusable test components

Tosca by Tricentis is a powerful test automation tool that supports model-based testing. One of its core features is the use of Modules — the building blocks of automation. Learning how to create and reuse modules is key to efficient and scalable test automation.


💡 What is a Tosca Module?

A Module in Tosca represents a UI control or business component (like a text box, button, table, etc.). It stores the technical information (like XPaths or HTML attributes) that Tosca needs to interact with the application.

There are two types:

  • Technical Modules – for UI elements (created by scanning)

  • Business Modules – reusable logic/flows built using Technical Modules


✅ How to Create Modules in Tosca

🔹 Step 1: Open Tosca Commander

Launch your Tosca workspace and navigate to the Modules section.


🔹 Step 2: Scan the Application

Use Tosca’s Tosca XScan tool to identify UI elements:

  1. Right-click the Modules folder → Select Scan

  2. Choose your browser or application window

  3. XScan opens and highlights the UI

  4. Click on elements you want to automate (e.g., username, password fields, buttons)

  5. Save and close the scan

Tosca will create Technical Modules for each scanned element.


🔹 Step 3: Name and Organize Modules

  • Rename modules meaningfully (e.g., Login_UsernameField, Login_Button)

  • Group them by screen or function (like Login Page, Home Page)

Organizing makes reuse easier and your project cleaner.


🔁 How to Reuse Modules in Test Cases

Once your modules are created:

  1. Go to the TestCases section

  2. Drag and drop a module into your test case

  3. Fill in test data or actions (e.g., Enter username = "admin")

You can reuse the same module in multiple test cases — no need to rescan or rebuild.


🔄 Create Reusable Business Modules

Business Modules are reusable blocks made by combining multiple steps (like login flow).

Example:

  1. Create a Folder under Modules → Right-click → Add Business Module

  2. Inside the business module, add:

    • Enter username

    • Enter password

    • Click login button

  3. Now drag this Business Module to any test case where login is needed.

🎯 Benefit: Update logic once → used everywhere.


🔧 Tips for Better Module Reuse

  • Always scan full screens rather than single controls when possible

  • Avoid duplicate modules by checking existing ones

  • Use Module Attributes wisely (e.g., Visible, Enabled)

  • Modularize complex flows into small, reusable chunks

  • Add Comments in Business Modules for clarity


✅ Summary

StepDescription
Scan UIUse Tosca XScan to capture UI elements
Create ModulesTechnical Modules for UI, Business Modules for logic
ReuseDrag modules into test cases
Maintain EasilyUpdate in one place, reflect everywhere

Conclusion:
Using Modules the right way in Tosca helps you reduce duplication, maintain cleaner test structures, and save time during automation. Build once, reuse always — that’s the Tosca way!



Read More 




Comments

Popular posts from this blog

Why Choose Python for Full-Stack Web Development

How Generative AI Differs from Traditional AI

What is Tosca? An Introduction