Hi,
I am looking to validate a get request response body against a previously run request using the same data.
So essentially if I send a get request and receive this response -
{
“Name”: “Dan”,
“Jobtitle”: “QA Tester”,
“Location”: UK
},
I know I will get that same response every time I call this API. What I want to validate as part of my automated tests is that static data doesn’t change, if it does change I want it to flag this so I can check it against our API docs.
Currently I am using basic string validation to ensure “Name”, “Job Title” and “Location” are displaying for example but that process has resulted in over 800 tests which is painful to maintain and still doesn’t tell me if new lines have been added into the response.
In an ideal world it would be as simple as save the current JSON request as a text document, then in my tests reference that document essentially saying “Your response should match this, if no, test fails”, does this exist or will I just have to make do by writing another thousand or so string validations to check each response line?
Thanks for the help!