Activities

The activities form the basis of a workflow - they contain the actions to be executed.

The existing activities are currently divided into three categories

  • Process: Contains drain modules such as pauses and loops
  • Modules: Contains the standard activities and Web activities.
  • Project: Used to manage the open project and the playlist in it.

Overview

The activities form the basis of a workflow - they contain the actions to be executed.

The available setting options vary depending on the selected block and are displayed in the Properties window.

The following figure shows an example of how the duration of a pause is adjusted. Further options for entering values in the properties can be drop-down menus and check boxes in addition to the text box shown. If the configuration is incorrect or missing, execution errors may occur.

_images/Properties.png


Variables

Overview

A variable defined by you - you can define its data type, its identifier and its value - used for conditions.

Example

1. Click on the tab “Variables” within the workspace:

_images/tws_variablecreation.png

The area for managing the created variables opens.

2.Now click on the text “Create Variable” to add a variable.

_images/tws_createVariable.png

The variable gets the properties specified above (int32 for a number and counter as label) and a default (start value) of 1 . Now we can work with this variable.

In this way, variables can also be used as properties.

First, a variable is created in the desired context. Variables are always passed on in deeper/internal sequences, but never in higher/external sequences.

The variable “buildVersVar” shown in the following example graphic should contain a desired build version number. In order to create this variable in the context “Execute on AgentB”, this sequence is selected and the variable management is opened with the button “Variables” (bottom left in the following figure). Here the value of the variable is specified as VisualBasic expression in addition to the name of the variable.

_images/VarScope.PNG

After creating the variable, the desired test case activities are selected and the variable name is entered as the value of the desired property (see following figure).

_images/BuildVersionAlsVariable.PNG


Properties

The properties are the settings of the activities. Here you have the option of adapting the activities to suit your requirements. Not every activity has the same properties - while for a “Start Browser” activity you have to define which browser should be used for the execution - this setting is not relevant for a “Click on Element” activity or a “Scroll” activity.

Activities that have properties which must be defined before execution are indicated by an icon on the activity within the workspace for you:

_images/AktivitaetEigenschaften.png

Other

This setting has no effect on the functionality of the activity and is used only for improved overview in workspaces.

Display Name: The display name of the activity within the workflow. Each activity has this setting.

Identification

Identification type

The identification types specify how the element can be uniquely identified during execution. Every activity that must be executed at a certain position (click on activity) or also requires a start and end point (select text activity, drag and drop on activity) has this property and must be defined for execution.

There are two options to choose from:

XPath (XML Path Language): An identification value within a tree structure. Elements to be identified are identified by their node and axis points within this tree structure.

This value is created automatically when you record web tests, but if you need the XPath of an element to manually create a workflow, you can copy it in browsers such as Chrome using debugging mode.

  1. Visit the page on which the item you are looking for is located
  2. Open the debugging mode
  3. Select the element you are looking for using the Inspect element function (Ctrl + Shift + C and then mouse click)
  4. Right-click in the now highlighted text of the source code and select “Copy” and then “Copy XPath
ID An identification value corresponding to a unique “ID”. The element must therefore have a clear and unique ID (e.g. in HTML code).

Writing to variables

Under the category “writing to variable”, results of activities - such as console input or attribute readout - are stored in variables created by you in the TWS. These variables can then be used in other areas of the studio, such as queries, loops, or console outputs.

variable name The name of the variable created in the studio. The recorded value will be written to this variable.

Timeout

Activities have their own timeout, which you can also define and overwrite yourself.

Timeout in this sense only means that you give an activity only a certain time period to be executed - if this does not happen, TWS will regard the execution of this activity or the workflow containing this activity as faulty and will inform you accordingly in the test results.

The TWS default timeout is usually 5 seconds unless you overwrite it otherwise.


Flow elements

The TWS allows you to query logical conditions with various activities and, depending on the result of the condition, to describe variables or execute activities or subworkflows that you have defined.

The basis for querying logical conditions in the Studio is made up of three components: While Loop: In most computer programming languages, a while loop is a control flow statement that allows code to be repeated based on a particular Boolean condition The If query: In programming, a conditional instruction is a program section that is only executed under a specific condition. A branch determines which of two (or more) program sections is executed depending on one (or more) conditions. The variable: A variable defined by you - with a specific data type, identifier, and value - required for conditions.

