thunderclient / thunder-client-support

Thunder Client is a lightweight Rest API Client Extension for VS Code.
https://www.thunderclient.com
Other
3.64k stars 129 forks source link

Allow multiple iterations in collections runner #95

Closed PikaFederation closed 2 years ago

PikaFederation commented 3 years ago

Describe the solution you'd like As the title says, I would like to be able to run x times a collection (the same function as postman does!). It could be awesome! 😁

rangav commented 3 years ago

Hi @PikaFederation will add to the roadmap.

rangav commented 3 years ago

Hi @PikaFederation is your use-case similar to https://github.com/rangav/thunder-client-support/issues/298#issuecomment-898578218 ?

I can provide the option to run multiple times easily - without the tabs for each iteration, let me know if that will be useful?

PikaFederation commented 3 years ago

Hi @PikaFederation is your use-case similar to #298 (comment) ?

I can provide the option to run multiple times easily - without the tabs for each iteration, let me know if that will be useful?

Hi, yes it'll be!

rangav commented 3 years ago

Ok good, will include this feature in next update

thisisdev-patrick commented 2 years ago

I run my e2e tests with an iterations file (using 10 different scenario's, vars differ). Will that be supported? Thanks in advance

rangav commented 2 years ago

@thisisdev-patrick yes its in roadmap.

piotr-szyk commented 2 years ago

As per rangav request I am adding my test case here. Reference: https://github.com/rangav/thunder-client-support/discussions/560.

I am using Postman collection runner with csv as a source data file to run the same API call with a different value each time based on the values in the csv file. For example, if the API call is defined with a variable (in this case {{user}}), the values for the variable user would be taken from the external data source (csv file) and render the output for each user:

GET myapi/{{user}}

Data file (csv example): user Adam Monica Ranga

The expected outcome would be the following API requests: GET myapi/Adam GET myapi/Monica GET myapi/Ranga

I hope this makes sense.

Thank you.

jordanrvillarreal commented 2 years ago

I have the similar use cases as described above, but for POST. I have a very simple API interaction that looks like this:

{
  "name": "{{manufacturerName}}",
  "url": "{{manufacturerUrl}}"
}

And I would like to be able to use a CSV to populate the variables in the POST multiple times. CSV would look like this:

manufactureName,manufactureUrl
Cisco,www.cisco.com
Juniper,www.juniper.com
Palo Alto,www.paloaltonetworks.com

Which would result in (only doing the first one):

{
  "name": "Cisco",
  "url": "www.cisco.com"
}

Thank you!

rangav commented 2 years ago

@PikaFederation thanks for sharing your use-case details, it's in my priority list, will implement asap.

rangav commented 2 years ago

Hi All, Started development on this feature. nearly 80% done. Hoping to finish by weekend.

Will share few screenshots and also how it works later.

Once I finished development, I want you guys to help me in beta testing this feature.

let me know who will be available for testing?

rangav commented 2 years ago

Hi All, finished development of this feature.

Would you like to test? I can upload file here for testing

rangav commented 2 years ago

Here are screenshots of the feature, Let me know your feedback or any questions

run-1 (1) run-2 run-3
genieai-vikas commented 2 years ago

@rangav I would like to test it. could you share file

genieai-vikas commented 2 years ago

@rangav Thanks Rangav. I did quick test. Here is my findings

  1. My test ran 174 times but I am not able to find all the results. In below screenshot I can see only current iteration result. I can see all result only when I export it.

  2. I exported result in csv. my test ran 174/10000(I cancelled) but in report I see result Error for all iteration after 174. It should be sometime cancel/not executed/ or just generate report of the ran iteration.

  3. image

  4. image

rangav commented 2 years ago

Hi @genieai-vikas thanks for the feedback. Will fix those issues.

To see results of the other iterations move the slider to the iteration required.

Screenshot 2022-08-10 at 23 09 08
rangav commented 2 years ago

one question: how many max iterations you would run normally?

genieai-vikas commented 2 years ago

@rangav Ah! I didn't use the slider. Cool! it's all good now. Also, Can I add one more suggestion. Can we add column for pass and fail. Suppose I ran my test 1000 times(900 pass, 100 fail). How can I quickly see how many of it is passed and failed(just the count). I can check on the csv but it's good to have.

one question: how many max iterations you would run normally?

Normally 100-200 but when I have to check the performance for long duration. I increase it to 5000-10000

rangav commented 2 years ago

@genieai-vikas thats a good suggestion too, will implement that.

Auto-Scroll feature

If you run more than 10-20 tests, then there is cool auto-scroll feature, the page goes up-down automatically. you can test and let me know any feedback on this too.

genieai-vikas commented 2 years ago

@rangav Sure! I will test this scenario today

rangav commented 2 years ago

This feature is now implemented and published to marketplace, please update to v1.18.0

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

Please let me know your feedback.

rangav commented 2 years ago

Hi All, can you please let me know any further feedback on this feature?

JoelRozencweigPPN commented 2 years ago

Hello, how are you supposed to write the variables in the URL? I've tried with {{variable}} but it doesn't work …

JoelRozencweigPPN commented 2 years ago

(Never mind, it finally worked 😄) great feature, thanks a lot!

JoelRozencweigPPN commented 2 years ago

OK 👍 Some additional feedback, I'm generally using CSV for data files, it would be great if you could support this file type in the future …

rangav commented 2 years ago

@JoelRozencweigPPN thanks for feedback, can you please create a new feature request, we can discuss there