Workflows

Recording of workflows

The recording of a workflow in the studio can be found in the chapter Recording->Recording Workflows


Create workflow manually

Workflows can of course not only be recorded, but also completely designed by hand. You can use the activities in the left toolbar to do this.

These activities are divided into three categories: Process: These activities can be used in any kind of workflow (web, desktop, mobile). With them you can create logical queries (e.g. run conditions, or While loops), as well as insert execution pauses at certain points of the workflow. Standard activities: These activities can be included in any type of workflow in the same way as the process activities. These activities are used, for example, to specify the capabilities an agent must have to execute a workflow or to start a PowerShell and execute commands there. Standard Web Activities: These activities can only be used in Web workflows. Here you can find all common Web activities, such as starting and closing a browser, clicking an item, or typing text.

You can add the desired activities to a workflow at any time at the desired location. To do this, click on the activity and drag it to your work area while holding down the mouse button. In order to use these activity activities it is necessary to configure them accordingly - via the respective properties.

So a “Start Browser” activity must know which browser to start and which URL to call - without these properties a workflow cannot be executed.


Extract into sequences

To increase the overview and an improved logical arrangement of your worklow, the Studio offers you the possibility to rearrange your activities and activity containers by the function “Extract in Sequence”.

To extract activities into a sequence, select the desired activities (hold down the Ctrl key and select individually or drag a border around them) and right-click on one of the selected activities - the new sequence with the contained activities will be created here.


Deactivate activities

Deactivated activities can affect the correct execution of a workflow.

Individual activities or overlying sequences that contain additional activities can be easily deactivated in the Studio. This setting can either be set in the properties window of the respective activity or you can activate or deactivate the activity by right-clicking on the activity in the workspace.

Deactivated activities are skipped rather than ignored when a workflow is executed. Both the studio’s test results and the export of the test results will flag these skipped activities accordingly.


Create partial workflow

To increase the clarity of the workflow or to be able to reuse individual activities, activities can be saved as partial workflows. To do this, the required activities must be selected.

_images/CreateSubWorkflow.png

und auf einen bestehenden Workflow-Ordner in der Toolbox gezogen werden. Daraufhin kann man dem eben erzeugten Workflow einen Namen zuweisen und diesen für den weiteren Testentwurf nutzen.

_images/AddSubWorkflow.png


Create workflow playlist

The playlist defines the workflows to be executed from the solution and is saved as .twp. This is created in JSON format and contains the paths to the workflows relative to the playlist file. The specified workflows are then executed sequentially.

Example

{
"tests."
	[		
	"Tests/FeatureA/Workflow 1.twf",
	"Tests/FeatureB/Workflow 2.twf",
	"Tests/Integrated/Workflow3.twf"
	]
}

Encrypt passwords and entries

The TWS offers you the possibility to encrypt passwords and other text entries (e.g. for logins or basic authentication dialogs). During the encryption of the password, a so-called “token” is generated and referenced instead of the text input in the workflow and the respective activity and stored centrally in the server.

A client connected to this server then has the option of resolving a token referenced in the workflow and then using it decrypted during playback - without saving it as plain text for a user to view.

These tokens can not only be used directly in the properties of an activity, but you can also save this token in a variable and then include it in the properties.

Proceed as follows to encrypt the token:

  1. Click on the desired activity.
  2. Edit properties of the activity (see screenshot)

_images/decodePassword1.png

  1. Check encode password/text option

_images/decodePassword2.png

After encrypting the input, TWS will automatically replace the plaintext with the token - in our example “tws_token:VYAUqsRyQe-k”. This token is needed during execution to decrypt the input again and can also easily be reused in other workflows. For the use and resolution of the tokens it is absolutely necessary that a tester or a test machine is connected to the server with which the token was created. If you are not connected to this server, the workflow cannot be executed due to an error in the token decoding. Therefore it is recommended to assign a person (e.g. an admin) with the creation/management/provision of tokens and servers to ensure a successful execution of workflows.


Test data

The TWS offers you several possibilities to use test data automatically in workflows. Test data is used to minimize the effort of creating and executing workflows - so you can leave the input of data required for a test to the TWS and save time.

These test data can, for example, be login data for a website, so as a tester you do not want to re-type every login manually, but can refer to the test data in the studio.

As sources for these data sets, we currently support SQL databases (MySQL, MSSQL) as well as CSV and Excel files.

These test data can be used together with certain compatible activities, such as entering text activity. The Studio iterates over the referenced test data during execution and automatically adds it to this activity.


Test data from CSV files

“CSV” stands for “comma seperated values”.

_images/EigenschaftenHinweis.png We recommend that you do not create these .csv files with Excel, because Excel can change the formatting of the file so that it can no longer be used as a .csv file for these purposes. _images/EigenschaftenHinweis.png

The structure of a .csv file as an example:

UserName;Email;Password
aa;aa@a.de;aaaa
bb;b@b.de;bbbb
cc;c@c.de;cccc

The first column is seen as the identifier of the data records below and is displayed in the Studio accordingly.

You can then drag the respective identifiers to activities to create a “TestDataSequence”:

_images/TestDaten_CSV_Workflow.png


Test data from Excel files

The test data from Excel workbooks must be in the .xls or .xlsx file format. A suitable Excel test data workbook should be structured as in the given example:

_images/TestDaten_Excel.png

The first row of the spreadsheet is used as a column identifier - these values have to be chosen destinctively as they are used as unique identifiers for the data columns. Inside the Test Workflow Studio column identifiers serve as surrogates for the data in their columns. An activity is executed once for every value in a corresponding column - just like a ForEach loop.

_images/TestDaten_Excel_Workflow.png

The loaded data is represented by their column identifiers (compare to screenshot above).


Test data from databases

In contrast to the .csv and .xls- or .xlsx-files, the test data from databases is not located within a file, but either on a local database or on a database from the Internet. In order to integrate these databases into the TWS, we use .sqlconfig files which contain the respective configuration values required to connect to them and read the desired tables and values.

Configuration file

The configuration values within the configuration file are in JSON format and are structured in this way:

{
  "sqlServer": {
    "ServerType": "MsSQL",
    "Server": "(localdb)\\MSSQLLocalDB",
    "Database": "tws_testdata",
	"TableName": "userdaten",
    "UserId": "",
	"Password": ""
}}
  • "ServerType": Stands for the type of database. Supported are “mysql” and “mssql”.
  • "Server" : The adress of the server.
  • "Database" : The name of the database which contains the tables you need.
  • "TableName" : The name of the table that contains the datasets you need.
  • "UserId" : The username to access the database (if required).
  • "Password" : The password to access the database (if required).

This .sqlconfig file must be located in the project directory or in subfolders within a project directory and is then automatically generated by the Studio is recognized as such and displayed in the Project Explorer as a test data element. As soon as you expand this element, the respective column captions of the records within the specified table are displayed.

_images/TestDatenSQL.png

_images/TestDatenSQL_Workflow.png

Running workflows

How to execute a workflow can be found in chapter Playback->Playback of Workflows