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.

In this example, you create an SAP sales order:

  1. You select the SAP application.

  2. You provide the test instructions Create an SAP sales order and upload the test data JSON file.

  3. You select Import to Tosca to import the test case to Tosca Cloud.

Edit work steps

After you submit a prompt and a set of test data, Tosca Agentic Test Automation generates a set of work steps based on the data. You can proceed with the work steps as they are or edit them.

You can use work steps only with SAP Fiori applications.

To use this feature, follow these steps:

  1. In the Tosca Agentic Test Automation window, select Generate a test case.
  2. Select the application where you want to generate a test case and confirm that it's an SAP Fiori application.
  3. Enter your prompt and test data. Tosca Agentic Test Automation generates a set of work steps.
  4. 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.
  5. 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.

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.