Search code examples
seleniumbehatmink

How can I get page status code using behat + mink with selenium driver?


Selenium does not support this code

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

It is possible to check status any other way?


Solution

  • This is not what Selenium was designed for. One of their project member in 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).

    The solution is to either use another driver that supports status codes, or try to implement one of available hacks (given in other stack overflow questions asking the very same thing).