将 Selenium RC 作为 Windows 服务运行 [英] Running Selenium RC as a Windows Service

查看:28
本文介绍了将 Selenium RC 作为 Windows 服务运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让 Selenium 设置作为 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.

使用我做过的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文件(然后双击它)

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"

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

My SeleniumUser has been granted log on as a serivce permission.

在Services MMC中启动服务

Started the service in Services MMC

但是,当我开始运行我的测试中心(调用和运行测试的简单 UI)时,我点击了运行测试,然后它只是与 plage 一起加载旋转的东西并说等待服务器的响应.

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.

它几乎就像在运行一样,但它没有连接.

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

If I run the java call through the command line, it tells me another service is running on that port.

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

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?

推荐答案

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

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.

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

Link to nssm - http://nssm.cc/

这篇关于将 Selenium RC 作为 Windows 服务运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