Create service for selenium

install selenium on client part

sudo yum install centos-release-scl # install SCL
sudo yum install python27
scl enable python27 bash
pip install --upgrade pip
yum install gcc
pip install psutil
pip install -U selenium

install selenium and java support units on server part

selenium-server file need:

  1. Run.

start_selenium_server.bat
java  -jar selenium-server-standalone-3.6.0.jar

Create service

1.Download tools : srvany.exe and instsrv.exe from microsoft.

2.Put them into C:\software\python\selenium\

3.Run cmd.

pushd C:\software\python\selenium\
instsrv.exe selenium C:\software\python\selenium\srvany.exe

4.Add new key to registry

REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName\Parameters /v Application /t REG_SZ /d "java -jar selenium-server-standalone-3.8.1" /f
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName\Parameters /v AppDirectory /t REG_SZ /d "C:\software\python\selenium" /f
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ServiceName\Parameters /v AppParameters /t REG_SZ /d "" /f

5.Start service and set automatic start

sc start selenium
sc config selenium start= auto

Last updated