【问题标题】:Is it posible to programmatically check if the selenium Remote Webdriver Server is running or not是否可以以编程方式检查 selenium Remote Webdriver Server 是否正在运行
【发布时间】:2013-03-11 10:45:26
【问题描述】:

您好,是否可以使用 C# 检查远程 webdriver 服务器是否正在运行。 ping 服务器没有帮助,你能告诉我们应该进行什么类型的调用以及我们可以从服务器得到什么反馈

【问题讨论】:

  • 你用谷歌搜索过代码吗?
  • 是的,我找不到任何东西,因为我无法 ping 我可以做些什么来检查 selenium 服务器是否已启动

标签: c# selenium remotewebdriver


【解决方案1】:

您应该真正定义“跑步”的含义。

您可以通过向服务器发送 JSON 请求来获取服务器的一般状态。

您会看到服务器将实现 Wire 协议,因此这意味着它将或至少 应该响应以下 REST url 列表:

http://code.google.com/p/selenium/wiki/JsonWireProtocol

具体来说:

http://code.google.com/p/selenium/wiki/JsonWireProtocol#/status

可能

http://code.google.com/p/selenium/wiki/JsonWireProtocol#GET_/sessions

status 应该会:

The server should respond with a general "HTTP 200 OK" response if it is alive and accepting commands

如果这就是您所说的“正在运行”的意思,即它是活的并且正在踢并且愿意接受命令,那么您需要向 /status 发送请求并检查您得到的响应。

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-01-31
  • 2012-03-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-12-31
  • 2013-06-29
相关资源
最近更新 更多