The Variables view consists actually of four views that allow to manage variables on different test definition elements.
The Variable views have all the same structure they just differ in the variable type and their parent type.
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.
=) for all visible variable parents
As described in Variables, variables represent various value types and can be formatted in many ways. This paragraph walks through the variable editor options
Enter arbitrary-length Text. No formatting occurs.
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
To see the actual password value, set the toggle to on
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
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.
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.
The Editor supports two options
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.
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:
Now, we switch to the tab resolvedRequest to see what the variables are resolve to: