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
  • 14,121
  • 6
  • 34
  • 66
Styris
  • 9
  • 6

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
  • 9,204
  • 31
  • 70
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
  • 54,465
  • 21
  • 84
  • 248
  • 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