Define activities

A business flow defines activities and paths through your application. You'll use those paths to automatically generate test cases, which speeds up test authoring and reduces maintenance.

Activities are your business flow's starting point. They specify what users can do in your application and how these actions connect. This topic guides you through all activity-related tasks: mapping them out, preparing the necessary artifacts, and then linking everything together, so you can define what exactly happens in your activities.

Before you start

To define activities, you need to have the following: 

Also, if you're not familiar with them already, we recommend that you check out key concepts and best practices of business flows.

Map out activities

Your first step is to map out the tasks users can do in your application and how they're connected. To do so, add activities to your business flow.

Understand activity types

To create meaningful, end-to-end scenarios, you'll use different types of activities:

  • Activities with data, which are activities that use your test data at runtime. For example, entering customer information into a form or verifying information. Don't worry, you can also have non-data elements in activities with data. For example, if you want to enter customer information into a form and then select a button.

  • Activities without data, which are activities that don't require any test data at all. This type of activity typically covers navigating or preparing the application. For example, opening the application, clicking through menus, or setting up the environment for the data-driven parts of the business flow.

Add activities

To add activities to your business flow, follow these steps: 

  1. Choose the right activity:

    • To add an activity with test data, select Add activity.

    • To add an activity without test data, select Add activity without data.

  2. Give each activity a unique name. We also recommend that you add a brief description, to keep a good overview while you're mapping out the flow.

  3. Define how your activities connect. To do so, create arrows between the activities' circle elements.

    Note that Tosca Cloud doesn't support loops, where you connect an activity to an earlier activity to restart a particular sequence.

  4. Once you have all the activities you need, add the End node and connect your business flow to it.

Simplified example business flow for registering customers. The flow shows multiple activities and a fork.

Click to enlarge: Example business flow with activities

Prepare the necessary artifacts

You've mapped out your activities. So far, so good! Now, you need to prepare your artifacts. You will later link those artifacts to your activities, to define what exactly happens in your activities. 

These are the artifacts you need to prepare:

Define what happens in activities

Once you've mapped out your business flow and prepared your artifacts, you're ready to define what happens in each activity:

  1. For activities with data, specify the test data you want to use in your activity. To do so, select Link data and perform the following actions:

    • Select a data set from the dropdown. Don't worry about subsets at this stage—you'll choose a subset when you define your paths.

    • Select Save.

  2. To specify the test actions of an activity, select Link reusable test step. Then, perform the following actions:

    • Select a reusable test step from the dropdown.

    • For activities with data, fill out the Business parameters section. In each row, select the test data column that contains the data you want to use here.

    • Select Save.

Example

In this example, you want to specify what happens in an activity with data called Register customer.

Activity with the name 'Register customer' and the description 'Enter customer data and click Register'.

Empty activity called Register customer

With this activity, you want to enter customer data into the following screen in your application:

Registration screen with multiple textboxes (first name, last name, email), a combobox (visitor type), and a button (register).

Controls on the registration screen

You've already scanned your application and created a module called Registration screen. This module covers the following controls

  • The textboxes called First name, Last name, and Email.

  • The combobox called Visitor type.

  • The button called Register.

Details view of module 'Registration' screen

Module for the registration screen with all controls

You also have a data set called My data set. In this data set, various columns contain the necessary data for the registration screen:

Example data set with columns called First name, Last name, Email, and Visitor type.

Example data set

At runtime, Tosca Cloud should enter the data from My data set into all textboxes and the combobox. Then, select the Register button.

To make this possible, you perform these steps:

  1. Define which data you want to use in this activity. To do so, you select Link data and then specify that you want to use My data set

    This adds the data set to the activity.

Activity Register customer is linked to the data set My data set

  1. Create a reusable test step with the module Registration screen. This reusable test step contains the following:

    • Business parameters for all controls that require test data. You call them FirstName, LastName, Email, and VisitorType.

    • References to these business parameters.

    • A click operation for the Register button.

Reusable test step with controls, business parameters, and references to the parameters in the controls.

Reusable test step with business parameters and references

  1. Link the reusable test step to your activity. To do so, you select Link reusable test step and choose your reusable test step.

    When you fill out the Business parameters section, you define which column in My data set has the data you want to use for a particular control.

Linking screen for reusable test steps. 3 business parameters already have columns selected, 1 business parameter shows the dropdown with all columns in the data set.

Linking a reusable test step to an activity with data

And that's it! You now have an activity that contains test actions and specifies the test data for these actions.

Activity 'Register customer' with UI indicators that the activity is linked to test data and a reusable test step.

Activity with linked test data and reusable test step

What's next

You have a business flow that defines the activities in your application. Excellent! Time to define possible paths through your business flow, which you'll use to generate test cases.