Earlier today I had an issue where my tests would fail in case the service went down, the response would be in HTML format and since I parsed the response data and checked the values, my tests would fail.
I have fixed this by adding a response header check, where I make sure the Content-Type received is application/json.
What would be things to check for to attempt and make sure issues such as this do not fail my tests?
Does anyone have any tips for me?
I have additional questions.
Should I always make sure the parameter I am attempting to save as a variable exists in the response?
Thank you!
I am open to any tips/examples in case you can provide some.