从命令行停止 ASP WebDev 和 Selenium 服务器
我第一次将 Selenium 测试引入我的构建中。 我认为要在 NAnt 中执行此操作,我必须首先启动 WebDev 服务器:
<exec program="path/to/WebDev.WebServer.exe"
commandline="/port:51150 /path:path/to/website"
failonerror="true"
resultproperty="selenium.webdev.server.running"
spawn="true">
</exec>
然后启动 Selenium 服务器:
<exec program="path/to/java.exe"
commandline="-jar path/to/selenium-server.jar"
failonerror="false"
spawn="true">
</exec>
然后运行我的测试。 这有效。 我不明白的是,当我的测试完成后,如何杀死 WebDev 和 Selenium 服务器?
I am introducing Selenium tests into my build for the first time. I figured that to do this in NAnt, I would have to start the WebDev server first:
<exec program="path/to/WebDev.WebServer.exe"
commandline="/port:51150 /path:path/to/website"
failonerror="true"
resultproperty="selenium.webdev.server.running"
spawn="true">
</exec>
Then start the Selenium server:
<exec program="path/to/java.exe"
commandline="-jar path/to/selenium-server.jar"
failonerror="false"
spawn="true">
</exec>
Then run my tests. This works. What i can't figure out is how do I kill the WebDev and Selenium servers when my tests have finished?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是我在本地执行的操作,但也应该通过简单的 http get 请求远程工作:
http://localhost:4444/selenium-server/driver/?cmd=shutDown
或对于 Selenium 1.0.1 后版本:
将“shutDown”替换为“shutDownSeleniumServer”
Here is what i do locally, but should work remotely too with a simple http get request:
http://localhost:4444/selenium-server/driver/?cmd=shutDown
or for post 1.0.1 versions of Selenium:
replace "shutDown" with "shutDownSeleniumServer"
James,我通过应用测试程序集初始化和清理机制成功解决了 Selenium 启动/停止问题(请参阅我的
James, I managed to solve Selenium starting/stopping problem by applying the test assembly initialization and cleanup mechanism (see the rest of the discussion on my blog):
我们通常让 Selenium 服务器在我们的构建服务器上一直运行,这样更实用。
We usually leave the Selenium server running all the time on our build servers, it's more practical that way.
如果做不到这一点,总是有值得信赖的旧pskill。 这是一个大锤子的方法,但它可以有效地杀死 webdevwebserver :-)
我对 selenium 知之甚少,所以如果 pskill 无法阻止它,请提前道歉
Failing that, there's always the trusty old pskill. It's a big hammer approach, but it works a treat to kill off webdevwebserver :-)
I know very very little about selenium, so apologies in advance if pskill is no good for stopping it