artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.03k stars 510 forks source link

Global variables required - independent from scenarios #629

Open tallpaulhunter opened 5 years ago

tallpaulhunter commented 5 years ago

Is it possible to set a variable that persists across all scenarios during a test run, i.e a global variable? As I understand it variables defined in the config section are scenario specific, and are reset to the original values when a new scenario run is initiated. My use case is that I want to request an auth token (once) at the start of a test run and use that token in all scenarios executed subsequently. Currently each scenario involves an auth post request and then the post request I need to analyse. The auth requests are included in the results and so affect returned metrics.

NivLipetz commented 5 years ago

Hi @tallpaulhunter , this PR https://github.com/artilleryio/artillery/pull/625 I worked on will solve this exact issue

tallpaulhunter commented 5 years ago

Thanks @NivLipetz . I've tried your changes and they work exactly as I require. Hopefully they will be added asap to a general release.