As of now, I have a single cucumber scenario which runs with a json file with single API request. I want to run the same scenario for multiple API request using same json. So I can verify multiple api test.
@Test1
Feature: Test_Multiple_API_Karate
Scenario: Exe - Individual Rule
* url restBaseApi
* configure headers = read('classpath:headers.js')
* def caseRequest = read('../data/caseRequest.json')
* def caseExpectedResponse = read('../data/caseExpectedResponse.json')
Given path ‘case-Karate-request’
And request caseRequest[i]
When method POST
Then status 200
Then print response
And match response == caseExpectedResponse[i]
We need to run karate request with caseRequest.json (as mentioned below)
[ { "srId": "1-2A1”, "process": “Information”, "area": “Software”, "subArea": “Technical”, "status": “Open” }, { "srId": “1-2A2”, "process": “Manufacture”, "area": “Software”, "subArea": “SAP”, "status": “Closed” } ]
How to run this scenario with the test data for both request in single execution.