I am trying to use the sendRequest in the tests.
Here I am getting the some data from API,
and trying to delete it using another API.
For delete request, I need a token for which I need another API.
Below code is working fine and sometimes it is not working due to the reason there is already a request trying to process.
I have added timeout as well but that is not helping much
I have resolved it by sending only one request.
I constructed json object based on the count, I got in the response and that json object directly in one request
For the question posed, I’m not quite understanding why this couldn’t just be a folder, with the three requests in order.
The initial GET request, then the TOKEN request, and finally the DELETE request, passing the values between the requests with collection or environment variables.
I am having a folder and set of requests it.
Now there are 2 requests in the folder which are going to create new data into the system.
When calling those endpoints, prerequisite is to clear the existing data and create new data.
This will help us to have the constant data while doing some validation
If in case the data is not deleted then during the validation, count will fail and also we can’t guarantee the data to be in the expected order
Above 3 sendrequests will help us to delete all old data and keep test cases success