Can a variable is used instead of the numeric response code for verifying response status in karate

18 Views Asked by At

Consider the below karate script:
Scenario: test API
* def responseCode = 200
Given path 'api/v1/testsample/'
When method POST
Then status responseCode

here I am trying to make the response code as a variable rather than numerically giving it as 200

but it throws the error 'no step-definition method match found for status responseCode'

Is this possible in karate??

0

There are 0 best solutions below