Generate test cases
Tosca Agentic Test Automation helps you create test cases with natural language through a secure, responsible AI. This speeds up test creation and helps you improve existing portfolios.
Tosca Agentic Test Automation can help you create new test cases, but it can't update existing ones.
You can create test cases for web, SAP Fiori, and SAP GUI applications.
Prepare the test data file
Before you create test cases, prepare a test data file that tells the AI how to produce actionable test steps. Check out our examples to see test data in different formats.
You can also reuse manual test cases you already have. Their built-in structure improves the AI's accuracy and helps avoid problems with vague prompts. Copy and paste your manual test case into the chat field.
Best practices for test data files
To create the test data file, make sure you do the following:
-
Define clear objectives: Ensure the test data aligns with the specific goals of the test and covers required fields, conditions, and expected outcomes.
-
Use realistic data: Create data that mimics real-world scenarios to simulate actual use cases. This includes normal, boundary, and error conditions.
-
Ensure completeness: Populate necessary fields with appropriate values. Missing data fields will prompt the AI to request user input during the test run.
-
Group related fields: Consolidate related fields into a single group for streamlined data entry during the test run. For example, group customer names and addresses.
-
Maintain consistency: Use consistent formats and conventions for fields like dates, IDs, and numerical values.
-
Validate test data: Review test data for accuracy and ensure it meets the requirements of the test scenario.
Generate your first test case
Now that you've prepared your test data, you can create your first test case.
When you generate test cases, you can choose how Tosca Agentic Test Automation interacts with your application:
-
TBox steers controls based on their technical properties. It reads the application's control structure directly. Select TBox for SAP GUI or SAP Fiori applications with accessible control hierarchies.
-
Vision AI usesvisual elements to recognize controls. It works regardless of the underlying technology. Use Vision AI for applications without accessible control properties or with complex UIs. It's ideal for SAP Fiori applications.
When you generate test cases, you can choose between two different modes:
-
Co-create, the default mode, lets you verify each step before the agent performs it. You can give Tosca Agentic Test Automation feedback or new instructions before each step runs.
-
In Autonomous mode, Tosca Agentic Test Automation runs all steps in sequence until the test is complete, without your input.
Follow these steps to create a test case in Co-create mode:
-
Select Generate a test case in the Tosca Agentic Test Automation window.
-
Select the application where you want to generate a test case.
-
Select TBox or Vision AI.
-
Choose Co-create at the bottom of the chat window.
-
Give Tosca Agentic Test Automation a prompt that describes what you want to achieve with this test. Paste test data or upload a test data file. The file can be text or JSON, up to 4 MB.
If you selected an SAP Fiori application, Tosca Agentic Test Automation generates a set of work steps. You can edit the work steps or leave them as they are.
-
Tosca Agentic Test Automation then describes the first test step it will perform and asks if it should proceed. If you'd like to change something, provide feedback so that Tosca Agentic Test Automation can update the test step.
-
After you give permission to proceed, Tosca Agentic Test Automation performs the test step. Don't move your mouse while the agent works. When it's done, a browser notification asks you to return to the automation window.
-
Continue until you're done, then select Save test case.
-
Choose whether to reuse existing modules or create new ones. If you reuse modules, they replace the matching ones in your test case. This avoids duplicates and simplifies maintenance.
You can find your new test cases on the Test cases page.
Follow these steps to create a test case in Autonomous mode:
-
In the Tosca Agentic Test Automation window, select Generate a test case.
-
Select the application where you want to generate a test case.
-
Select TBox or Vision AI.
-
Choose Autonomous at the bottom of the chat window.
-
Give Tosca Agentic Test Automation a prompt that describes what you want to achieve with this test. Paste test data or upload a test data file. The file can be text or JSON, up to 4 MB.
If you selected an SAP application, Tosca Agentic Test Automation generates a set of work steps. You can edit the work steps or leave them as they are.
-
Start the test case generation:
-
Maximize the window of the application under test.
-
Send your instructions.
-
Step away from your mouse. Don't move your mouse while Tosca Agentic Test Automation generates test cases.
-
-
When Tosca Agentic Test Automation is done, select Save test cases.
-
Choose whether to reuse existing modules or create new ones. If you reuse modules, they replace the matching ones in your test case. This avoids duplicates and simplifies maintenance.
You can find your new test cases on the Test cases page.
In this example, you create an SAP sales order:
-
You select the SAP application.
-
You provide the test instructions Create an SAP sales order and upload the test data JSON file.
-
You select Import to Tosca to import the test case to Tosca Cloud.
Edit work steps
You can use work steps only with SAP Fiori applications.
To use this feature, follow these steps:
- In the Tosca Agentic Test Automation window, select Generate a test case.
- Select the application where you want to generate a test case and confirm that it's an SAP Fiori application.
- Enter your prompt and test data. Tosca Agentic Test Automation generates a set of work steps.
- Select the work steps to review them, then choose to proceed or edit. In edit mode, you can delete steps or change the text directly.
- When you're satisfied with the work steps, select
send.
Examples of test data
These test data examples show natural language and JSON formats.
Natural language formatting
The following example test data sets use natural language format for SAP Fiori applications and web applications.
Let's say you want to create a sales order. Copy and paste this prompt directly into the chat text field:
Create Sales orders VA01
Here's the test data. Copy and paste this data into a text file and then upload it to Tosca Agentic Test Automation.
Screen: Create Sales Documents
Data:
- Order Type: OR
- Sales Organization: 1000
- Distribution Channel: 10
- Division: 00
Screen: Create Standard Order: Overview
Data:
- Sold-to Party: 1175
- Ship-to Party: 1175
- Cust Reference: Test
- All Items table:
- Item: 2
- Material: M-09
- Order quantity: 5
Or maybe you want to create a purchase order. Copy and paste this prompt directly into the chat text field:
Create purchase order
Here's the test data. Copy and paste this data into a text file and then upload it to Tosca Agentic Test Automation.
1. Search for 'Create Purchase Order'
2. Click on Dropdown, and Click on the Standard PO
3.Fill in the data for the following fields:
-Vendor: 0010300002
-Purch. Org.: 1010
-Purch. Group: 001
-Company Code: 1010
4. In the first table, fill in the first row the following: Material: SF-FL-FORK-L, PO Quantity: 20, Plnt: 1010
Here's the test data. Copy and paste this directly into the chat text field:
Step 1: select the Automobile table
Step 2: Enter Vehicle Data
Action: On the Enter Vehicle Data screen, input the following details:
Make: BMW
kW: 120
Date of Manufacture: 06/19/2023
Number of Seats: 5
Fuel Type: Diesel
List Price: 17500
License Plate Number: WU-1234AT
Annual Mileage: 15000
Expected Result: Vehicle data is entered correctly.
Proceed to Insurant Data
Action: Click on the Next » button.
Expected Result: The Enter Insurant Data screen is displayed.
Step 3: Enter Insurant Data
Action: On the Enter Insurant Data screen, input the following details:
First Name: Rywuzdz
Last Name: Cdxtlpg
Date of Birth: 12/12/1989
Gender: Male
Street Address: Teststraße 123
Country: Austria
Zip Code: 1120
City: Wien
Occupation: Employee
Hobbies: Select 'Speeding'
Action: Click on the Next » button.
Expected Result: The Enter Product Data screen is displayed and direct to the next page.
Step 4: Enter Product Data
Action: On the Enter Product Data screen, input the following details:
Start Date: 07/19/2025
Insurance Sum: 15,000,000.00
Damage Insurance: No Coverage
Merit Rating: Bonus 7
Optional Products: Select 'Euro Protection' and 'Legal Defense Insurance'
Courtesy Car: Yes
Expected Result: Product data is entered correctly.
Step 5: Proceed to Price Option Selection
Action: Click on the Next » button.
Expected Result: The Select Price Option screen is displayed.
Step 6: Select Price Option
Action: On the Select Price Option screen, select the 'Platinum' radio button.
Expected Result: 'Platinum' price option is selected.
Step 7: Proceed to Quote Submission
Action: Click on the Next » button.
Expected Result: The Send Quote screen is displayed.
Step 8: Enter Contact and Account Information
Action: On the Send Quote screen, input the following details:
E-Mail: j.snow@tricentis.com
Phone: 004369911223344
Username: jsnow
Password: Password+12
Confirm Password: Password+12
Comments: OSV rocks!
Expected Result: Contact and account information is entered correctly.
Step 9: Submit the Quote
Action: Click on the « Send XML» button.
Expected Result: The quote is submitted successfully.
Step 10: Confirm Submission
Action: In the Confirmation Dialog, click on the OK button.
Expected Result: Submission confirmation is acknowledged.
Step 11: Return to Home
Action: Click on the Tricentis link in the Confirmation Dialog.
Expected Result: Navigated back to the home page.
JSON formatting
The following example test data sets use JSON format and cover various field types. Copy and paste this data into a JSON file and then upload it to Tosca Agentic Test Automation.
{
"Username": "test_user",
"Password": "password123"
}
{
"Customer Details": {
"Name": "John Doe",
"Contact Number": "123-456-7890",
"Email": "john.doe@example.com"
},
"Order Details": {
"Order Type": "Online",
"Payment Method": "Credit Card"
}
}
{
"Order Items Table": [
{
"Item": 1,
"Product Name": "Widget A",
"Quantity": 2,
"Price": 10.00
},
{
"Item": 2,
"Product Name": "Widget B",
"Quantity": 5,
"Price": 20.00
}
]
}
{
"Order Items": [
{
"Item": 1,
"Product Name": "Widget A",
"Quantity": 1,
"Price": 10.00
}
]
}
{
"Order Items": [
{
"Item": 1,
"Product Name": "Widget A",
"Quantity": 2,
"Price": 10.00
},
{
"Item": 2,
"Product Name": "Widget B",
"Quantity": 5,
"Price": 20.00
}
]
}
{
"Credentials": {
"User": "xxx",
"Password": "xxx"
},
"Test Organizational Data": {
"Order Type": "OR",
"Sales Organization": "1000",
"Distribution Channel": "10",
"Division": "00"
},
"Test Sales Order Data": {
"Sold-To Party": "1175",
"Ship-To Party": "1175",
"Cust. Reference": "Customer Test",
"All Items Table": [
{
"Item": 1,
"Material": "M-09",
"Order Quantity": 5
},
{
"Item": 2,
"Material": "M-09",
"Order Quantity": 10
}
]
},
"Outbound Delivery Data": {
"Shipping Point": 1201,
"Selection Date": "11/21/2026"
}
}