...
Command | Target | Value |
---|---|---|
|
|
|
Info |
---|
The API token is masked for privileged users. |
Step | Screenshot |
---|---|
This screenshot provides an example of the API GET command for the dictionary “DougApicaKey”. | |
This screenshot provides another example of the API GET command for the dictionary “ApicaKey”. Note how each dictionary has different defined key-value pairs. | |
Selenium Example 1: The Dictionary Key "DougApicaKey" has 3 key values (excluding the sample value) that are used in the scenario. | |
Selenium Example 2: The Dictionary Key "Apicakey" has 2 key values (excluding the sampleKey value) that are used in this scenario. In this case, the username and password values, from the dictionary will be used in the Selenium scenario. These values will not be hard-coded into the script. |
Encrypting Selenium Variables with the “encryptapica” String
Note |
---|
This feature must be enabled per customer account. If you are interested in encrypting Selenium variables within your Scenarios, please contact your Technical Account Manager or Support. |
...
Info |
---|
It is possible to specify any string in the “Value” field for variable encryption as long as it starts with the string “encryptapica”. This string invokes the crypto service which is responsible for encrypting the provided value. |
Step | Screenshot | ||
---|---|---|---|
Step 1: Edit a Check which contains a Scenario and click the Debug Scenario icon. | |||
Step 2: Identify the sensitive information to be encrypted. | |||
Step 3: Store the value as an encrypted value by adding a new variable which will hold the encrypted value.
| |||
Step 4: Enter the original Target value.
| |||
Step 5: After the encryption has been completed, the green lock will appear, and the words “[ENCRYPTED BY APICA]” will be present in the Target field. | |||
Step 6: In the step where the password originally appeared, replace the plaintext password with the stored variable name specified earlier. In this case, in step 25, the variable ‘encryptapicapassword’ will be entered as $(variable_name) or $(encryptapicapassword). | |||
Step 7: Test the scenario to ensure it passes the encrypted values to the intended application and click “Save scenario”. |
...
Widget Connector | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Masking Selenium Variables with the “maskapica” Command
Command values can be masked using an Apica-specific prefix when they contain sensitive information. This prevents the value from being displayed in results. Assume a scenario contains the following commands:
...
It is possible to mask the value secretPa$$word
in the Check Result page by adding the Store
command to store the password as a variable with the prefix maskapica
and then using that variable in the actual command which uses the password. The scenario will contain the following commands after the value secretPa$$word
is masked:
...
Command | Target | Value |
---|---|---|
store |
|
|
open |
| |
selectWindow |
| |
type |
|
|
type |
|
|
clickAndWait |
|
Prefixes
Synthetic Monitoring supports custom security prefixes for use in select scenario values where information may need more security.
‘apica’ to store information
Store a result with “apica”
Synthetic Monitoring will store the command result for later display when the "apica" prefix is used in a command value.
Display
The command value is shown in Details in the Details Result Scenario in the Value column.
...
Command
Target
Value
storeCookieByName
ServerID
apicaServerID
This example will store the ServerID
cookie value and show it as apicaServerID
Extracted Value.
This prefix will work with any command that starts with “store
."
Limitations of Selenium IDE within ASM Scenarios
Key Codes
When using sendKeys in Selenium IDE, the key codes ${KEY_ENTER}
, ${KEY_SHIFT}
, and ${KEY_LEFT}
are not valid commands within Selenium IDE. Instead use keyPress
with the respective ascii ASCII values for the key you want to be pressed. For example, return/enter is , if you want to press Enter within an application, use the command keyPress
and the value \13
.
JavaScript Execution
WebDriver’s JavascriptExecutor
will wrap all JS and evaluate it as an anonymous expression.
Impact on JavaScript execution
This means that you need to use the “return” keyword:
...
The same is true when evaluation expressions using storeEval or assertEval:
Selenium IDE
|
|
|
WebDriver
|
|
|
Note that there are multiple commands that will result in javascript evaluation: gotoIf
, assertEval
, getEval
, and storeEval
.
Key Strokes
If you need to simulate a keypress input event, such as pressing the enter key, you must use keyPress
or keyPressAndWait
(if the keystroke triggers a new page load), with the ASCII as an argument.
Overview
ExampleFor example: Press enter key and wait for new page load
| |
|
...
Agents running Microsoft Windows may handle very short report times incorrectly.
Waterfall graph
Agents running Microsoft Windows sometimes report 0ms for URL calls with very quick response times (0-20ms).
Return Required
For Selenium commmands that execute javascript snippets, the command expects a returned value
Return Command In Scripts
Return Required
ASM Scenario commands which execute JavaScript snippets expect a returned value. The following commands result in javascript evaluation/expects expect a javascript snippet as argument, which must include the 'return' keyword at the start of the expression within the “Target” field:
GotoIf
RunScript
RunScriptAndWait
GetEval
StoreEval
StoreExpression
Type & sendKeys
Even though the "type
" command should work works in most cases, we strongly recommend that you use "sendKeys" instead. This is because type
Apica strongly recommends using sendKeys
instead of type
. The type
command edits the HTML format of the code, while sendKeys
sends it more humanlike which is the sendKeys
command attempts to simulate actual typing and is therefore able to trigger javascript code in fields.
...
Incrementing a Stored Numeric Value
It is currently not possible to change the value of a variable from within a javascriptJavaScript snippet.
##
This Selenium IDE code will change the value of $counter
:
Command | Target | Value |
|
|
|
However the following example won't affect The following command will not change the value of $counter
:
Command | Target | Value |
|
|
|
...
Info |
---|
Knowing how to increment a value is useful when running through a loop in an ASM script! |