How to hand over credentials for authentication

Hello everyone,

I’m trying to authenticate against a basic access authentication (with .basicAuth()) and log in to a webservice with a username/password login form in a loading test simulation. To not save any credentials to my git repository I would like to use an .env. file (GitHub - cdimascio/dotenv-java: 🗝️ Dotenv is a no-dep, pure Java module that loads environment variables from a .env file). AFAIK Gatling unfortunately is not supporting dynamic read-outs of environments variables in an .exec-call. :frowning:

My next approach is to use a Feeder (csv or json file) to import, if I have to.

Has somebody accomplished this already with an .env-file and can give me a hint?

Thank you in advance!

Hi @gatlingdan,

So, if I use my own words, you want to get the environment variables from your simulation.
What about System.getenv (or sys.env in scala)?

The .env file is your business (direnv?)

Cheers!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.