artillery run my-script.yaml
In order to log into the target, a token must be used.
How do I run the above script with a token? IE:
artillery run my-script.yaml token 983r2fh29hf2893yr72
artillery run my-script.yaml
In order to log into the target, a token must be used.
How do I run the above script with a token? IE:
artillery run my-script.yaml token 983r2fh29hf2893yr72
Copyright © 2021 Jogjafile Inc.
I'm assuming that the token must be provided to the API through, for example, a header. Artillery provides several mechanisms of doing that. If the token is static (i.e. you know the token ahead of time), then you can simply use an inline variable in your test script to do that.
For example:
my-script.yamlThen you simply run the script (i.e.
artillery run my-script.yaml)If the token is dynamic (for example you need to call an endpoint to authenticate and get a token before), then you might need to use a custom javascript function like a scenario hook: https://www.artillery.io/docs/reference/engines/http#setting-scenario-level-hooks. Or, alternatively, a
beforewhich runs once before all scenarios (https://www.artillery.io/docs/reference/test-script#before-and-after-sections).But from your description, it sounds like the first example I gave is what you need.