Best practices for Tosca Agentic Test Automation
Tosca Agentic Test Automation is an AI assistant that helps you create test cases with natural language through a chat window. This topic helps you pick the right mode, write clear prompts, and check your results.
Choose the right test creation mode
Tosca Agentic Test Automation has two creation modes:
-
Select Co-create for long or complex tests that need your input. You confirm each stage, edit steps, and approve actions before the agent moves on. It helps you to fix mistakes early.
-
Select Autonomous for well-scoped tests with a clear goal. The agent creates the full test with little input from you.
Provide a manual test case
Paste or attach a real manual test case into the agent chat. Avoid vague prompts. A detailed, step-by-step test gives the agent better results.
Manual tests include field names, domain context, and business intent. This detail helps the agent pick the correct controls.
This example shows a prompt for a simple sign in test with clear steps and expected results:
Manual Test Case - Login
1. Navigate to https://app.example.com/login
2. Enter Username: test.user
3. Enter Password: ****** (use test credentials)
4. Click [Sign in]
5. Verify the page contains "Welcome, test.user"
Start small, iterate fast
Start with one to five steps. For example, open a login page, enter credentials, click login, verify the home page. Here's why this works:
-
Short tests let you check results fast and build trust in the agent's output.
-
Once short tests work well, add more steps and combine them into longer flows over time.
This example shows prompts to create an SAP Fiori purchase order that you can paste or attach in the agent chat:
1. Search for "Create Purchase Order Advanced" in the SAP Fiori launchpad.
2. Click the Dropdown and select "Standard PO DFPS".
3. Fill these header fields, then press Return:
- Vendor: 0010300002
- Purch. Org.: 1010
- Purch. Group: 001
- Company Code: 1010
4. In the Items table, populate the first row:
- Material: SF-FL-FORK-L
- PO Quantity: 20
- Plnt: 1010
5. Press Save.
Write clear prompts
Specific prompts help the agent find the right elements and produce accurate steps. Keep these things in mind:
-
Name UI elements precisely: Write Click the top-right 'Submit' button in the Payment section instead of Click Submit.
-
Add test data: Include user names, amounts, and expected messages to remove guesswork.
-
Reference visible text: Write select by visible text 'Standard PO DFPS' to prevent wrong dropdown choices.
-
Give explicit directions: Write first row or press Return so the agent picks the right control.
-
State assertions clearly: Write Verify text 'Document <number> has been created' appears instead of Check the result.
-
Structure long tests: Format complex test cases as JSON or Markdown.
See generate test cases for examples.
Validate step by step
Run each new test once in a test environment before you add more steps. This catches issues early.
Don't recreate the same test case from scratch each time. Instead, edit an existing test case to refit it for new scenarios. This keeps your workspace clean and makes future updates easier.
What's next
Generate test cases and put these best practices to work.