将 Selenium RC 作为 Windows 服务运行

发布于 2024-10-02 06:29:37 字数 901 浏览 1 评论 0原文

我正在尝试将 Selenium 设置为 Windows 服务运行。看起来没问题,但是似乎运行不正常。

使用我已经完成的Windows工具包:

"C:\Program Files\Windows Resource Kits\Tools\instsrv.exe" SeleniumRC
"C:\Program Files\Windows Resource Kits\Tools\srvany.exe" -a [SeleniumUser] -p [SeleniumUserPass]

将以下内容保存为.reg文件(然后双击它)

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"

我的SeleniumUser已被授予作为服务登录的权限。

在服务 MMC 中启动了服务,

但是当我运行我的测试中心(用于调用和运行测试的简单 UI)时,我单击“运行”测试,然后它只是坐在 plage 加载漩涡状的东西上,并表示正在等待服务器的响应。

它几乎就像正在运行,但是它没有连接。

如果我通过命令行运行 java 调用,它会告诉我另一个服务正在该端口上运行。

如果我停止 Windows 服务然后再次运行该命令,它会起作用(我的测试也是如此)

有人知道发生了什么吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

っ〆星空下的拥抱 2024-10-09 06:29:37

我能够使用 nssm(Non-Sucking Service Manager)安装它。您只需提供 java 作为应用程序,然后提供选项 -jar -role hub。然后从服务菜单启动该服务。

链接到 nssm - http://nssm.cc/

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/

凌乱心跳 2024-10-09 06:29:37

当我尝试将 Selenium RC 作为服务运行时,我遇到了类似的问题。我遇到的基本问题是我的注册表项不正确。使用“sc”命令创建带有 srvany.exe 的服务,然后更新注册表。应该可以做到这一点。有关更详细的说明,请查看这篇文章: http://www.claytonstechnobabble.com/2011/08/run-any-application-as-windows-service.html

-Clayton

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

哽咽笑 2024-10-09 06:29:37

http://brantleytec.blogspot.com /2012/11/selenium-hub-and-node-as-windows-service.html

该链接描述了使用本机 Microsoft 程序设置和使用 Selenium hub 和/或节点即服务的过程。我能够在我的工作电脑上本地运行它,并在每次构建后运行我的测试的远程服务器上运行它。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文