thunder-client-support icon indicating copy to clipboard operation
thunder-client-support copied to clipboard

Run request multiple times with different parameters

Open rokbjc opened this issue 3 years ago • 5 comments

I would like to test single endpoint with permutation of multiple combination of parameters. Lets say we have request like this:

/chart?period={{period}}&asset={{asset}}&language={{language}}

Currently i need to create one request for each combination I want so in case of following options:

period = [1, 7, 30]
asset = ["BTC", "ETH"]
language = ["en", "de"]

I need to copy single request 12 times and redefine its parameters. It would be nice if I could run single request with all permutations or maybe randomly n-times.

There is similar implementation of this in software artillery where parameters are set randomly. Config looks like this:

config:
  target: "https://localhost"
  http:
    timeout: 5
  phases:
    - duration: 120
      arrivalRate: 100
      rampTo: 5000
  variables:
    asset:
      - "btc"
      - "eth"
    lang:
      - "en"
      - "de"
    period:
      - "1"
      - "7"
      - "30"
scenarios:
  - name: "Get Chart"
    flow:
      - get:
          url: "/chart?period={{period}}&asset={{asset}}&language={{language}}"

rokbjc avatar Aug 31 '22 11:08 rokbjc

@rokbjc You can use run collection to run multiple times, please see the screenshots below

Screenshot 2022-08-31 at 22 51 14

input data file for variables - data.json Screenshot 2022-08-31 at 22 52 15

rangav avatar Aug 31 '22 17:08 rangav

after i went thru release notes i found this feature. I implemented my use case and i made it work, but I stumble upon different issue:

  • for multiple endpoints i use multiple data files. In this case i can not run whole collection because data file is not connected to endpoint, but to current "run".
  • finding failed request with slider when there is a lot of iteration (1000+) can be quite time consuming
  • when I get failed request and try tu rerun it, variables from data file are not available any more

Currently i am thinking to generate json objects and inject it to thunderclient.json file somehow, but this solution feels like bad hack.

rokbjc avatar Sep 01 '22 08:09 rokbjc

Thanks @rokbjc for the feedback. Will think of how to improve based on above issues.

rangav avatar Sep 01 '22 09:09 rangav

thunderclient.json modifying directly Is not recommended, but still if you want to go ahead make sure it is in git source or create a backup of it.

rangav avatar Sep 01 '22 09:09 rangav

Run single request is now implemented in RunCollection View.

Screenshot 2022-09-15 at 19 09 58

See all features released https://github.com/rangav/thunder-client-support/releases/tag/v1.19.0

Please let me know your feedback.

rangav avatar Sep 15 '22 18:09 rangav

  • Now you can find failed iterations easily, the list is displayed as below.
  • Click on the failed number to see iteration history

Please update to v1.19.3

Screenshot 2022-09-26 at 04 42 23

See all features released https://github.com/rangav/thunder-client-support/releases/tag/v1.19.3

rangav avatar Sep 26 '22 03:09 rangav

I am closing the issue, feel free to re-open if needed

rangav avatar Sep 26 '22 03:09 rangav