I'm trying to get Selenium setup to run as a windows service. It seems to be okay but, then does not seem to run properly.
Using the windows toolkit I have done:
"C:\Program Files\Windows Resource Kits\Tools\instsrv.exe" SeleniumRC
"C:\Program Files\Windows Resource Kits\Tools\srvany.exe" -a [SeleniumUser] -p [SeleniumUserPass]
Saved the following as a.reg file (and then double clicked it)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SeleniumRC\Parameters]
"Application"="java.exe"
"AppDirectory"="C:\\Program Files\\selenium-server-1.0.3"
"AppParameters"="-Xrs -jar selenium-server.jar"
My SeleniumUser has been granted log on as a serivce permission.
Started the service in Services MMC
But when I come to run my test hub (simple UI to call and run tests) I click run on a test then it just sits with the plage loading swirly thing and says waiting for a response from the server.
Its almost as if it is running but, it doesnt connect.
If I run the java call through the command line, it tells me another service is running on that port.
If I stop the windows service and then run the command again, it works (and so do my tests)
Does anyone have any ideas whats going on?
I was able to install it using nssm (the Non-Sucking Service Manager). You just need to provide java as the application and then provide the option -jar -role hub. Then start up the service from the services menu.
Link to nssm - http://nssm.cc/
I ran into a similar problem when trying to run Selenium RC as a service. The basic problem I had was that my registry entries were incorrect. Use the "sc" command to create the service with srvany.exe and then update the registry. That should do it. For a more detailed explanation, check out this post: http://www.claytonstechnobabble.com/2011/08/run-any-application-as-windows-service.html
-Clayton
http://brantleytec.blogspot.com/2012/11/selenium-hub-and-node-as-windows-service.html
That link describes the process setting up and using Selenium hub and/or node as a service using native Microsoft programs. I was able to get this running locally on my work PC as well as on a remote server which runs my tests after every build.
来源:https://stackoverflow.com/questions/4164090/running-selenium-rc-as-a-windows-service