1

I have a feature file that looks like this

    Background:
        * table parameters
            | endpoint | url    | token | sslConfig  |
            | 'U'      | xxx    | aaa   |            |
            | 'A'      | yyy    | bbb   |  someConfig|

    Scenario Outline: bla bla
        Given url url
        And header Authorization = token
        When method GET
        Then status 200
        And match response == read('expectation.json')
        Examples:
        | parameters |

   + bunch of other similar scenario outlines

There are some task (setting ssl config) I need to do for each scenario line depending on some condition (if sslConfig != null) and for that I need to read the token param from the table / json. this can be done by check and configuring the ssl in individual scenario outline but I would prefer to do it once (probably in the background).

But I cannot access the variable sslConfig in the background. Is there anyway to achieve this?

dripto
  • 570
  • 1
  • 7
  • 17

1 Answers1

0

If someConfig is defined in the config bootstrap (karate-config.js) it should get substituted (by JS evaluation) correctly.

It works for me, so maybe you are on an old version.

If you are still stuck, please follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

Also if you read this section of the docs: https://github.com/intuit/karate#scenario-outline-enhancements

You will see that sslConfig should be automatically available in the body of the Scenario Outline. Maybe you are missing something.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248