Create the demo TestCase

This chapter describes step 2 in the Tricentis Tosca First Steps Tutorial.

What will you do?

You will create your TestCase, using the Modules you created when you scanned the demo application.

Why is that important?

A TestCase is a sequence of actions that you want to perform on your system under test. These actions are called TestSteps.

By designing your TestCase, you tell Tricentis Tosca what to do:

  • What is the sequence? What should happen when?

  • What exactly should each TestStep do?

For more information on creating TestCases, see chapter "Create and manage TestCases".

Design process

In this tutorial, you create a TestCase that checks whether the insurance website calculates a correct quote for the data that you enter.

To design this TestCase, follow the steps below:

  1. Create a new folder for your TestCase:

Create a new TestCase folder via the mini toolbar

  1. Rename the new folder to Vehicle Insurance.

  2. Create a new TestCase. To do so, right-click the Vehicle Insurance folder and select Create TestCase from the mini toolbar.

    Alternatively, you can select the Vehicle Insurance folder and click on Create Object in the TestCases menu. For more information on ribbon and context menus, see chapter "Tosca Commander menus".

  3. Rename the new TestCase to Automobile Quote.

Now it's time to create TestSteps from your Modules.

If you need to use decimal numbers in a TestStep, use a dot as a decimal separator.

Create TestStep 1 with Module Home

As a first step, Tricentis Tosca should click on Automobile on the demo application start screen. This starts the quoting process for automobiles.

For this, you will use the Module Home.

  1. Create a TestStep from the Module Home. You can do so in the following ways:

    • Go to the Modules tab. Drag the Home Module onto to the TestCases tab until the TestCases tab is active. Then drop the Module onto the Automobile Quote TestCase.

    • Select the TestCase and press CTRL + T. This opens the Fuzzy Search window, where you can search for the Home Module. Once you've found it, press Enter to use the Module in your TestCase.

Create a TestStep with the Fuzzy Search

Tricentis Tosca creates a new TestStep from the Module. It uses the name of the Module as the name of the TestStep.

The Details tab of Tosca Commander shows all TestStepValues of a TestStep. Each control that you selected during the scan is its own TestStepValue.

TestStepValue icons are grayed out until you fill out the TestStepValues.

Newly created TestStep Home

  1. Fill out the TestStepValue. This tells Tricentis Tosca what to do with this control.

    In the first TestStep, you want Tricentis Tosca to click on Automobile. To do so, select {Click} from the drop-down menu in the Value column.

    For more information on click operations, see chapter "Click operations".

    Alternatively, you can enter x into the Value column. In this case, Tricentis Tosca performs a left-click without the mouse.

Select a click operation from the Value drop-down menu

  1. Take note of the column ActionMode. ActionModes tell Tricentis Tosca what to do with the value you entered (see chapter "ActionModes").

    In this case, Tricentis Tosca automatically adds the ActionMode Input, since you defined an input action.

TestStep Home with filled-out TestStepValue

And that's your first TestStep!

The TestStep and the corresponding Module are linked. You can jump from the TestStep to the Module. To do so, right-click a TestStep and select Jump to Module from the context menu, or use the Jump to Module button in the TestCases menu.

Create TestStep 2 with Module Enter Vehicle Data

In this TestStep, Tricentis Tosca should enter data into the Enter Vehicle Data page of the demo application and then click Next.

For this, you will use the Module Enter Vehicle Data.

  1. Create another TestStep for the TestCase Automobile Quote. You can do so in the following ways:

    • Drag and drop the Module Enter Vehicle Data onto the Automobile Quote TestCase.

    • Press CTRL + T to use the Fuzzy Search.

  2. Fill out the TestStepValues as shown in the screenshot below.

TestStep Enter Vehicle Data with filled-out TestStepValues

Create TestStep 3 with Module Enter Insurant Data

In this TestStep, Tricentis Tosca should enter data into the Enter Insurant Data page of the demo application and then click Next.

For this, you will use the Module Enter Insurant Data.

  1. Create a TestStep from the Module Enter Insurant Data.

  2. Fill out the TestStepValues as shown in the screenshot below.

TestStep Enter Insurant Data with filled-out TestStepValues

As you can see, this TestStep has more TestStepValues than you currently need.

Press F9 to hide all do-nothing TestStepValues, or click Hide DoNothing in the View menu. This helps you to keep a good overview of complex TestSteps.

To show do-nothings again, press F9 or click Show DoNothing in the View menu.

Create TestStep 4 with Module Enter Product Data

In this TestStep, Tricentis Tosca should enter product data into the Enter Product Data page of the demo application and then click Next.

For this, you will use the Module Enter Product Data.

  1. Create a TestStep from the Module Enter Product Data.

  2. Fill out the TestStepValues as shown in the screenshot below.

The Start Date must be at least two months in the future. You may need to pick a different date.

TestStep Enter Product Data with filled-out TestStepValues

Create TestStep 5 with Module Select Price Option

This is the final TestStep of your TestCase.

With this TestStep, Tricentis Tosca should verify whether the insurance website gives the expected quote for the given data.

For this, you will use the Module Select Price Option.

  1. Create a TestStep from the Module Select Price Option.

    This TestStep looks a little different: it has a table element. Each table element consists of the attributes Row, Col, and Cell. Use these attributes to tell Tricentis Tosca:

    • Which cell within the table you want to steer.

    • What exactly Tricentis Tosca should do with the cell.

    For more information on table steering, see chapter "Table".

Expanded table element in the Select Price Option TestStep

  1. Identify the cell that you want to steer.

    In this case, you are looking for a cell with the following characteristics:

    • It is in the first row after the header row.

    • It is in the column with the header Platinum.

The cell you want to steer

  1. From the <Row> drop-down menu, select $1.

    This tells Tricentis Tosca to look at the first row after the header row.

Specify the row

  1. From the <Cell> drop-down menu, select Platinum.

    This tells Tricentis Tosca to look at the cell in the column Platinum within the specified row.

Specify the cell within the row

  1. Now tell Tricentis Tosca what to do with the identified cell.

    • You want to check whether the demo application generates the expected quote for the Platinum package. The price of the Platinum package is $360.00.

      Enter 360.00 into the Value column.

      If your Price per Year ($) is different, enter the value that the demo application calculated when you created your Modules.

    • Use ActionMode Verify.

      This tells Tricentis Tosca to verify whether the Price per Year ($) that the demo application calculates with the given data is, in fact, $360.00.

Verify whether the demo application calculates the correct price for the Platinum package

What's next

Congratulations, you have a TestCase! You're ready for chapter "Run the demo TestCase".