Selenium Hub and Node Start Class and Start Method

41 views
Skip to first unread message

Stan Smith

unread,
Jun 17, 2022, 5:19:10 AM6/17/22
to Selenium Users
In Selenium Server v 3.141.59 we were able to start up Hub and Node processes as Windows Services using prunsrv.exe. We would use it to define all sorts of things, most of which I'll show in the below code. However, in Selenium Server v 4.2.2 I can't seem to start these up in the same way. I get an error in the logs stating the below. Can someone point me in the right direction of what the start class for Selenium Hub should be? The organization of the files on GitHub seems totally reworked between versions.

[2022-06-16 11:48:05] [debug] ( javajni.c:236 ) [ 4548] loading jvm 'C:\Program Files (x86)\Java\jre1.8.0_331\bin\client\jvm.dll'
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[0] -Dprunsrv.port=8080
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[1] -Dprunsrv.server=localhost
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[2] -Djava.class.path=C:\Selenium\selenium-server-standalone-4.2.2.jar
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[3] vfprintf
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[4] exit
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[5] abort
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[6] -Xms256m
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[7] -Xmx1024m
[2022-06-16 11:48:06] [debug] ( javajni.c:753 ) [ 6936] Jvm Option[8] -Xss4000k
[2022-06-16 11:48:06] [info]  ( javajni.c:497 ) [ 6936] Exception
[2022-06-16 11:48:06] [info]  ( javajni.c:497 ) [ 6936] in thread "main"
[2022-06-16 11:48:06] [error] ( javajni.c:912 ) [ 6936] FindClass org/openqa/grid/selenium/GridLauncherV4 failed

Here is what I am using in v4:
SET SERVICE_PASSWORD=ENTER_PW_HERE
SET SERVICE_ACCOUNT=SERVICE_ACCOUNT
SET PRUNSRV=C:\Selenium\prunsrv.exe
SET SELENIUM_HOME=C:\Selenium
SET SELENIUM_VERSION=ENTER_VERSION_HERE
SET SERVER_NAME=SERVER_NAME

%PRUNSRV% //IS//SeleniumHub ^
--DisplayName="SeleniumHub" ^
--Description="Selenium Hub" ^
--Install=%PRUNSRV% ^
--LogLevel=Debug ^
--StdOutput=auto ^
--StdError=auto ^
--LogPath=%SELENIUM_HOME%\Logs ^
--LogJniMessages=1 ^
--Jvm="%JAVA_HOME%\bin\client\jvm.dll" ^
--Classpath=%SELENIUM_HOME%\selenium-server-standalone-%SELENIUM_VERSION%.jar ^
--Startup=auto ^
--StartMode=jvm ^
--StartClass=org.openqa.grid.selenium.GridLauncherV3 ^
--StartMethod=main ^
--StartParams=-role#hub ^
--StartImage=%SELENIUM_HOME%\test.ico ^
--StopMode=jvm ^
--StopTimeout=60 ^
--StopImage=%SELENIUM_HOME%\test.ico ^
--JvmMs=256 ^
--JvmMx=1024 ^
--JvmSs=4000 ^
--JvmOptions=-Dprunsrv.port=8080 ^
++JvmOptions=-Dprunsrv.server=localhost

%PRUNSRV% //US//SeleniumHub --ServiceUser %SERVER_NAME%\%SERVICE_ACCOUNT% --ServicePassword %SERVICE_PASSWORD%

Here is what worked in v3:
SET SERVICE_PASSWORD=ENTER_PW_HERE
SET SERVICE_ACCOUNT=s SERVICE_ACCOUNT
SET PRUNSRV=C:\Selenium\prunsrv.exe
SET SELENIUM_HOME=C:\Selenium

%PRUNSRV% //IS//SeleniumHub ^
--DisplayName="SeleniumHub" ^
--Description="Selenium Hub" ^
--Install=%PRUNSRV% ^
--LogLevel=Debug ^
--StdOutput=auto ^
--StdError=auto ^
--LogPath=%SELENIUM_HOME%\Logs ^
--LogJniMessages=1 ^
--Jvm=%JAVA_HOME%\bin\server\jvm.dll ^
--Classpath=%SELENIUM_HOME%\selenium-server-standalone-3.141.59.jar ^
--Startup=auto ^
--StartMode=jvm ^
--StartClass=org.openqa.grid.selenium.GridLauncherV3 ^
--StartMethod=main ^
--StartParams=-role#hub ^
--StartImage=%SELENIUM_HOME%\test.ico ^
--StopMode=jvm ^
--StopTimeout=60 ^
--StopImage=%SELENIUM_HOME%\test.ico ^
--JvmMs=256 ^
--JvmMx=1024 ^
--JvmSs=4000 ^
--JvmOptions=-Dprunsrv.port=8080 ^
++JvmOptions=-Dprunsrv.server=localhost

%PRUNSRV% //US//SeleniumHub --ServiceUser SERVER_NAME\%SERVICE_ACCOUNT% --ServicePassword %SERVICE_PASSWORD%

Chris Carman

unread,
Jun 17, 2022, 3:24:43 PM6/17/22
to Selenium Users
>> [2022-06-16 11:48:06] [error] ( javajni.c:912 ) [ 6936] FindClass org/openqa/grid/selenium/GridLauncherV4 failed

There is no GridLauncher class in Selenium 4. No V4, No V3, nothing. The selenium team destroyed this functionality.

Stan Smith

unread,
Jun 18, 2022, 4:47:06 AM6/18/22
to Selenium Users
For those of you who stumble upon this article...just use NSSM instead of prunsrv. It's so much easier.


actual site for nssm: http://nssm.cc/commands 

Reply all
Reply to author
Forward
0 new messages