Creating a Selenium script test
Use a Selenium script test if you want to simulate user interactions with your web application. Record a synthetic script by using the Firefox web browser and the Selenium IDE add-on. Record user actions on a web page, such as loading a page, clicking a link, or selecting an object. When Selenium IDE is recording, it generates a command for each user action in a script. Use a Selenium script test to replay the Selenium script at set intervals and at different locations.
Procedure
-
In the Name and Description section, enter a meaningful name for your test in the Name field. Add a description of the purpose of your test to the Description field.
-
In the Test type section, select Selenium script.
-
In the Request section, upload a Selenium
.sidefile. To record a Selenium.sidefile, see Recording a Selenium script. -
If the uploaded Selenium
.sidefile includes variables, you can see the Script variables section, where you can input the variable values as you need.Note: By default, the Script variables section is hidden. You can see the section only when the uploaded Selenium script uses variables. For more information about Selenium script variables, see Passing variable values to Selenium script.
Limitation: If you use any variables in your script, they are requested in the Script variables section. Note that you can't use global variables here, or the verification will fail. You can enter the variable values directly.
-
Configure the warning and critical events conditions for your synthetic test in the Response Validation section. You can see two conditions based on response time are provided to trigger events.
By default, a response time over 5 seconds triggers a warning event and a response time over 10 seconds triggers a critical event. You can change the response time in the Threshold Value field or change the unit to milliseconds or seconds in the Unit field for each condition. Response times that exceed your warning and critical conditions trigger events.
Further customization of warning and critical events can be done in the next configuration stage, for more information, see step 11 later in this procedure.
For more detail in relation to event triggers default behavior and how event triggers function across multiple Synthetics PoP locations, see Event generation.
-
In the Blocking and filtering section, Allowlist and Blocklist fields determine which resources you send requests to and contribute to the metrics and status of your service tests.
In the Blocklist field, enter any URL or domains that you want to block from any requests and metric calculations. In the Allowlist field, enter URL or domains that you want to include in metric calculations. Any non-matching domains and URLs are blocklisted.
Note:
-
Each URL or domain must be 200 characters or fewer. Use commas (,) to separate them and the wildcard symbol (*) to filter them. For example,
ibm.com,*developerworks*,*.s81c.com/* -
Up to 20 comma-separated entries are allowed in the Blocklist field and up to 10 comma separated entries are allowed in the Allowlist field.
-
-
If the web page you are testing requires authentication (NTLM or basic), enter the username and password in the Authentication section.
Note: The Verify test button verifies the Selenium script only if the Monitoring server is running on
xLinux. If Monitoring server is deployed onpLinuxorzLinux, the Verify test button bypasses Selenium script verification. -
Enter an Interval and Testing frequency in the Review and Finish section.
-
Interval
Defines how often the test runs in minutes or hours.
-
Testing frequency
Determines whether your test runs from all locations simultaneously or from a different location at each interval. Select Simultaneous to run your test from all locations simultaneously, or select Staggered to run your test from a different selected location at each interval.
-
-
The Locations section lists the Synthetics PoP that are installed. The first Synthetics PoP is selected by default. You can run your test from one or more synthetic pop servers.
Select the synthetic pop servers where you want your synthetic test to run. To create a new Location, see Installing Synthetics PoP.
-
You can customize the Selenium script variables for different locations. Example:
Where:
- The column Locations are the installed Synthetics PoP.
- The columns username and password are the variables that are used in the uploaded Selenium script. For more information about Selenium script variables, see Passing variable values to Selenium script.
You can enter global variables here. For more information about global variables, see Using global variables.
-
You can change event configurations in the Event triggers section.
By default a critical alert is triggered if a synthetic test playback fails (returns a code 400 or higher). To stop this behavior, set Trigger an event if a failure is detected to
Off.To increase the number of failures allowed before a critical alert is triggered, change the value between Trigger an event if the test fails and consecutive times under the Failure section. The default number of consecutive failures is
0.By default, a critical event is triggered if a synthetic test playback response time is more than 10 seconds. By default, a warning event is triggered if a synthetic test playback response time is over more than 5 seconds. To stop this behavior, set Trigger an event if a slow response time is detected to
Off.To increase the number of slow response times that must occur before a critical or warning event is triggered, change the value between Trigger an event if a threshold is breached and consecutive times under the Slow response threshold section. The default number of slow response times is
0. For more detail in relation to event triggers default behavior and how event triggers function across multiple Synthetics PoP locations, see Event generation.