-1

Consider I am having three scenarios in my feature file. I want an authorization token that I get from an API response in the first scenario to be used in the other scenarios.

I declare the variable in "Background:" section. How to use the variable across scenarios?

Vimal Raj
  • 109
  • 2
  • 8

1 Answers1

1

Any variable declared in the Background: will be available for use in all Scenario:s in the same feature.

Refer to this answer for more: https://stackoverflow.com/a/46080568/143475

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