Hot answers tagged

3

Hi you can use multiline argument (docstring) for this: https://cucumber.io/docs/gherkin/reference/#doc-strings Your step definition: Here you pass the json between """ and """ Given a blog post named "Random" with Markdown body """ { "benefitPlanIDs": [ { "benefitPlanID": "011748abc", "benefitPlanPlatform": "abc" } ], "clientId": "abc", "...


2

I'm assuming you are using Java in your testing framework. You have two ways of achieving it. Option 1: Try using Karate framework. If you use Java and want to do easy API testing. Option 2: Table is an object with fields named accordingly to table header. Basically you need to serialize them to json in a way that is suitable. You can use gson library ...


2

Yes, this should be very easy with Karate. I suggest you don't over-engineer tests and make 2 requests in your test. Save the response of the first request. Now all you need to do is perform a match of the first response - that it is equal to the second response. And because Karate allows you to set some fields of the "expected" JSON as #string or #notnull ...


1

Karate is working fine. Look at the error message that has come from the server and work with someone from the dev team. All the best.


1

Here is a tip. Since you know the expected request structure, keep in mind that you can use it almost as-is in Karate. And proper JSON with double-quotes etc. is totally fine. And you can use the multi-line option. So please try this for the request step: And request """ { "memberId":"******", "memberIpAddress":"******", "voucherData":{ "******":{...


Only top voted, non community-wiki answers of a minimum length are eligible