1

I have an authenticate scenario which return a token. After 5 minutes (example), the token is expired. But this token is mandatory for the success of other scenarios. Now, I don't really want to run this scenario each time before the other scenarios. Ideally, I will run it a first time, get the token, and when the expiration time, rerun the authenticate scenario.

Currently, my yml file follow this logic:

execution:
- scenario: mainload

scenarios:
  authenticate:
    requests:
      - http://auth.com
  mainload:
    requests:
      - include-scenario: http://needToken.com
      - http://needToken.com

So, how can I using Taurus inside an yml file do this? Like, waiting 5 minutes before relaunching the scenario?

Have a nice day.

MrNierda
  • 412
  • 1
  • 8
  • 19

1 Answers1

2

You can create 2 scenario elements, one for authentication and another one for main load, the relevant Taurus YAML syntax would be something like:

execution:
- scenario: authenticate
- scenario: mainload

scenarios:
  authenticate:
    think-time: 5m
    requests:
      - http://example.com
  mainload:
    requests:
      - http://blazedemo.com

The think-time attribute basically adds a Constant Timer with 5 minutes "sleep" time so the request to example.com will be executed each 5 minutes while others will be fired without delays.

References:

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • I added more information inside my question. I use `include-scenario` to extract the token from the response and i use it inside the following scenario – MrNierda Sep 13 '18 at 14:13