Problem
I am creating a set of automated tests that require a username and password to be given to log on to the application to be tested. I have a function LogOnToApplication(string username, string password)
that takes the log on info as strings, and logs on to the application. Currently, I am defining two strings as such:
string username = "username";
string password = "supersecretpassword";
And passing to my function with
utilities.LogOnToApplication(username, password);
This works just fine for the purpose of my tests, but I know that doing this in this manner is risky and insecure. These tests are widely distributed, and setting my tests up this way could easily lead to a security breach.
Question
What is the best method to remove the username
and password
strings from my code? I have thought about creating a separate file to store this info in, and pulling from the file when the information is needed, but this really does not solve the problem, it just relocates the sensitive information.