1

I have an API that returns a list of ~30,000 SKUs. I then need to insert each SKU into the query parameter URL of another API to validate the response of this second API. I know that something like this is possible with Jmeter where you could possibly do this via a CSV file. How can I accomplish this via REST Assured? An example/sample would be greatly appreciated!

Similar question also applies to using outputs from an API to use as input in body content...

Thanks.

Krishnan Mahadevan
  • 13,480
  • 5
  • 33
  • 61
Styris
  • 9
  • 5

2 Answers2

0

Short answer.You can't as it comes to query parameters. You can have no more than 2000 characters in your URL. Explanation here : What is the maximum length of a URL in different browsers?

With respect of POST method you don't have constraints.

Alexander Petrov
  • 8,875
  • 26
  • 66
0

If you are open to evaluating alternatives to REST-assured, Karate allows you to easily achieve such a data-driven test and it is based on Cucumber as well.

Disclaimer: I am the dev.

In the demos you will find a number of examples that use dynamic JSON data to drive a loop making an HTTP call. Yes, you can dynamically use the data in HTTP responses also in future steps.

Peter Thomas
  • 47,282
  • 14
  • 68
  • 196
  • Can you provide me with the example of a code snippet for this exact scenario, using Karate? Thanks – Styris Sep 05 '17 at 18:14
  • @Styris there are plenty in the demos. Take a look at this specific line (29): https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/calldynamic/call-dynamic-json.feature#L29 – Peter Thomas Sep 05 '17 at 18:20