# How to create a Selenium IE Node that starts on boot?

I've been hitting my head against the wall with this one for a while now.

On Linux Chrome and Firefox selenium nodes are fairly easy to setup and start automatically at boot time using docker or even just a plain init.d service.

I've even gotten them to run on windows at boot using various methods. However, none of these methods work with IE. That is, the standalone-selenium-server.jar starts correctly but IE cannot execute tests even though Chrome and Firefox can.

This issue seems to be related to the IEDriver being unable to send events to the browser. Unlike Chrome and Firefox which use javascript to emulate clicks the IEDriver sends events to Windows to emulate the user. It appears that when the application is started automatically and no one is logged in Windows drops these events rather than passing them along.

Has anyone had any luck starting a Windows Selenium Node at boot that is capable of running IE tests without additional intervention?

• What do yo mean "start on boot"? After you have logged in? or before? What is the exact use-case? Mar 16, 2018 at 17:11
• When the machine starts (boot), i.e. before anyone has logged in. The use case is that my nodes are subject to update/reboot that is not under my control and I'd like the nodes to reconnect to the hub in a fully automated fashion. Mar 16, 2018 at 17:17
• What format is the node software in? exe? jar? Mar 19, 2018 at 17:22
• It's a jar file, the issue is not getting the jar to execute on startup but getting the selenium IEDriver to function correctly when the jar is started automatically. Without anyone logging in. Mar 19, 2018 at 21:13

One way to make a process start up on startup in windows is to put it in the startup folder located in your All Programs menu. If it's an exe, you should be able to create a shortcut of it and put it right in that folder to the desired effect. If it's a jar or other type of executable, then you'll want to create a .bat file and then put that .bat file into the same startup folder.

The contents of a bat file could look like this (taken from here: https://stackoverflow.com/questions/5953525/run-java-application-at-windows-startup)

javaw -jar C:\Path\to\jarfile\selenium-node.jar

If you need to allocate more heap space to the java runtime in that example, then adding the flags -Xms and -Xmx to define the initial and maximum allowed heap space will give your JVM more memory wiggle room if necessary. That could look like:

javaw -Xms1g -Xmx2g -jar C:\Path\to\jarfile\selenium-node.jar

• Unfortunately, this doesn't resolve the issue. I can get the jar to start, it's the getting it to start in a fashion that allows IEDriver to successfully execute selenium tests that's the challenge. Mar 19, 2018 at 21:16

Setting up a Selenium IE node to start on boot can be a bit tricky. However, with right tools and configuration, it is definitely possible. Here is a step-by-step guide on how to do it:

1 Download the latest version of the Selenium standalone server jar file and the Internet Explorer driver from the official Selenium website.

2 Install the Internet Explorer driver on your Windows machine. You can do this by following the instructions provided on the official Selenium website.

3 Create a new Windows service using NSSM (Non-Sucking Service Manager). NSSM is a free and open-source utility that allows you to easily create Windows services from any executable.

4 Open a command prompt as an administrator and navigate to the directory where you have saved the NSSM executable.

5 Run the following command to create a new service:

nssm.exe install SeleniumNode "C:\Program Files (x86)\Java\jre1.8.0_261\bin\java.exe" "-jar C:\Selenium\selenium-server-standalone-3.141.59.jar -role node -hub http://localhost:4444/grid/register -browser browserName=InternetExplorer,maxInstances=5,platform=WINDOWS -Dwebdriver.ie.driver=C:\IEDriverServer.exe"


Replace the paths to the Java executable, Selenium standalone server jar file, and Internet Explorer driver with the actual paths on your machine.

6 Open the Services panel in Windows and locate the newly created SeleniumNode service. Start the service and verify that it is running correctly.

7 Now, you can run your Selenium IE tests on the node by specifying the browser capabilities in your test script. For example, in Java you can use the following code to create a new Internet Explorer driver instance:

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capabilities);


With these steps, you should now have a Selenium IE node that starts on boot and is capable of running IE tests without additional intervention.

Here are some useful resources that you can refer to for more information and guidance: