问题描述
使用Selenium 1,可以输入URL来停止服务器:
With Selenium 1 there was the possibility to enter a URL to stop the server:
http://:/selenium-server/driver/?cmd = shutDown
http://:/selenium-server/driver/?cmd=shutDown
硒2中有类似的方法吗?
Is there a similar way in Selenium 2?
我尝试使用以下URL检查服务器是否正在运行:
I tried the following URL to check whether the server is running:
http://:/wd/hub/
http://:/wd/hub/
,但这仅返回HTTP错误503(服务不可用).我还可以访问其他URL来验证服务器是否正在运行吗?
but that only returns an HTTP ERROR 503 (service unavailable).Is there any other URL I can access to verify that the server is running?
推荐答案
2.0中的Selenium服务器包含与Selenium 1中相同的所有代码,因此检查http://localhost:4444/selenium-server/driver?cmd=getLogMessages
将测试是否存在服务器.同样,您可以发出http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer
来关闭服务器.
The Selenium server in 2.0 contains all of the same code that was in Selenium 1, so checking for, say, http://localhost:4444/selenium-server/driver?cmd=getLogMessages
will test for the existence of the server. Likewise, you can issue http://localhost:4444/selenium-server/driver?cmd=shutDownSeleniumServer
to shut the server down.
最近在 JSON有线协议/status URL. >由服务器的2.0部分使用,但我不确定它是否已在远程服务器中实现.实施时,这将由http://localhost:4444/wd/hub/status
访问.此外,有线协议中还没有等效的关闭URL.
There was recently a new /status
URL added to the JSON wire protocol used by the 2.0 parts of the server, but I'm not certain it's been implemented in the remote server just yet. This would be accessed by http://localhost:4444/wd/hub/status
, when implemented. Additionally, there isn't yet an equivalent shutdown URL in the wire protocol.
这篇关于Selenium 2:如何检查服务器是否正在运行并停止服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!