Tosca Standard Modules Explained

Tosca TBox Modules and Their Uses: A Complete Guide

Tosca by Tricentis is a powerful automation tool widely used for functional and regression testing. At the heart of Tosca’s no-code, model-based automation lies the TBox framework.

In this blog, you’ll learn what TBox Modules are, and how to use the most essential ones to create powerful and maintainable test cases.


🧱 What is the TBox Framework?

The TBox (TestBox) Framework is a core engine in Tosca that provides standard modules (reusable functions) to:

  • Interact with UI elements

  • Perform logic and calculations

  • Execute test steps without scripting

TBox Modules are technology-agnostic — they work across Web, Desktop, SAP, Mobile, and more.


πŸ“¦ Where to Find TBox Modules

  • TBox modules are located in Standard Modules > TBox in Tosca Commander.

  • You can drag and drop them into test steps.

  • No need to write code — just set values and attributes.


πŸ”Ÿ Top TBox Modules and Their Uses

Let’s explore the most commonly used TBox modules with examples.


1️⃣ TBox Set Buffer

Use: Stores a dynamic value in a buffer to reuse later.

BufferName: UserName Value: John123

πŸ“Œ Example: Store a generated email to use in later steps.


2️⃣ TBox Set Value

Use: Sets a specific value into a field (text boxes, dropdowns, etc.)

Value: test@example.com

πŸ“Œ Example: Enter email into a login form.


3️⃣ TBox Get Value

Use: Extracts a value from a field and saves it to a buffer.

BufferName: CapturedTotal

πŸ“Œ Example: Capture the displayed total price on a checkout page.


4️⃣ TBox If

Use: Conditional logic — executes test steps based on conditions.

Expression: {OrderStatus}==Confirmed

πŸ“Œ Example: Only proceed with shipment steps if the order is confirmed.


5️⃣ TBox Do

Use: Groups multiple test steps — like a container.

πŸ“Œ Example: Combine multiple UI actions like login into a single group.


6️⃣ TBox Loop

Use: Repeat a set of actions multiple times.

Counter: 1 Limit: 3

πŸ“Œ Example: Add 3 items to cart using the same steps.


7️⃣ TBox Wait

Use: Add wait time between steps (static or dynamic).

Timeout: 3s

πŸ“Œ Example: Wait for page load or animation to complete.


8️⃣ TBox Evaluation

Use: Perform calculations or logical evaluations.

Expression: {Price} * 1.18 Buffer: TotalWithTax

πŸ“Œ Example: Calculate price after applying tax.


9️⃣ TBox File Operations

Use: Read/write files, especially for validating downloaded content.

πŸ“Œ Example: Check if a PDF was downloaded and contains the correct text.


πŸ”Ÿ TBox Date and Time Operations

Use: Handle date-time formatting, addition, subtraction.

Current Date + 7 Format: dd-MM-yyyy

πŸ“Œ Example: Enter a date 7 days from today in a booking app.


🧰 More Useful TBox Modules

Module NameUse Case
TBox Merge StringsCombine multiple values into a single string
TBox Delete BufferRemove a buffer after use
TBox Regex MatchExtract specific text using regex
TBox DB ExpertRun SQL queries during test execution
TBox ExcelRead/write Excel files for data-driven tests
TBox ClipboardInteract with the clipboard (copy/paste)
TBox RestartRestart the application or session
TBox ReturnExit current module chain if needed
TBox MessageBoxDisplay custom alert messages during tests

πŸ§ͺ Example: Real-Life Test Scenario Using TBox

Let’s say we are automating an eCommerce checkout process:

Step-by-Step Breakdown:

StepTBox Module Used
Open login pageTBox Set Value
Enter username & passwordTBox Set Value
Click login buttonStandard click
Store cart valueTBox Get Value
Apply discountTBox Evaluation
Proceed if cart > ₹500TBox If
Confirm orderTBox Set Value
Capture order IDTBox Get Value
Store it in bufferTBox Set Buffer
Loop over 3 itemsTBox Loop

🧩 Combining TBox Modules with Controls

TBox modules can be linked to UI controls:

  • Enter data into forms

  • Read labels and error messages

  • Validate popups and dialogs

πŸ“Œ Example:

Control: #EmailField Module: TBox Set Value Value: {GeneratedEmail}

πŸ§ͺ Benefits of TBox Modules

✅ No scripting or code
✅ Technology-independent
✅ Easily reusable across projects
✅ Simplifies dynamic test design
✅ Supports data-driven and keyword testing


🧠 Tips for Using TBox Efficiently

  • Use buffers to pass dynamic data between steps

  • Use TBox If for smarter test flows

  • Use TBox Evaluation for calculations instead of Excel

  • Group logical steps using TBox Do for clarity

  • Use TBox Modules in Business Components for reuse


πŸ§ͺ TBox + Classic Modules?

  • TBox is more modern and stable than classic modules

  • Prefer TBox for:

    • Web apps

    • Mobile apps

    • SAP GUI

  • You can still use classic modules if needed for legacy tests


πŸ” Security & Best Practices

  • Avoid hardcoding sensitive data

  • Store test data in external Excel or TestSheets

  • Use TBox Wait sparingly — prefer implicit waits

  • Modularize reusable logic using Business Components


πŸš€ Final Thoughts

TBox Modules are the secret weapon in Tosca's automation toolbox. They let testers:

  • Automate complex scenarios

  • Use logic and loops

  • Work with data without scripting

Whether you're testing a website, a desktop app, or an enterprise tool — mastering TBox will make your automation more powerful, readable, and maintainable.



Read More 




Comments

Popular posts from this blog

Tosca System Requirements and Installation Guide (Step-by-Step)

How to Install Selenium for Python Step-by-Step

Tosca Commander: A Beginner’s Overview