HTTP Headers
Solved!Posted in General by Motig Tue Feb 03 2015 22:27:30 GMT+0000 (Coordinated Universal Time)·2·Viewed 1,850 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("[email protected]")
.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?
(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.
marked this as solved