[
{
"id": 1,
"location": "usa"
},
{
"id": 2322,
"location": "japan"
},
{
"id": 33,
"location": "uk"
}
]
I have captured the all locationId
s into a variable called locationId
. But, I need to iterate the list of locationId
dynamically for another API path.
GETGET https://example.com/location/<idNo>
Eg:
iteration1: https://example.com/location/1
iteration2: https://example.com/location/2322
iteration3: https://example.com/location/33
Is this possible?
What is the right approact to implement the above example by using Karate Framework?
Here you go. Explained here: https://stackoverflow.com/a/75027059/143475
Feature:
@setup
Scenario:
* def data = [ { id: 1, location: 'usa' }, { id: 2322, location: 'japan' }, { id: 33, location: 'uk' } ]
Scenario Outline:
* url 'https://httpbin.org/anything'
* path id
* method get
Examples:
| karate.setup().data |