Prerequisites to run Synthetic Monitoring scripts


This topic outlines the software installations and configurations required to run the Synthetic Monitoring scripts by using the Selenium and Playwright frameworks on both Windows and Linux environment.

Windows environment

This section provides information about how to install and use the Selenium and Playwright frameworks in a Windows environment. 

To use the Playwright framework for Chrome and Edge browsers

  1. Note the browser version by performing the following steps (applicable to the Chrome or Edge browser):
    • Navigate to Settings.
    • Click About.
      For example, the browser version can be 140.0.7339.210 (Official Build) (64-bit).
  2. Download the driver that matches your installed browser version:
  3. Add the full path of the browser driver executable to your system’s environment variables.
    For example, C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\chromedriver.exe or C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\msedgedriver.exe.
  4. Install Python 3.10 or above from https://www.python.org/downloads/ and add the Python installation directory to your system’s environment variables.
  5. Open the command prompt and run the following commands to install Playwright:
    pip install playwright
    playwright install
  6. Run a sample Playwright Python script by using the Chrome or Edge browser to verify that the environment is correctly configured.

To use the Selenium framework for Chrome and Edge browsers

  1. Note the browser version by performing the following steps (applicable to the Chrome or Edge browser):
    • Navigate to Settings.
    • Click About.
      For example, the browser version can be 140.0.7339.210 (Official Build) (64-bit).
  2. Download the driver that matches your installed browser version:
  3. Add the full path of the browser driver executable to your system’s environment variables.
    For example, C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\chromedriver.exe or C:\Users\<username>\AppData\Local\Microsoft\WindowsApps\msedgedriver.exe.
  4. Install Python 3.10 or above from https://www.python.org/downloads/ and add the Python installation directory to your system’s environment variables.
  5. Open a command prompt and run pip install selenium to install Selenium.
  6. Run a sample Selenium Python script by using the Chrome or Edge browser to verify that the environment is correctly configured.

Linux environment

This section provides information about how to install and use the Selenium and Playwright frameworks in a Linux environment. 

To use the Playwright framework for Chrome and Edge browsers

  1. Install the required browsers by using the following commands:
    • For Chrome, by using DNF:
       dnf install -y https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm  google-chrome -version
    • For Edge:
      Add Microsoft Edge Dev Repository- tee /etc/yum.repos.d/microsoft-edge-dev.repo > /dev/null <<EOF
         [microsoft-edge-dev]
         name=Microsoft Edge Dev Channel
         baseurl=https://packages.microsoft.com/yumrepos/edge
         enabled=1
         gpgcheck=1
         gpgkey=https://packages.microsoft.com/keys/microsoft.asc
         EOF

      Install Edge Browser-
      dnf install -y microsoft-edge-dev microsoft-edge-dev --version

  2. Install the required driver that matches your installed browser version by using the following commands:
    • For Chromewget  https://storage.googleapis.com/chrome-for-testing-public/<version>/<platform>/chromedriver-<platform>.zip 
    • For Edgewget https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/<version>/edgedriver_<platform>.zip
  3. Install Python version 3.10 or above.
  4. Run the following commands to install Playwright:
    pip install playwright
    playwright install
  5. Run a sample Playwright Python script by using the Chrome or Edge browser to verify that the environment is correctly configured.

To use the Selenium framework for Chrome and Edge browsers

  1. Install the required browsers by using the following commands:
    • For Chrome, by using DNF:
       dnf install -y https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm  google-chrome -version
    • For Edge:
      Add Microsoft Edge Dev Repository- tee /etc/yum.repos.d/microsoft-edge-dev.repo > /dev/null <<EOF
         [microsoft-edge-dev]
         name=Microsoft Edge Dev Channel
         baseurl=https://packages.microsoft.com/yumrepos/edge
         enabled=1
         gpgcheck=1
         gpgkey=https://packages.microsoft.com/keys/microsoft.asc
         EOF

      Install Edge Browser-
      dnf install -y microsoft-edge-dev microsoft-edge-dev --version

  2. Install the required driver that matches your installed browser version by using the following commands:
    • For Chromewget  https://storage.googleapis.com/chrome-for-testing-public/<version>/<platform>/chromedriver-<platform>.zip 
    • For Edgewget https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/<version>/edgedriver_<platform>.zip
  3. Install Python version 3.10 or above.
  4. Run the following command to install Selenium:

            pip install selenium

       5. Run a sample Selenium Python script by using the Chrome or Edge browser to verify that the environment is correctly configured.

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC PATROL for Synthetic Monitoring 25.4