Sometimes we need to extract the response/or part of it coming from API so that we can test with it for correct sets of output, before writing final code for it. Here are the steps for same. 1. After calling API(ignore the calling methods) and storing the response in variable…