-
Request for existing cases, user IDs, Portal navigation support and more
Request for existing cases, user IDs, Portal navigation support and more
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.
SUM supports four types of variable annotations:
The authorized variable name characters are:
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:
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.
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.
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.
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.)
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.
There are three ways to define SUM steps in a Selenium script:
During the SIDE import, a SUM scenario is created for each test suite in the SIDE file (i.e. in the SIDE project).
The step starts with the first command of the test.
It ends with the first of the following events:
The created step name is the name of the test.
The created step ID is the GUID of the test.
The step starts with the "run" command.
The step, at least, contain all the commands from the called test.
In other words, a called test cannot create new steps:
The step ends with the first of the following events (in the caller test):
The created step name is the name of the called test.
The created step ID is the GUID of the "run" command.
To explicitly define a new step, you can add a SUM step annotation in the Description field of a 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.
Remarks:
@sap.sum.step=<step_name>
The authorized step name characters are:
A space character is also authorized if the step name is enclosed in double quotes: @sap.sum.step="<step name with space>"
The step starts with the command with the step annotation.
It ends with the first of the following events:
The created step ID is the GUID of the command with the step annotation.
During the execution of a Selenium scenario, SUM can take screenshots of the monitored application UI.
There are three situations in which SUM can take screenshots:
This behavior can be configured in the Scenario details section of the SUM configuration.
SUM does not take automatic screenshots by default.
In the scenario configuration, you can configure it to automatically capture a screenshot for each SUM step of every execution.
When this feature is activated, for each execution, SUM takes a screenshot of the monitored application UI at the end of each SUM step.
Alternatively to the automatic screenshot for each execution, you can configure your SUM scenario to automatically capture screenshots when the scenario execution fails due to an availability error.
In this case, SUM takes a screenshot of the monitored application UI:
When the execution is successful or it produces a performance error, no screenshot is captured.
Besides the automatic screenshots, you can also instruct SUM to explicitly take screenshots when a specific command of the scenario is executed.
For that, you have to add a SUM screenshot 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.
Remarks:
You can disable the explicit screenshots in the SUM scenario configuration. (They are activated by default.)
@sap.sum.screenshot
If a command has a SUM screenshot annotation, a screenshot of the monitored application UI will be taken just after the command execution.