Create Modules

To create an automated TestCase for the Tricentis Sample Application, you need to create Modules. These Modules contain the required steering information (see chapter "Definition of Terms for the Tosca Commander Objects").

In this tutorial, you perform the following tasks:

  • Build an automated TestCase, which contains data for an automobile.

  • Create an insurance quote for this vehicle data.

To gather this information, you need to create Modules for each screen of the Tricentis Sample Application.

In Tricentis Tosca, we refer to the creation of Modules as scanning.

Tricentis Tosca analyzes the screen contents and searches for steerable items. You can then select the items you need and create a Module. The Module contains all information required for steering the relevant items.

Right-click the folder Modules and select Create Folder from the mini toolbar.

Alternatively, you can select the Modules folder and click Create Folder in the dynamic menu Modules.

Rename the new Module folder to My first Modules.

Right-click the folder My first Modules and select Create Folder from the mini toolbar.

Rename the new Module folder to Vehicle Insurance.

Module folder Vehicle Insurance

Module 1: Start screen (Home)

The first page of the Tricentis Sample Application is the start screen. Tosca always scans the application screen that is currently available so make sure that the start screen is open in your browser.

If you are not on the start screen, click on Home in the submenu of the navigation bar of the sample application to return to the start screen.

Tricentis Sample Application: start screen

Now you're ready to scan this screen.

In Tosca Commander, go to the Modules window and right-click the folder Vehicle Insurance that you created earlier.

Select the option Scan->Application from the context menu.

Alternatively, you can select the folder Vehicle Insurance and click Scan->Application in the dynamic menu Modules.

This opens the XScan window:

XScan window

The Select Application dialog displays all applications that are currently open on your machine.

Click on the tile that shows the Tricentis Sample Application and click on Scan.

Tricentis Tosca scans the screen, which may take a few seconds.

Once the initial scan is done, the XScan window opens in Basic view.

Tosca XScan: Home screen

A click on individual controls in the test object selects or deselects them in the XScan window. To see the name and type of a control in the test object, hover over it with the mouse.

Click on the Automobile link in the Tricentis Sample Application. This highlights the link in blue and adds it to the XScan window.

Highlight items

Rename the root element Tricentis Vehicle Insurance to Home. Tricentis Tosca then saves the Module under Home.

Tosca XScan: selecting the relevant item Automobile of the start screen

In the XScan window, click on Finish Screen.

Tricentis Tosca saves the scan results as the Module Home.

The XScan window stays open, so you can scan the next screen.

Module 2: Vehicle Data

Switch to the Tricentis Sample Application and click on Automobile on the start screen.

The Enter Vehicle Data screen appears:

Vehicle data screen

Now you create a Module for the Enter Vehicle Data screen.

In the XScan window, click on Scan Screen to start the scan.

Scan next screen

In the Tricentis Sample Application, select the items shown in the screenshot below.

Ensure that the icons next to the controls in your scan window are the same as in the screenshot. If an icon looks different, you have selected a different item on the screen.

Tosca XScan: relevant items for the Vehicle data Module

Give meaningful names to the root element and the selected controls.

In the XScan window, click Finish Screen.

Tricentis Tosca saves the scan results as the Module Vehicle Data.

The XScan window stays open, so you can scan the next screen.

Switch to the Tricentis Sample Application, fill out the data as shown in the screenshot below, and click Next.

Enter vehicle data

Module 3: Insurant Data

Clicking Next on the Enter Vehicle Data screen opens the Enter Insurant Data screen:

Insurant data screen (partial view)

Now you create a Module for the Enter Insurant Data screen.

In the XScan window, click on Scan Screen to start the scan.

In the Tricentis Sample Application, select the items shown in the screenshot below.

Give meaningful names to the root element and the selected controls.

Tosca XScan: relevant items for the Insurant Data Module

In the XScan window, click on Finish Screen.

Tricentis Tosca saves the scan results as the Module Insurant Data.

The XScan window stays open, so you can scan the next screen.

Switch to the Tricentis Sample Application, fill out the data according to the screenshot below, and click Next.

Enter insurant data

Module 4: Product Data

Clicking Next on the Enter Insurant Data screen opens the Enter Product Data screen:

Product data screen

Now you create a Module for the Enter Product Data screen.

In the XScan window, click on Scan Screen to start the scan.

In the Tricentis Sample Application, select the items shown in the screenshot below.

Give meaningful names to the root element and the selected controls.

Tosca XScan: relevant items for the Product data Module

In the XScan window, click on Finish Screen.

Tricentis Tosca saves the scan results as the Module Product Data.

The XScan window stays open, so you can scan the next screen.

Switch to the Tricentis Sample Application, fill out the data as shown in the screenshot below, and click Next.

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

Enter product data

Module 5: Quote

Clicking Next on the Enter Product Data screen opens the Price option screen. The quoted prices may differ from the ones shown in the screenshot below.

Price option screen

On this screen, you can choose from various insurance packages. Later on you will create a TestCase that checks the Price per Year ($) of a particular package.

This means that you need to create another Module by scanning the screen.

In the XScan window, click on Scan Screen to start the scan.

For this screen, we use the Advanced View of the XScan.

Click on Advanced in the XScan window.

XScan Advanced Mode

The Advanced View window lists all elements of the Tricentis Sample Application screen. Select the items that are relevant for your Module.

Select the check box next to the items Home and priceTable, and rename the root element to Quote.

XScan: relevant items for the Quote Module

In the XScan window, click on Finish Screen and Close.

Tricentis Tosca saves all Modules to the folder Vehicle Insurance.

You have now created all the Modules you need for your TestCase.

Modules required for the Automobile TestCase

Related chapters