Running Selenium RC as a Windows Service

天涯浪子 提交于 2019-11-29 23:20:28

问题


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?


回答1:


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/




回答2:


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




回答3:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!