Getting issue while sending nested JSON as request to validate the POST REST API method using Karate framework

Viewed 868

Please note that i am trying to send the below request and validate the response on POST method using url

http://uat-ws.*.uk.***.ws/index.php/*/****/validatevoucher

like below: I am using Karate framework here to automate REST API

Scenario: validate voucher

Given url 'http://-..uk../v3//******' 
And header Content-Type = 'application/json' 
And request {json request here}
When method post
Then status 200 



12:17:30.510 [main] DEBUG com.intuit.karate.StepDefs - response time in milliseconds: 579 12:17:30.528 [main] ERROR com.intuit.karate.StepDefs - FAILED, status code was 400, expected 200

[31mFailed scenarios:[0m [31mexamples/users/WSS.feature:3 [0m# Scenario: validate voucher

1 Scenarios ([31m1 failed[0m) 5 Steps ([31m1 failed[0m, [32m4 passed[0m) 0m3.516s

com.intuit.karate.KarateException: status code was 400, expected 200 at com.intuit.karate.StepDefs.handleFailure(StepDefs.java:516) at com.intuit.karate.StepDefs.status(StepDefs.java:447) at ✽.Then status 200(examples/users/WSS.feature:9)
1 Answers
Related