Reputation: 77
i have one response as below
"data":{"books":{"isbn":"97895113132","Bookid":10196333}}
sometimes i will get Bookid as null.
my question is, i have to take this bookid only if it is not null, and then pass to next api as query parameter.
please help to find the solution for this using karate framework
Upvotes: 1
Views: 585
Reputation: 58058
Easy, if you use the params
keyword, any value of null
is not sent as a param. You can try this:
* def temp = null
Given url 'http://httpbin.org'
And path 'get'
And params { foo: '#(temp)' }
When method get
Then status 200
If you are looking for conditional-logic - please read: https://github.com/intuit/karate#conditional-logic
Upvotes: 1