Run the demo TestCase

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

What will you do?

You will first do a trial run of the demo TestCase that you created. And then you will execute the TestCase.

Why is that important?

Trial runs let you check if your TestCase would work. You can try out an entire TestCase, or you can try out individual elements before the TestCase is complete. Trial runs are also useful if you want to examine failing TestCases.

However, Tricentis Tosca does not save the results of trial runs. If you try out a TestCase twice, the second result overwrites the first.

To keep results of all runs, you need to execute your TestCase.

For more information on running tests, see chapter "Execute tests".

At run-time, Tricentis Tosca takes control of your mouse and keyboard to interact with the demo application.

Don't try to perform mouse clicks and keyboard inputs during this time.

Perform the trial run

For trial runs, you use the ScratchBook functionality of Tricentis Tosca.

Let's try out the Enter Product Data TestStep. In this TestStep, Tricentis Tosca should enter information on the desired insurance package into the demo application and then click Next.

To do this, follow the steps below:

  1. Open the demo application in Microsoft® Internet Explorer (see chapter "What you need for this tutorial").

  2. Go to Automobile->Enter Product Data.

    Since Tricentis Tosca should interact with this page, it must be open before you trigger the run. If you want to see what a failing run looks like, don't open the demo application and proceed with step 3.

  3. In Tosca Commander, right-click the Enter Product Data TestStep and select Run in ScratchBook from the context menu.

    Alternatively, you can select the Enter Product Data TestStep and press F6, or you can click on Run in ScratchBook in the TestCases menu. For more information on ribbon and context menus, see chapter "Tosca Commander menus".

Trigger the trial run of the Enter Product Data TestStep via context menu

This triggers the trial run of the TestStep. You can now watch Tricentis Tosca as it fills out the form and clicks the Next button.

Check your results

Once the trial run is complete, the ScratchBook window opens and shows the result. Expand Enter Product Data to see the result of all TestStepValues.

Result of the trial run

For comparison, this is the result of the trial run if you don't open the demo application. The Loginfo column displays the reason why the trial run failed.

For more information on execution columns, see chapter "Relevant columns for execution".

Failed result in the ScratchBook

Execute your TestCase

Now let's run the TestCase. You run your TestCases in the Execution tab of Tosca Commander.

This is where you organize your TestCases into ExecutionLists. ExecutionLists determine the sequence in which Tricentis Tosca executes your tests (see chapter "Set up test execution").

To run the demo TestCase, follow the steps below:

  1. Create a new folder for your ExecutionList:

Create a new ExecutionList folder via the mini toolbar

  1. Rename the new folder to Vehicle Insurance.

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

    Alternatively, you can select the Vehicle Insurance folder and click on Create Object in the ExecutionLists menu.

  3. Rename the new ExecutionList to Automobile.

  4. Create an ExecutionEntry from your TestCase. To do so, drag and drop the TestCase:

    • Go to the TestCases tab.

    • Drag the Automobile Quote TestCase onto the Execution tab until the Execution tab is active.

    • Drop the TestCase onto the Automobile ExecutionList.

Tricentis Tosca creates a new ExecutionEntry from the TestCase.

The TestCase and the corresponding ExecutionEntry are linked. You can jump from the ExecutionEntry to the TestCase. To do so, right-click an ExecutionEntry and select Jump to TestCase from the context menu, or use the Jump to TestCase button in the ExecutionLists menu.

Newly created ExecutionEntry in the Automobile ExecutionList

Now it's time to run the test.

  1. Open the demo application in Microsoft® Internet Explorer.

    Tricentis Tosca should steer the demo application. So before you trigger the execution, the site must be open at the page where the first TestStep starts. In this case, the demo application start screen.

  2. Trigger the execution. To do so, right-click the ExecutionList and select Run from the context menu.

    Alternatively, you can select the ExecutionList and press F6, or click on Run in the ExecutionLists menu.

Trigger the execution via context menu

This triggers the execution of all ExecutionEntries in the ExecutionList. In this case, there is only one.

If you have multiple ExecutionEntries, you can choose to run individual ExecutionEntries. You can also choose to run all ExecutionEntries on the list, starting with a specific one. For more information, see chapter "Execute automated tests".

Check your results

