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 create new test cases but can't update existing ones.

You can create test cases for generic web, SAP Fiori, SAP GUI and Salesforce applications. Tosca Agentic Test Automation agents use Tricentis engines and supported technologies so generated tests fit the application under test.

This topic shows you how to prepare your prompts with examples and how to generate your first test case.

Prepare your prompt

Everything starts with a prompt. Tell Tosca Agentic Test Automation what to do, for example what to click or what the result should look like. The better you describe it, the better your test case turns out.

Write the prompt

Write the way you'd explain the task to a colleague. Use the same field names, buttons, and screen titles your application uses so the agent knows exactly where to go.

Already have a manual test case? Paste it into the chat. The structure of steps and headings gives the agent much more to work with than a single sentence.

Keep these tips in mind:

  • Cover all the steps you need, including expected outcomes. The more complete your prompt, the better the result.

  • Identify controls precisely. If multiple controls share the same title, text, or image on a screen, specify which one you mean. For example, reference the third button called XYZ or label ABC within tab DEF.

  • Check out our best practices for more ways to get better results.

Provide test data

You can add test data to your prompt. It's the actual values your test should type in or verify. For example, IDs, amounts, or table rows. You can put those values right into the prompt in the chat, or attach a file when you send your message. The file can be up to 4 MB and must be a text-based format, for example TXT, JSON, CSV, XML, HTML, or MD.

This isn't the same as test data you store in Tosca Cloud for reuse across tests. Here, you just hand the values over in the chat. Check out our prompt examples and test data examples to see both approaches in action.

Structure your test data

Whether you include test data in your prompt or attach it as a file, keep it clean:

  • Include only the fields and expected outcomes your test needs.

  • Use realistic values and add edge cases where they matter.

  • Fill in all required fields. Tosca Agentic Test Automation may stop and ask you during the run if something is missing.

  • Group related values together.

  • Keep your date and number formats consistent.

Generate your first test case

After you prepare your prompt, follow this section to generate 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 generic web, SAP GUI, SAP Fiori or Salesforce applications that have accessible control hierarchies.

  • Vision AI uses visual 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 works especially well for SAP Fiori applications.

When you generate test cases, you can choose between two different modes:

  • Co-create, the default mode, guides you through test case generation step by step in a conversational flow. Before each step, Tosca Agentic Test Automation shows you what it plans to do. You can give feedback, adjust instructions, or refine your prompt as you go.

  • In Autonomous mode, Tosca Agentic Test Automation runs all steps in sequence until the test is complete, without your input.

In this example, you create a simple test case that navigates to a website:

  1. Open a new window in your Edge browser.

  2. In the Tosca Agentic Test Automation window, select Generate a test case, then select the browser window for which you want to generate a test case.

  3. Enter the prompt Go to tricentis.com and send it.

  4. Follow the test case generation flow, then select Save test case.

Edit work steps

When you use Vision AI to generate an SAP Fiori test case, Tosca Agentic Test Automation generates work steps from your prompt and test data. You can proceed with the work steps as they are or edit them.

To edit the work steps, follow these steps:

  1. Select Let me edit it first when prompted.
  2. Edit values or delete steps as needed.
  3. When you're satisfied with the work steps, select send.

Examples of prompts

The following examples show how to write prompts with test data included directly in the chat. This approach works well when your instructions and data are closely tied together.

Examples of test data

The following examples show how to structure test data that you upload as a file. Use these formats when your test data is separate from your instructions.

Natural language formatting

The following examples use natural language format for SAP applications.

JSON formatting

The following examples show test data sets in 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.