How to set username/password permanently in run configuration / environment variables

Answered

Hi,

We have a lot of IT tests and always using a new IT test I must set manually the environment variables.

I'm going inside the run configuration and set for example the two variables for classIT:

default.username=abc
default.password=def

I do it again if I using one test case classIT.method and finally again after five different classIT was run.

I was now setting the Templates/Junit with the environment variables mentioned above.

Does anybody know how I can set this variables once but the IDE will use it every time automatically?

Thanks in advance,

Markus

 

0
4 comments

> I was now setting the Templates/Junit with the environment variables mentioned above.

What's wrong with this solution? It's the recommended way to go. If you set these variables in the template configuration, all the new created configurations will have the same variables automatically.

0
Avatar
Permanently deleted user

Thanks it works. If a (wrong) configuration exists it does not automatically read the Junit template. I think this was yesterday the problem.

0

What is the recommended solution if the run configuration is shared via "Store in project file"?

Are there anyway to get the IDE (PyCharm in my case) to fetch the value from the password store or an external file?

0

> What is the recommended solution if the run configuration is shared via "Store in project file"?

Solution is the same. You can define your variables in Run Configuration template.

 

> to fetch the value from the password store or an external file

There is a plugin for that: https://github.com/Ashald/EnvFile

And here is the request to integrate this functionality: https://youtrack.jetbrains.com/issue/PY-5543

0

Please sign in to leave a comment.