Skip to content

The semantics of insomnia.execution.setNextRequest(), request looping #8250

Answered by ihexxa
janspudich asked this question in Help
Discussion options

You must be logged in to vote

Hello @janspudich,

In short, setNextRequest has following behaviors:

  • It can jump to any request which follows the current request, or itself (the case 2 you mentioned)
  • It can not go back to any previous request. (the case 1 you mentioned)
  • The request will still be sent if it is called in pre-request script (the case 3)

For your case, I assume it is allowed to:

  1. Collect all risks at first (send Request B for all resources in a loop)
  2. Collect all issues secondly (send Request C for all resources in another loop)

You could try something like:

  • Start runner with 3 requests:
    • Req A
    • Req B
    • Req C
  • When got resources from Req A, in script, set all resources as an array by insomnia.variables.set…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@janspudich
Comment options

Answer selected by janspudich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants