View Variables

The Variables view consists actually of four views that allow to manage variables on different test definition elements.

  • Repository
  • Testset
  • Testcase
  • Teststep
The status of the variables views and their visibility depends - of course - of your current selection.

Base Variable View

The Variable views have all the same structure they just differ in the variable type and their parent type.

variables overview

The Variables parent selector tabs depend on your current selection. In the above screenshot, there are four tabs visible (repository, testset, testcase and teststep).

You can deselect a repostory without losing the selection of the underlying testset

.

The name below the variables parent selector tabs is the name of parent element you have selected with your tabs, in this case the teststep Enumerate, as you can see on the right.


Commands

Variable list commands
  • Show/hide variables toggles the variables list. This may be helpful to have more space when editing testsets and repositories
  • Export all variables will prompt for a directory and creates a properties file (key/value, separated by =) for all visible variable parents
  • Import variables will prompt for a properties file (see above) contents and read the values as String variables
  • Export variables will prompt for file name and location and creates a properties file (see above)
  • Create new variable opens the variables editor as described above
  • Delete selected variables deletes these variables.
  • Edit a selected variable allows you to change the variable type, the name and the value
  • Documentation of the pasteboard commands

Variables editor

As described in Variables, variables represent various value types and can be formatted in many ways. This paragraph walks through the variable editor options

String Variables

Enter arbitrary-length Text. No formatting occurs.

Variables editor string value

Password Variables Editor

Enter arbitrary-length Text. No formatting occurs. The variable list will not show the variable value. The varaible value will not be shown with the toggle on off

Variables editor password value undisclosed

To see the actual password value, set the toggle to on Variables editor password value disclosed

Fixed Date Variables Editor

The fixed/static date variables editor uses the builtin date picker to select a date and a time. The editor defaults the formatting to yyyy-mm-dd, but you can apply any supported formatting like yyyy-mm-dd'T'HH:mm:ss

Variables editor static date

Relative Date Variables Editor

The relative date variables editor uses the builtin date/time picker to select a date, and if required a time. The editor defaults the formatting to yyyy-mm-dd, but you can apply any supported formatting like yyyy-mm-dd'T'HH:mm:ss. The reevaluation occurs whenever the variables value is accessed, so even in the variables list, this value is reevaluted when the list view updates.

Variables editor relative date

Number Variables Editor

Number formatting is another frequent requirement as SOAP Webservices expect an identifiable number formatting and schema are pretty strict with the provided formatting. In general they expect simple numbers though. Variables editor relative date

Boolean Variables Editor

The Editor supports two options

  • true/false
  • yes/no
Variables editor Boolean value

Run environment Variables

as described in View Run Environment you can configure authentication for a Webservice in a Run Environment Configuration. Data that is configured here, will be accessed, when the user selects the corresponding Run Environment. When you want to access these information within your request, you can provide these values through Run Environment Variables, as described here:

Authentication type Textfield name Variable notation in Test definition
HTTP basic Authentication HTTP username $(EnvironmentConfig.httpUsername)
HTTP basic Authentication HTTP password $(EnvironmentConfig.httpPassword)
HTTP bearer Authentication HTTP bearer token $(EnvironmentConfig.bearerToken)
None (No HTTP authentication) Payload username $(EnvironmentConfig.payloadUsername)
None (No HTTP authentication) Payload username $(EnvironmentConfig.payloadPassword)
None (No HTTP authentication) Payload OTP $(EnvironmentConfig.payloadOTP)
None (No HTTP authentication) Payload Token $(EnvironmentConfig.payloadToken)

We want to illustrate this specific variable resolution mechanism with the example of a sample request that needs to provide a username, a password, an OTP (fixed) in the Test Run Environment and a Token variable, that is retrieved from another request )

We configure a Service Definition for the local Run Environment with NONE-Authentication which means we will use an Idenity Service and pass over data.

screenshot Run Environment Authentication Config

The relevant input is highlighted in blue, you will notice the variable value for the payloadToken information. We will pass the four information in an HTTP request (which could be a SOAP request as well.

We have set the Run Environment to localhost. Notice the Repository variable with name token.Our request looks like this:


screenshot Run Environment Authentication Reference

Now, we switch to the tab resolvedRequest to see what the variables are resolve to:

screenshot Run Environment Authentication Resolved Reference