However, both of these components require a condition (the logical condition) for their execution - that is, they require variables that you can compare to a specific value using logical operators.

Logical operators Comparison
> greater than
< less than
>= greater or equal
<= less or equal
= equal
<> not equa
And and
Or or
Not not

In the Studio, you can create variables for this purpose and assign values to these variables either yourself or automatically using assignment activities. When creating variables, you can determine the variable name and variable type - this is important for later comparisons.

In order to explain this function to you, we will proceed on the basis of a simple example - assuming we want to run a single workflow 10 times without manually pressing the “Execute” button each time - we can easily do this with the help of a variable and a While loop:


While-Loop

Description

A container that can contain activites or more containers. Is used for repeated running of activites and declared with an exit-condition to break the running of the loop.

Properties

Property Type Mandatory Description
Skip activity Boolean Optional Activity is to be skipped during execution.
Condition VB-expression Mandatory The condition that exits the loops.
DisplayName String Optional The displayname of the activity in the workspace.

Example

To insert a While loop in a workflow, proceed as follows:

1. Under the tab “Process” you will find the activity “While loop” - drag it into the workflow.

_images/tws_whileLoop.png

2. Define a condition to end the loop with (see “Condition” field on screenshot)

The condition counter <= 10 means: Run the loop as long as the variable “counter” is less than or equal to 10*.The variable used in the condition must have been created!

3. Drag an assignment activity from the toolbox into the loop.

In the assignment activity you now write the name of the variable you want to work with in the left field and the actual assignment in the right field - in our example we want to increase the variable “counter” by 1 at the end of each run, so we add +1 to the variable “counter” each time (counter = 1+1, counter = 2+1 etc.).

The loop is a so called container - so it can contain further activities. Now add your desired activities. These activities are executed ten times when the workflow is executed and automatically when the final condition is reached.


If

Description

A logical query that queries a condition and, depending on the result of the query, a particular sequence or activity is executed.

Properties

Property Type Mandatory Description
Other
Skip activity Boolean Optional Activity is to be skipped during execution.
Condition VB-Expression Mandatory The condition to decide which activity-tree to run.
DisplayName String Optional The displayname of the activity in the workspace.

Sequence

Description

The sequence is a container that can contain several activities, workflows or other containers.

Properties

Property Type Mandatory Description
Other
Skip activity Boolean Optional Activity is to be skipped during execution.
DisplayName String Optional The displayname of the activity in the workspace.

Parallel

Description

A container similar to the sequence - only several elements can be arranged in parallel in the parallel module to run them at the same time.

Properties

Property Type Mandatory Description
Other
Skip activity Boolean Optional Activity is to be skipped during execution.
DisplayName String Optional The displayname of the activity in the workspace.

Delay

Description

A delay with a user-defined duration. During this time, the execution of the workflow stops.

Properties

Property Type Mandatory Description
Other
Skip activity Boolean Optional Activity is to be skipped during execution.
Duration TimeSpan Optional The duration of the delay (in ms).
DisplayName String Optional The displayname of the activity in the workspace.

Delay 2-25 Seconds

Description

A delay with preset durations from 2 to 25 seconds. During this time, the execution of the workflow stops.


Assign

Description

An activity to assign values to created variables.

Properties

Property Type Mandatory Description
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
To VB-Expression Optional The name of the variable that should be written into.
Value VB-Expression Optional The value that will be written into the variable.

Standardactivites

Run on Agent

Description

This activity specifies which capabilities agents require to run this workflow.

Properties

Property Type Mandatory Description
Configuration
Capabilites String Optional The capabilities that are required to run the workflow.
Role String Optional ....
Other
DisplayName String Optional The displayname of the activity in the workspace.

Execute command line

Description

The internal command line of the system that can be run with commands or user-login data.

Properties

