alexandrehtrb / Pororoca

An API testing tool with support for HTTP/2 and HTTP/3. Alternative to Postman.
https://pororoca.io
Other
500 stars 38 forks source link

Iterate through List of Values #40

Closed phonique closed 8 months ago

phonique commented 1 year ago

Hey Alex,

Accidentally found Pororoca and was wondering, if it'd be a big effort (and if you'd find it useful) to add a feature to automatically iterate through a list/array e.g. if you have somedomain.foo/{{User}}/someaction and {{User}} is a list of values, to perform an individual request with each of them and save the responses.

Thanks!

alexandrehtrb commented 1 year ago

Hello @phonique ,

This is a great idea. It could be used in many scenarios, like load testing and multiple requests at the same time.

JMeter, for example, allows this kind of multiple parameterized requests by taking values from a CSV input file, and these values can be used in the URL, body and headers. Do you think something similar would fit as a solution?

phonique commented 1 year ago

Great, that you like the idea, @alexandrehtrb !

A CSV similar to JMeter would certainly work well, as it would then also be possible to have the list generated (externally). Including a rudimentary way to create a list in the UI would still be very useful for smaller numbers of values.

Admittedly, I haven't looked how the current collections are saved and whether it would break interoperability with postman if you include files (inline?) in there, but if that's possible, a "file" per variable would probably be a straightforward convention to follow.

alexandrehtrb commented 11 months ago

Take a base HTTP request

Input data:

Repetition modes:

MaxDOP: maximum number of parallel requests

Report:

-> Show input line used for each request -> Button for saving a response body -> Needs to work for Pororoca.Test automated tests too -> Example of JSON array input data, each object is an input line:

[
  {
    "MyVar1": "123",
    "MyVar2": "ABC"
  },
  {
    "MyVar1": "456",
    "MyVar2": "DEF"
  }
]
alexandrehtrb commented 8 months ago

Solved in release 3.1.0!