We’re looking at using request chaining to test various parts of our api.
I’ve read docs on request chaining, but they don’t really show realistic scenarios where there are many endpoints and multiple tests associated with those endpoints.
How do we create request chains without littering setNextRequest all over the place?
I thought of creating a folder for each test, but then we’d have to copy requests into the folder thereby making us update multiple endpoints when we make a change.
Any help or pointers to tutorials would be greatly appreciated.
I don’t think there is any best practice per se.
I guess its down to what works for you.
Personally, I use setNextRequest sparingly, and usually just create folders with the appropriate requests in order and use collection\environment variables to pass data between the requests.
The Collection is the Test Suite, the Folders are the Test Cases, and the individual requests are the Test Steps.
The problem with this is that you can’t reuse steps, so if you have a couple of test cases that are similar, you may have to update multiple tests when you make changes.
I do use setNextRequest and array.shift() when I want to loop a particular step\request, but not the whole test case.