vendredi 28 juin 2019

How do i parameterize parameters i am passing in my API request & execute through Karate?

I am testing API's for my application & each API has multiple parameters to be passed, ex. below: https://abc.xyz.com/***.svc/restful/GetSummary?FromDate=2019/06/28&ToDate=2019/06/28&CompAreaId=15&RegId=4

Each parameter in the request has multiple values (within a defined set of values), so if i want to parameterize each parameter with all the values it could possibly have, how can i create a scenario that will help me achieve this?

I would appreciate any hints/views. Thanks

I have been passing parameters as shown in the code below, but unable to pull of the scenario above mentioned, it would be time consuming & repetitive to pass parameters in a seperate scenario each time.

Scenario: Verify if GetContext API returns data with params

Given path 'GetContext'
And param FromDate = '2019/06/27'
And param ToDate = '2019/06/27'
And param CompAreaId = 20
And param RegId = 4
When method get
Then status 200
* def res = response
* print 'response:', response

Aucun commentaire:

Enregistrer un commentaire