Is there a method and/or best practice for protecting credentials in a Selenium project using Java?
The two main ones for my application will be user credentials for logging into the site, and DB credentials.
I usually will create a .properties file that contains username and password and then make sure my .gitignore file says to not include that file in code check-ins.
Late answer, but better late than never I suppose. A properties file works and can allow you to set authorization, true.
Better, would be to set up a secured repository for such credentials that can be called at runtime to retrieve them. Too many times, hard coded credentials in some file wind up getting pushed into version control or saved to a desktop, etc, and it winds up getting a company's data on pastebin.