Contributions
Re: Assert for java.net.SocketException when executing "HTTP Request" Test Step
Yes.. Unfortunately. Not too helpful. In this case the http server is completely offline. Like. No response period. Hence the Socket Exception. I just need a way to assert that this is in fact what I am looking for! The fact that there is no service running on the endpoint is a successfully test in this scenario. Understood... i.e. no payload, hence, "not contains" exception is not working here. Funny though. I have used that same assertion type on REST services and they will work for when there is zero response from the URL. Just seems to be something with the "HTTP Test" vs. "REST Test" step types, that are not quite the same here (i.e. how the underlying engine implements them). Neil Jetty Senior Application Architect T: 905-614-3622, M: 416-487-4000 neil.jetty@bell.ca [cid:image001.png@01D82CE2.A7E31DA0]3 years agoPlace ReadyAPI QuestionsReadyAPI Questions629Views0likes0CommentsRe: Assert for java.net.SocketException when executing "HTTP Request" Test Step
Yes.. Unfortunately. Not too helpful. In this case the http server is completely offline. Like. No response period. Hence the Socket Exception. I just need a way to assert that this is in fact what I am looking for! The fact that there is no service running on the endpoint is a successfully test in this scenario. Understood… i.e. no payload, hence, “not contains” exception is not working here. Funny though. I have used that same assertion type on REST services and they will work for when there is zero response from the URL. Just seems to be something with the “HTTP Test” vs. “REST Test” step types, that are not quite the same here (i.e. how the underlying engine implements them).3 years agoPlace ReadyAPI QuestionsReadyAPI Questions630Views0likes0CommentsAssert for java.net.SocketException when executing "HTTP Request" Test Step
I have a test suite that I am working on for our disaster recovery set up. In this scenario, I expect certain HTTP servers to be offline on certain VMs. I created a "HTTP Request" test step and thought that using a "Not Contains" assertion would do the trick. Unfortunately, the assertion (which I am expecting to pass) fails... stating "null/empty response body". The Log shows "java.net.SocketException" (expected). I've used this trick for Rest services I expect to be "down/offline" and it works. Is there any way to assert that an http server is offline successfully?649Views0likes3Comments