Parameters
Parameters are used to define variables which will be accessible from the whole platform in any Plans and Keywords. You can think about Parameters the same way as “Global” variables.
Parameters definition
Parameters minimalistic form is composed of a Key and Value which are defined as String only. In addition to the required Key and Value fields, a Parameter behaviour can also be modified using below fields :
- Scope : the scope is used to restrict the access to the parameter to specific Keywords
- Global : accessible for all Keywords
- Application : accessible by keywords registered for the given application
- Keyword : accessible only by the specified Keyword
- Activation expression : a JavaScript (Nashorn) expression can optionally be used here to set the parameter value. Following bindings are available for use in activation expressions :
- user : the currently logged in user
- screen settings : any defined screen settings can be used via ID
- Priority : define the order in which the activation expression will be evaluated (descending order : the higher the priority, the sooner the expression will be evaluated)
Examples
Basic example
To create a Parameter, click on the top level menu Parameters then on the top right “New” button.
Fill in the Key and Value fields then press save.
You can now use “myBasicParameter” in any of your Plan / Keywords :
Using activation expression
Let’s now use activation expression to set a parameter (log level in that example) depending of the “Environment” setting.
We have to create the “log” parameter twice (but with different activation expressions):
- execution on “TEST” environment will set the parameter value to “Debug”
- execution on “PROD” environment will set the parameter value to “Error”
You can verify that the value is properly set by running a simple Echo on both environment :
Using prioritized activation expression
In addition, activation expressions evaluation can be prioritized via the “Priority” setting. In below example, we will define the “log” value to be Error for both Environments with a higher expression priority that the one set for the “Test” environment only :
The expected behaviour is that on each environment, the log level will be set to Error.
Using different scope
While creating or editing a parameter you may assign it to a given scope to restrict it’s access. The scopes and related access restrictions are described in Parameters definition.
Application scope
To enable this type of scope, you’ll have to add a new entry in the screen template definition for functionTable. You may refer to the customization section here. The new entry must have the id “attributes.application”.
The following is an example to restrict the access to the Keywords of the given application:
Remark : the scope application is only available if applications were configured in the screen settings as illustrated in below image:
Keyword scope
The following shows an example to create a parameter accessible by one specific Keyword.
Parameters table view
The parameters table view allow you to view and manage existing parameters such as editing, copy/pasting, deleting… You may also track the last modification time and user.
Protected parameters
If you create a parameter with a key containing either “pwd” or “password” in its name, the parameter will be considered as protected. This means that its value will get obfuscated in the UI and in the exported data.
Encryption manager
As of release 3.16 of Step enterprise, an encryption manager is provided to further secure these parameters. When enabled, the values of the protected parameters get directly encrypted at creation and update times, their decrypted value can only be accessed in the context of a keyword call.
Activation of the encryption manager has to be done by your Step administrator. Please refer to the page dedicated to the encryption manager for details.