Property Type Mandatory Description
Output
Result String Optional The result of the command.
Input
Output on agent Boolean Optional Specifies if output will be shown in the agent.
Command String Optional The displayname of the activity in the workspace.
User name String Optional Username - if the command requires it for extra rights.
Password String Optional The password for the username.
Encode password bool Optional When checked, the password will be encoded and saved as a token.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.

Run PowerShell

Description

The Windows-PowerShell can be run with commands or user-login data.

Properties

Property Type Mandatory Description
Output
Result String Optional The result of the command.
Input
Output on agent Boolean Optional Specifies if output will be shown in the agent.
Command String Optional The displayname of the activity in the workspace.
User name String Optional Username - if the command requires it for extra rights.
Password String Optional The password for the username.
Encode password bool Optional When checked, the password will be encoded and saved as a token.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.

Commandline output

Description

Output of a specified text or specified value of a variable inside the console.

Properties

Property Type Mandatory Description
Output
Result String Optional Result of the output.
Input
Text/Variablename String Mandatory Value/Name of variable that will be put out.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.

Console input

Description

Input of value inside the console and writing the input to a variable.

Properties

Property Type Mandatory Description
Output
Result String Optional The result of the input. Will be written to specified variable.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.

TimeGuard

Description

The activity container “TimeGuard” can be used to define a maximum time span for the activities in it to be executed. In contrast to a simple timeout, TimeGuard is not a single activity, but a so-called container that can contain other activities.

If this defined period of time is exceeded, the execution will be evaluated as faulty, as with the timeout, and you will be notified accordingly in the test results.

Properties

Property Type Mandatory Description
Output
Max.Duration Int32 Optional Duration of the Timespan (in seconds) which activites inside the container can take to finish.
Other
DisplayName String Optional The displayname of the activity in the workspace.

Example

If you have created a workflow, you can insert a TimeGuard into your workflow and insert activites into the timeguard - since its a container.

You can define the maximum duration the activites are allowed to take to finish. When running a workflow containing activities inside a timeguard the studio will check if these activites have run successfully in a specified time - the maximum durations that you specified.

_images/TimeGuardOutputSuccess.png

Succesfull run.

_images/TimeGuardOutputFailure.png

Failed run.


Web-standard activites

Start Browser

Description

Starts a browser with a specified url with optional popup blocking. In this version popup blocking is only supported by the Chrome browser.

Properties

Property Type Mandatory Description
Http-basic-authentification
Username String Optional The username used in the basic-authentification dialog.
Password String Optional The password used in the basic-authentification dialog.
Encode password bool Optional When checked, the password will be encoded and saved as a token.
Input delay Int Optional The input delay for the basic authentification data (seconds).
Browser configuration
Browser BrowserType Mandatory The browser that will be started.
URL String Mandatory The url that will be opened.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Cookies String Optional (Chrome) Sets the cookies to be injected in the browser (format see below table).
Skip activity Boolean Optional Activity is to be skipped during execution.
Use Popup-blocker Boolean Optional (Chrome) Enable popup blocking.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Cookies: Cookies are to be entered in the format “CookieName1 CookieValue1; CookieValue2 CookieWert2; … ; CookieNameN CookieValueN”


Close Browser

Description

Closes the browser that has been started by TWS.

Properties

Property Type Mandatory Description
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.

Hover move

Description

A hover movement onto a specified element - needed to interact with elements like drop-down menus when running workflows.

Properties

Property Type Mandatory Description
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Elementname String Optional The name of the element that will be clicked.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Click on Element

Description

A mouse click onto a specified element.

Properties

Property Type Mandatory Description
Http-basic-authentification
Username String Optional The username used in the basic-authentification dialog.
Password String Optional The password used in the basic-authentification dialog.
Encode password bool Optional When checked, the password will be encoded and saved as a token.
Input delay Int Optional The input delay for the basic authentification data (seconds).
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Elementname String Optional The name of the element that will be clicked.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Click in

Description

A mouse click into an element - e.g. to activate a text field.

Properties

Property Type Mandatory Description
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Elementname String Optional The name of the element that will be clicked.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Enter text

Description

Input of text into a specified web-element. Needs to be used together with a click in activity since it has no identifier.

Properties

