Requirement: I want to iterate each row in example section on the basis of a field (ProductType) present in input Json.
ProductType can have value 11 or 22 or 33. But expectedAmount for those should be same. I am giving a snippet below-
**Feature:** To check expected results for different values of ProductType
Background:
* url http://localhost:8080
* header Content-Type = 'application/json'
Scenario Outline: To check expected results for different values of ProductType
Given path PATH
And request <data>
When method POST
Then status 200
And match $.Parent[0].Amount == expectedAmount>
Examples:
| data | ExpectedAmount |
| read('classpath:' + INPUT_JSON_PATH + '/Test1.json') | 1234.56 |
| read('classpath:' + INPUT_JSON_PATH + '/Test2.json') | 6789.12 |
| read('classpath:' + INPUT_JSON_PATH + '/Test3.json') | 3453.56 |
Json Input:
{
"Parent" : [ {
"Id" : "1",
"productType" : 11
}]
}
Can you please suggest a solution for it?
Thanks, Abhi