How to pass variables in read while calling other feature files in Karate?

Viewed 136

I have a requirement like this -

  1. feature1 calls the featurebase file.
  2. In featurebase file, I am reading a json.
  3. I want to configure the file reading via featurefile1.

I have my scripts like this.

FeatureBase -

Background:
    * url baseUrl
    * def requestBody = read('#(file)')

Feature1 -

Background:
    * url baseUrl
    * def callFeature = call read('FeatureBase.feature') { file: 'json1.json'}

This code doesn't work and gives me file not found error.

1 Answers
Related