Usage variable in requests for web api fuzz testing

Hi,

I am trying to use Postman and variable (input) for our API Fuzz Testing but I don’t know if it’s the right purpose.

1/ Our request i.e.


, http://testing.purpose.com/type/{{userId}}/hello

  • it’s GET request

  • userId → I would run different inputs defined in variable, see attachment

→ i.e. having variable from 1 - 100.000 and each different value

→ and for each entry to run my request

2/ Pls, how can I use variable as described in point 1/?

I am trying to reach info from web Store and reuse values using variables | Postman Learning Center.

Many thanks.

Regards,

Tomas

It might be a language barrier, but I don’t really understand your issue.

It sounds like you are potentially talking about storing 100 variables which seems excessive.

Therefore, to help understand your issue a bit better, can you share some details on the actual GET request and what that looks like. In particular, the parameters or body that you need to send with the request.

Do you have any documentation in relation to the API itself to help guide us?

I suspect what you mean is that you want to loop through 100 requests with different user ID’s? (But this is totally an guess and would prefer if you could clarify).

Hi,

yes, it’s about looping my GET request and put there value from variable. And it can be thousands testing values. Just checking if this approach is fine (the best practice).

Something like this:
for (int userId=1, i < 10000, i++ )
http://testing.purpose.com/type/{{userId}}/hello

So requests could look like:
userId = 1 =>> http://testing.purpose.com/type/表ポあA鷗ŒéB逍Üߪąñ丂㐀𠀀/hello
userId = 2 =>> http://testing.purpose.com/type/˙ɐnbᴉlɐ ɐuƃɐɯ ǝɹolop ʇǝ ǝɹoqɐl ʇn ʇunpᴉpᴉɔuᴉ ɹodɯǝʇ poɯsnᴉǝ op pǝs 'ʇᴉlǝ ƃuᴉɔsᴉdᴉpɐ ɹnʇǝʇɔǝsuoɔ 'ʇǝɯɐ ʇᴉs ɹolop ɯnsdᴉ ɯǝɹo˥/hello

userId = 3 =>> etc. … go via variable 1 - N

Thx a lot.

Stick your test data in a CSV file and use the Collection Runner.

You reference the data in the CSV file by their headers using the same way you reference any other variable. {{variableName}} so you don’t have to write any code for this. It will run your request(s) once for each line in the CSV file.

The following links show you how to work with data files.

Using CSV and JSON Data Files in the Postman Collection Runner | Postman Blog

Run collections using imported data | Postman Learning Center

I really wouldn’t run 10,000 requests in one go. I would probably split this into smaller CSV files and run them separately. In bunches of 500 perhaps.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.