HTTP Headers

Solved!
Posted in General by Motig Tue Feb 03 2015 22:27:30 GMT+0000 (UTC)·2·Viewed 968 times

Hello Is there a way to detect the header response, when the form is submitted? For example SUT.FindFormFor<RegistrationViewModel>() .Field(x => x.Email) .SetValueTo("test@email.com") .Field(x => x.Password) .SetValueTo("12345") .Submit(); At this point, if the response is HTTP 500, the testing goes on. "When" does not fail. Is there a way to assert that the response must be HTTP 200?
Matt Honeycutt
Feb 9, 2016

(Apparently readme.io does not always E-mail me when questions are posted. My bad!)

No, unfortunately the underlying Selenium WebDriver does not expose the HTTP response code. That's a topic of much arguing over in the Selenium camp, but it sounds like that is (probably) not going to happen.

I could, however, add something to detect a Yellow-Screen-Of-Death error and throw an exception... I think that behavior makes sense. I'll open a GitHub issue for it.


Matt Honeycutt marked this as solved
Markdown is allowed