Support Center Home


Selenium Webchecks

You can manage Selenium Webchecks using LogicMonitor by recording a browser transaction and then uploading the Webcheck to LogicMonitor. LogicMonitor collects latency data from the Selenium Synthetics check (the length of time that it took for the test or user workflow specified in a .side file to be completed). It also captures if the check or workflow resulted in an unexpected error, indicating a possible issue with the website.

After the data is ingested into LogicMonitor, you can use LM APM and LM Logs to view the data for potential user issues.

Authentication

You can add authentication to your Synthetics Webchecks with the following actions:

  • Parameterizing the appropriate credentials inside the Selenium .side file
    This can be accomplished after you record your browser transaction by modifying the .side file with the appropriate authentication.
  • Specifying the credentials when uploading the Webcheck to LogicMonitor
    You can specify the credentials in a step of the Synthetics Website Test wizard in your LogicMonitor portal

Credentials consists of a username and password, and—if you are using multi-factor authentication (MFA)—a token. LogicMonitor leverages the existing variable substitution in Selenium IDE to securely inject your authentication information.

Requirements

To record a browser transaction, you need the Selenium IDE Chrome Extension.

Recording a Browser Transaction

Follow the Getting Started instructions from Selenium to record a browser transaction.

When complete, save your .side file in a location you can access for uploading to LogicMonitor.

Tip: Selenium allows you to connect to a session using a VNC viewer to watch the browser as a test executes. You can connect VNC directly to the exposed node port using a VNC viewer (For example, VNC Connect).
Selenium Grid 4 includes a NoVNC web viewer. Exposing port 7900 allows you to open the port in a browser and see the VNC viewer activity without installing a viewer. If you use the provided docker-compose file, you would use the following:
– Chrome: “http://:7900”
– Edge: “http://:7901”
– Firefox: “http://:7901”
See the following for additional tips:
https://github.com/SeleniumHQ/docker-selenium#debugging
You can also run “Poll now” on the Selenium Webcheck to see any error messages that may be encountered.

Adding Authentication to the Browser Recording

To add authentication, you must parameterize the credentials in the Selenium .side file by replacing each instance of username, password, and token with the appropriate variable substitution.

Variables can be substituted in Selenium IDE text fields by surrounding a variable name with ${}. For example, to substitute the value of the variable myVar into the condition of an if statement would look similar to the following:
${myVar} === "a".

For more information, see Selenium’s Conditional Branching documentation.

LogicMonitor uses the following special variables to substitute your credentials username, password, and token respectively:

  • credential.username 
  • credential.password
  • credential.token
Each credential field (username, password, and token) are printed to the execution log using the echo command.

Recommendation: Specify multiple test user accounts to be added to a “pool” of users that the test pulls from. This ensures MFA can be tested properly and avoids situations where one specific test user is attempting to log in too many times from different locations.

Uploading Selenium Webchecks to LogicMonitor

  1. Add the Synthetics Website Test option from the Resources tab by navigating to Resources > Add > Synthetics Website Test.
  1. Follow the onscreen instructions to upload the .side file from the browser transaction recording.
  2. At the Permissions step in the wizard, ensure you add the appropriate credentials for authentication.

Refer to the documentation for your specific MFA provider to obtain the appropriate MFA type, seed, and length for your test credentials. 

In This Article