selenium - 如何使用 behat + mink 和 selenium 驱动程序获取页面状态代码?

标签 selenium behat mink

Selenium 不支持此代码

$statusCode = $this->getSession()->getStatusCode();

可以通过其他方式检查状态吗?

最佳答案

这不是 Selenium 的设计目的。他们的项目成员之一 reply to request to implement this in Selenium said :

We will not be adding this feature to the WebDriver API as it falls outside of our current scope (emulating user actions).

解决方案是使用另一个支持状态代码的驱动程序,或者尝试实现一种可用的 hack(在 other stack overflow questions asking the very same thing 中给出)。

关于selenium - 如何使用 behat + mink 和 selenium 驱动程序获取页面状态代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34219380/

相关文章:

php - 在使用 Behat 和 Symfony2 的场景之前登录

php - 如何使用 Selenium 2 驱动程序在 Mink 中设置页面加载超时?

php - Behat/Mink 和 Select2 组合

php - BDD 测试有太多后台作业?

java - 在 Eclipse 中运行第一个 Selenium 测试后出现错误

java - 如何将动态参数传递给testNG中的dataProvider方法

Selenium Webdriver等待来自另一个元素的元素

facebook - 在 Behat Mink 中的场景之间重置 session 。怎么禁用?

behat - 使用Behat和Mink测试拖放

ruby - 使用用于 Ruby 的 Selenium Webdriver 进行 HTML5 拖放