Not able to read the value from Examples in the Background section for Karate

For the Karate Framework with BDD, I am trying to pass value for some of the Background steps from the Examples section of the Scenario Outline but I have not been able to succeed. Any pointers?

enter image description here

My Outcome —> if you observe the value is not getting replaced for the variable under the Background section and it simply prints ”. Where as the value for ” is correctly being replaced accordingly as the name provided in the Examples Section.
Additionally if I try to omit the single quote to make it simply it then complains as if it is not a valid xml. So basically no matter what I have issue of the value not being passed under the Background step.

  • next time please read this before asking another question: stackoverflow.com/help/how-to-ask

    – 

Karate only performs <foo> kind of placeholder substitution in the Scenario Outline steps.

But the variable will be available even in the Background. In your example, def greeting = param will work. Refer to the documentation: https://github.com/karatelabs/karate#scenario-outline-enhancements

Leave a Comment