How to create a SUM Selenium Scenario
How to Define SUM Variables and SUM Secured Variables
When you create a Selenium script, you may want to have some Selenium command values set from SUM variables.
This is typically the case for sensitive data like passwords.
For that, you can add a SUM variable annotation in the Description field of the Selenium command.
Such a description is ignored by Selenium. However, when the SIDE file is imported into SUM, the content is parsed and the annotations are detected.
Syntax
SUM supports four types of variable annotations:
- @sap.sum.variable=<variable_name> – to have the command value field replaced by the specified SUM standard variable value.
- @sap.sum.secure.variable=<variable_name> – to have the command value field replaced by the specified SUM secured variable value.
- @sap.sum.variable.target=<variable_name> – to have the command target field replaced by the specified SUM standard variable value.
- @sap.sum.secure.variable.target=<variable_name> – to have the command target field replaced by the specified SUM secured variable value.
The authorized variable name characters are:
- Alphanumeric ([a-z], [A-Z], [0-9])
- Underscore ('_')
During the Import
During the SIDE file import, SUM will create the corresponding variables in the parameters of the SUM scenario.
The created variable will be of the following types:
- String for the @sap.sum.variable and @sap.sum.variable.target annotations
- Secured for the @sap.sum.secure.variable and @sap.sum.secure.variable.target annotations
The SUM variable default value is the value of the "value" (or "target") field of the Selenium command.
If the command has no value, the variable is not created.
Important
For the secured variable, do not keep the sensitive value in the command value field. (It would be stored in clear.)
Replace it with a dummy value.
If the same variable annotation is declared several times, only one variable is created. Its type and default value are those of the last declaration.
If the Selenium command is disabled, the annotation is ignored.
Note
If the SIDE file is reimported and a variable annotation changed or removed, the SUM Scenario will be updated but the deprecated variable will not be removed from the Scenario parameters list.
During the SUM Scenario Configuration
All the created variables are listed in the SUM Configuration, in the Parameters section of the scenario details.
It is required to set the value of the secured variables. (The default value should not be the correct one.)
At Runtime
When SUM executes the scenario, if a command has a variable annotation, SUM replaces its value with the value of the SUM variable before the command execution.