swapna
swapna

Reputation: 213

Calling feature file with multiple arguments

I want to call a feature file with 3 arguments, 1 st argument to create entity with that name and rest of 2 arguments to verify created entity has desired values for particular fields. How can I do this in Karate??

Upvotes: 3

Views: 3618

Answers (1)

Babu Sekaran
Babu Sekaran

Reputation: 4239

You can keep all the input in one JSON and pass it to your feature as mentioned in this documentation.

Calling other features

Feature: main 
 Scenario: 
  * def result = call read('myfeature.feature') { createEntity: 'value', arg1: 'arg1Value',arg2: 'arg2Value'} 

Inside your called feature you can directly access the values by the key that you used in your JSON.

Upvotes: 4

Related Questions