---
title: "How to set up Selenium Server on Microsoft Windows"
description: "Setting up Selenium Server on Microsoft Windows involves installing required software and configuring OP5 Monitor. This guide explains installation steps, test case export, and monitoring setup using the Selenium check plugin."
url: "https://docs.itrsgroup.com/docs/faq/op5/360020257753-op5-monitor-how-to-set-up-selenium-server-on-microsoft-windows/index.html"
---
## Version Compatibility

This article was written for version 7.0.4 of OP5 Monitor; it could work on both lower and higher versions if nothing else is stated.

## Introduction

*[Selenium](http://www.seleniumhq.org/)* is a browser automation framework used for testing web pages and applications.
It is similar to the *[WebInject](https://docs.itrsgroup.com/docs/faq/op5/360020252313-op5-monitor-how-to-monitor-websites-with-webinject/index.html)* application included in OP*5 Monitor*, but includes an IDE which allows the user to build complex test cases executed by browsers like *Google* *Chrome* and *Internet Explorer*.

This how-to will show you how to set up *Selenium Server* on *Microsoft Windows* with *Mozilla Firefox* and configure test case monitoring.

#### Support information

Selenium Server, the check plugin and its dependencies are third-party products, not supported by ITRS Group.

## Prerequisites

- Basic knowledge in Windows server administration
- The *[Selenium IDE](https://www.selenium.dev/projects/)* installed in your web browser
- A working Internet connection for downloading dependencies
- Basic knowledge of service configuration in OP*5 Monitor*
- A directory called "C:\selenium" and C:\selenium\testcases"
- The "NSClient++" monitoring agent installed on the target system

Note: Firefox Plugin "Selenium IDE" is not supported in the Firefox browser beginning from version 55.  (<https://www.ghacks.net/2017/08/21/selenium-ide-firefox-add-on-end-of-live/>) webdriver should be used.

## Software dependencies

Selenium Server requires some additional applications and runtimes:

### Mozilla Firefox -

The *Firefox* web browser will be used as the web driver in this how-to and can be downloaded from the [Mozilla foundation's website](https://www.mozilla.org/en-US/firefox/new/).

### Oracle Java -

Selenium Server requires the Java runtime environment, which can be downloaded from *[Oracle's website](https://java.com/en/download/).*

The "Ask toolbar" provided in the Java installation wizard is not required by Selenium Server, but might be a *nice* addition depending on your preferences.

### Python interpreter -

The check plugin for *Selenium* test cases requires the *Python interpreter*, version 2.X.
You can download it from the [Python software foundations website](https://www.python.org/downloads/).

Make sure to enable the "Add Python.exe to path" option in the installation wizard.

### NSSM -

*Selenium server* does not include any service management out-of-the-box.
*NSSM* is an application which turns Windows and Java executables into system services.

You can download NSSM via [their official website](https://nssm.cc/download) or via [Chocolatey](https://chocolatey.org/packages/NSSM).

## Installing Selenium Server

Download *Selenium Server* version 2.x from the *[SeleniumHQ](https://www.selenium.dev/downloads/)* and move the JAR-file to "C:\selenium".
Open the command prompt as administrator in extracted *NSSM* directory and execute the following commands to install the service:

```
.\nssm.exe install selenium-server java -jar C:\selenium\selenium-server-standalone-2.45.0.jar -interactive.\nssm.exe start selenium-server
```

It's highly recommended to create a dedicated user for the Selenium Server service to minimize security risks.

You will also need to install the Selenium Python module for the test cases.
Open the command prompt as administrator and execute the following PIP command:

```
pip.exe install selenium
```

## Preparing the monitoring agent

Create a directory in "C:\Program Files\op5\NSClient++\scripts" called "custom" and copy the "[check\_selenium\_win-APLHA](/faq/downloads/op5/360020257753-inline-attachment-1-check_selenium_win-ALPHA.py)" plugin to it.
Open a text editor as administrator and add the following lines to "C:\Program Files\op5\NSClient++\custom.ini":

```
[NRPE Handlers]check_selenium=python.exe scripts\custom\check_selenium_win-ALPHA.py -s "$ARG1$" -w "$ARG2$" -c "$ARG3$"
```

Restart the *NSClient++* system service to reload the configuration.

## Exporting *Selenium* *IDE* test cases

Once you have created a test case, open "Export Test Case As..." in the "File" menu and select "Python 2 / unittest / WebDriver".
Save the file and copy it to the "C:\selenium\testcases" directory on your target system.

![OP5 Monitor - How to set up Selenium Server on Microsoft Windows](https://docscdn.itrsgroup.com/faq/images/op5/360020257753-12977331-web_driver.png)

## Configuring check command

Go to the "Commands" configuration page in OP*5 Monitor* and create a new check command with the following options:

```
command_name:   check_selenium_servercommand_line:   $USER1$/check_nrpe -u -H '$HOSTADDRESS$' -t 50 -c check_selenium -a '$ARG1$' '$ARG2$' '$ARG3$'
```

![OP5 Monitor - How to set up Selenium Server on Microsoft Windows](https://docscdn.itrsgroup.com/faq/images/op5/360020257753-12977331-check_selenium_command_configuration_1.png)

## Monitoring test cases

Create a new service on your target host in OP5 Monitor and select the "check\_selenium\_server" command.
The check command requires three arguments:

| Argument | Description |
| --- | --- |
| $ARG1$ | File name of Selenium test case in Python unittest format |
| $ARG2$ | Warning threshold in seconds for test execution time |
| $ARG3$ | Critical threshold in seconds for test execution time |

Threshold levels

It can take a few seconds for Selenium Server to start and the delay may differ depending on server load.

Enter appropriate values and then save the configuration.

![OP5 Monitor - How to set up Selenium Server on Microsoft Windows](https://docscdn.itrsgroup.com/faq/images/op5/360020257753-12977331-check_selenium_service_configuration_1.png)

Once the service check has been executed, the status detail page should show something like this:

![OP5 Monitor - How to set up Selenium Server on Microsoft Windows](https://docscdn.itrsgroup.com/faq/images/op5/360020257753-12977331-check_selenium_status_detail.png)

## Additional information

- [Official Selenium documentation](https://www.selenium.dev/documentation/) (External)

## Related downloads

- [check_selenium_win-ALPHA.py](/faq/downloads/op5/360020257753-360030377093-check_selenium_win-ALPHA.py)