Once the run is complete, you can view your results in the Details tab:

  • The ActualLog of the ExecutionList shows the current results of the entire ExecutionList.

    Since the ExecutionList only has one ExecutionEntry, the ActualLog displays the number 1. This ExecutionEntry passed successfully, so the entire bar is green.

  • Underneath is the ExecutionEntry Automobile Quote with its own log. This log indicates the result for this ExecutionEntry.

  • Underneath the ExecutionEntry are the TestSteps. You can expand a TestStep to see the TestStepValues.

For more information on execution results, see chapter "Work with execution results".

Execution results

Get familiar with the results view

To give you a better idea of how Tricentis Tosca displays results, we'll now create multiple ExecutionEntries that produce different results.

To do so, follow the steps below:

  1. Create a new folder for your TestCase:

  2. Rename the folder to Quotes.

  3. Copy the TestCase Automobile Quote and paste it into the Quotes folder.

  4. Rename the TestCase in the Quotes folder to Automobile Quote 1.

  5. Copy and paste Automobile Quote 1 into the same folder, four times in total.

    You don't need to change the names when pasting. Tricentis Tosca automatically numbers them consecutively.

    In the end, your TestCases tab should look like this:

New TestCase folder and TestCases

Now you need to modify the TestCases, so you can run the same TestCase multiple times in succession.

Currently, the TestCase starts on the demo application start page, where Tricentis Tosca clicks on Automobile.

The TestCase ends on the Select Price Option page, where Tricentis Tosca verifies the package price.

If you run the same TestCase immediately after, it will fail at the first TestStep, because the demo application is open at the wrong page.

  1. In the TestCase Automobile Quote 1, copy and paste the TestStep Select Price Option.

  2. Rename the copy of the TestStep to Select Price Option_2.

  3. In the Select Price Option_2 TestStep, perform the following actions:

    • For the TestStepValue Home, enter the value {Click}.

    • Select the priceTable element and press Del. This removes the table steering from this TestStep.

TestStepValues for the TestStep Select Price Option_2

  1. Copy the TestStepValue Select Price Option_2 and paste it to the other TestCases in the Quotes folder.

    At run-time, Tricentis Tosca uses Select Price Option to verify the package price.

    With Select Price Option_2, Tricentis Tosca returns to the demo application start page, where the next TestCase picks up.

  1. Create ExecutionEntries out of your TestCases.

    To do so, drag and drop the Quotes folder onto the Automobile ExecutionList.

This creates an ExecutionEntry folder in the ExecutionList.

The ActualLog of the ExecutionList now shows the following information:

  • A green bar with 1 that indicates the ExecutionList has one ExecutionEntry that passed.

  • A white bar with 5 that indicates five ExecutionEntries in the list that have not been executed.

Updated ExecutionList with ExecutionEntry folder Quotes

Since we want to see different results in the Execution tab, break your TestCases.

  1. In the TestCases tab, go to TestCase Automobile Quote 3.

  2. For the TestStep Select Price Option, enter a new package price. You can pick any price; we want this TestStep to fail.

Set up TestCase Automobile Quote 3 for failure

  1. Delete TestCase Automobile Quote 5.

  2. Tricentis Tosca displays a warning message. Click OK to confirm the deletion.

In the Execution tab, the ActualLog of the ExecutionList now displays a gray bar with 1. This indicates an ExecutionEntry whose linked TestCase no longer exists.

Tricentis Tosca also marks the ExecutionEntry itself: No TestCase assigned.

Details tab of the Automobile ExecutionList after deleting a TestCase

  1. Open the demo application in Microsoft® Internet Explorer.

  2. Execute your tests. To do so, perform the following actions:

    • Go to the Execution tab.

    • Right-click the Quotes ExecutionEntry folder and select Run from the context menu.

    Alternatively, you can choose to set results manually as described in chapter "Set test results manually".

Once the execution is complete, the Details tab of the ExecutionList displays the results.

Expand objects to see error messages. You can also right-click an object in the Details tab and select Expand all from the mini toolbar.

Results of the Quotes ExecutionEntry folder

By default, Tricentis Tosca shows results in single-line view. To switch to multi-line view, go to the View menu and click on ExecutionList->Show multiline logs. If the view doesn't change immediately, try to widen the column a little.

  1. Run the Quotes ExecutionEntry folder again.

    Tricentis Tosca creates a new log for each ExecutionEntry. The log history is sorted by date and time, descending.

Multiple logs for each ExecutionEntry in the Quotes folder

And this is it! Congratulations, you have successfully completed the First Steps Tutorial.