Property Type Mandatory Description
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Text
Text String Optional The text to be entered.
Encode text bool Optional When checked, the text will be encoded and saved as a token.
Take Screenshot Boolean Optional Take a screenshot of the browser in case of error.

Scroll

Description

Eine custom scroll movement on a website.

Properties

Property Type Mandatory Description
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Scroll Properties
Direction ScrollType Optional The direction of the scroll movement.
Offset Int32 Optional The value of the offset that will be scrolled (in pixel).
Other
DisplayName String Optional The displayname of the activity in the workspace.
Elementname String Optional The name of the element that will be clicked.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Mark text

Description

Marking of specified text from html-elements - for example to copy it.

Properties

Property Type Mandatory Description
Identification
Timeout Int32 Optional Duration in seconds before the activity times out.
Identification start element
Starting point String Mandatory Value of the XPath or the id.
ID-Type Startelement EnumIdentifierType Mandatory Xpath or id of the web-element.
Identification end element
End point String Mandatory Value of the XPath or the id.
ID-Type Endelement EnumIdentifierType Mandatory Xpath or id of the web-element.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Drag and Drop onto element

Description

Drag and drop of web-elements. Used to interact with html-elements when running workflows.

Properties

Property Type Mandatory Description
Identification
Timeout Int32 Optional Duration in seconds before the activity times out.
Identification start element
Starting point String Mandatory Value of the XPath or the id.
ID-Type Startelement EnumIdentifierType Mandatory Xpath or id of the web-element.
Identification end element
End point String Mandatory Value of the XPath or the id.
ID-Type Endelement EnumIdentifierType Mandatory Xpath or id of the web-element.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Elementname String Mandatory The name of the element that's interacted with.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Press Function-Key

Description

Pressing a function-key.

Properties

Property Type Mandatory Description
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Selenium
Number of Key presses Int32 Optional How often the function key will be pressed.
Function key String Mandatory The specified funktion key that will be pressed.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Elementname String Optional The name of the element that's interacted with.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Keyboard shortcuts

Description

Pressing keyboard shortcuts - such as Ctrl + C to copy elements.

Properties

Property Type Mandatory Description
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Key shortcut
Prefix Ctrl Boolean Optional Activated if Key shortcut has to be pressed with ctrl.
Suffix Key ShortCutSuffixType Mandatory Suffix Key (c, v, a..).
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Validate HTML-Element

Description

The validation of HTML elements - e.g. the validation of certain text parts on a web page.

Properties

Property Type Mandatory Description
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Validation
Validation-attribute String Optional Default attribute is "innerText".
Validation-value String Optional The value of the innerText that will be validated.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.
Cancel on failure Boolean Optional Determines if workflow run will cancel on failure.

Choose Option

Description

Selecting options in an HTML element - for example, a menu with multiple choices.

Properties

Property Type Mandatory Description
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Selection
Selection String Optional The value that will be choosen.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Resize Browser

Description

Changing the window size of the browser opened by TWS.

Properties

Property Type Mandatory Description
Width
Width Double Optional The new width of the window (in px).
Height
Height Double Optional The height of the window (in px).
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Close tab

Description

Closing a tab in the browser opened by TWS.

Properties

Property Type Mandatory Description
Browser-configuration
Tab Int32 Optional The index of the tab that will be closed.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Change tab

Description

Switch tabs in the browser opened by TWS.

Properties

Property Type Mandatory Description
Browser-configuration
Tab Int32 Optional The index of the tab that will be switched into.
URL String Mandatory The url that will be opened.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.

Read attribute

Description

Reads out a specific attribute from HTML-elements.

Properties

Property Type Mandatory Description
Auslesen
HTML-attribute String Mandatory The html-attribute that will be read out (class, innerText etc.).
Identification
Identification type EnumIdentifierType Mandatory Identification type of the web-element (Xpath or id).
Identification value String Mandatory Identification value of the web-element.
Timeout Int32 Optional Duration in seconds before the activity times out.
Other
DisplayName String Optional The displayname of the activity in the workspace.
Skip activity Boolean Optional Activity is to be skipped during execution.
Write to variable
Variable name String Optional The name of the variable that will be written into.
Take screenshot Boolean Optional Take a screenshot of the browser in case of error.