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 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
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)
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.
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:
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.