Tosca Modules: What They Are and How to Use Them
🧩 Tosca Modules: What They Are and How to Use Them
Modules are one of the most important building blocks in Tosca test automation. They represent the UI elements or technical components of the application you're testing, such as buttons, input fields, checkboxes, dropdowns, and APIs.
Modules are what allow Tosca test cases to interact with the application under test (AUT).
🧠 What Is a Module in Tosca?
A Module in Tosca is a reusable template for interacting with a specific element of your application.
Each module contains:
Control(s) – representing individual elements (e.g., a "Login" button or "Username" field)
Properties – such as technical ID, type, and locator strategy
Modules are created using the Tosca XScan tool, which scans the application’s UI or APIs.
📌 Types of Modules
Module Type Description Example
UI Module Represents graphical elements in a UI Buttons, text fields, checkboxes
API Module Represents endpoints and requests REST or SOAP requests
TBox Module Built-in functions (e.g., loops, waits) TBox Set Buffer, TBox WaitOn
🔧 How to Create a Module
Open Tosca Commander
Navigate to the Modules folder in the Project tree
Right-click and choose "Scan Application"
Select your application type (web, desktop, etc.)
Use the Tosca XScan tool to identify and capture UI elements
Save the scan – Tosca will generate a Module with all captured controls
💡 Each scanned element becomes a Control inside the Module.
🛠️ How to Use a Module in a Test Case
Go to the TestCases section
Drag and drop the desired Module onto your test case
Tosca creates a Test Step based on that Module
Fill in the values or actions (e.g., input text, click button)
✍️ Example:
Imagine you scanned a login page. Your module may include:
Username (Input field)
Password (Input field)
LoginButton (Button)
In your test case:
Set Username → john.doe
Set Password → password123
Click LoginButton
♻️ Why Reuse Modules?
Saves time — scan once, use many times
Easy to update — if the UI changes, just update the module
Reduces duplication — multiple test cases can use the same module
🧩 Module Structure
Each Module contains:
Field Description
Name Control name (e.g., SubmitButton)
Control Type Textbox, button, link, dropdown, etc.
Technical ID The locator used to find the element
ActionMode Defines the type of interaction
Value Input value or expected result
🔐 Module Best Practices
Name controls clearly (e.g., FirstNameInput, SubmitButton)
Group modules by screens or features
Regularly re-scan modules if the application UI changes
Avoid unnecessary scanning – reuse existing modules when possible
🧠 Summary
Concept Explanation
Module A reusable collection of UI/API elements
Created by Scanning the application with Tosca XScan
Used in TestCases – by dragging modules into steps
Benefit Faster test creation, high maintainability, low code
Would you like a demo walkthrough of:
Scanning a web page with Tosca XScan?
Creating a data-driven test case using a Module?
Managing dynamic controls or reusable modules?
Learn Tosca Training in Hyderabad
Read More
How to Create Your First Test Case in Tosca
Introduction to Tosca Commander and Its UI
Visit Our Quality Thought Training in Hyderabad
Comments
Post a Comment