Generate test cases

Tosca Agentic Test Automation allows you to generate test cases with natural language, based on a secure, responsible AI. This speeds up test authoring and helps you optimize existing portfolios.

Tosca Agentic Test Automation can help you create new test cases, but it can't update existing ones.

We recommend using SAP Fiori and web applications for testing.

Prepare the test data file

Before you start generating test cases, you need to create a test data file that tells AI how to generate actionable test steps. Check out our examples to see test data in different formatting styles.

Additionally, consider reusing any manual test cases that you've created. Manual test cases have a built-in structure that improves the AI's accuracy and help avoid problems with vague or poorly written prompts. Simply 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, it's time to utilize Tosca Agentic Test Automation's test generation capabilities. When generating test cases, you can choose between two different modes:

  • Co-create, the default mode, allows you to verify each autonomous step before it's performed, giving you an opportunity to provide Tosca Agentic Test Automation with feedback or new instructions before running the test step.

  • Autonomous mode is the standard mode where Tosca Agentic Test Automation generates steps in sequence until test generation is completed, without your intervention.

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.

Manage 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 have the option to proceed with the work steps as they are or edit them.

Work steps can only be used 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 and then choose to proceed or edit. While editing, you can delete steps or edit the text directly in the work steps.
  5. When you're satisfied with the work steps, select send.

Examples of test data

These test data examples provide options for natural language and JSON formatting.

Natural language formatting

The following example test data sets use natural language formatting for SAP Fiori applications and web applications.

JSON formatting

The following example test data sets use JSON formatting and cover various permutations and types of fields. Copy and paste this data into a JSON file and then upload it to Tosca Agentic Test Automation.