Generate test cases

The Autonomous Testing feature 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.

If you're using multiple monitors, all monitors must have the same resolution.

Prepare the test data file

Before you start generating test cases, you need to create a test data file that tells the AI how to generate actionable test steps. Check out our examples to see test data in JSON and natural language 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 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

To generate test cases, follow these steps:

  1. In the Tosca Agentic Test Automation window, select Generate a TestCase.
  2. Select the application where you want to generate a test case. Please note that test case generation works best with SAP applications.
  3. Tell Tosca Agentic Test Automation what you want to achieve with this test. Be specific, so it can create the most effective test case for your needs.

  4. Select Add test data and upload a test data file. The test data file can be a text file with a size of max 4 MB.

  5. Start the test case generation: 

    • Maximize the window of the application under test.

    • Select .

    • Step away from your mouse. Please don't move your mouse while Tosca Agentic Test Automation generates test cases.

  6. When Tosca Agentic Test Automation is done, select Import to Tosca. You can find your new test cases in the Auto-Generated Tests folder in the project tree.

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.

    Create an SAP sales order

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

Populate an imported test case

Follow these steps to easily populate previously imported test cases in Tosca Agentic Test Automation:

  1. Go to an imported test case that you want to open in Tosca Agentic Test Automation.

  2. Right click on the test case and hover over Tosca Agentic Test Automation, then select Populate this TestCase.

    Menu path with Populate this TestCase option

  3. Tosca Agentic Test Automation opens, begins the test case generation flow, and prompts you to select the relevant application on your machine.

  4. Next, Tosca Agentic Test Automation attaches any data from the imported test case and populates the test case description in the command line.

  5. Select to watch the autonomous testing feature complete the test.

Examples

These examples provide options for natural language and JSON formatting.

Natural language formatting

These examples cover prompts and test data for an SAP Fiori application and a web application.

JSON formatting

These example test data sets 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.