Anyone know how to run this Karate test, with different parameters? Test was working before I added the table with parameters, using hard coded value 'USA'.
@tag1
Scenario: Business User Sign Up
* table regions
| region |
| 'USA' |
Given header Content-Type = applicationJsonHeader
When url identitySignUpUrl
And header Authorization = auth
* def requestBody = read('classpath:resources/test.json')
* replace requestBody.userName = userNameInput
* replace requestBody.phoneNumber = phoneNumberInput
* replace requestBody.country = '#(region)'
And request requestBody
When method POST
Then status 200
* def errors = response.errors
And match errors == '#null'
* print response
This doesnt seem to work https://github.com/karatelabs/karate#data-driven-features
I rewrote your test below. I think you are missing some fundamentals, so please go through the documentation: https://github.com/karatelabs/karate#data-driven-tests
You were certainly using
replacein the wrong way - and where it was not required.