Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To help anonymize our testing accounts and not expose these in our code base, we set our gmail username and password as environment variables on local machines. In a terminal window run: sudo nano /etc/profile. Add the following lines to the bottom of the file:

Code Block
languagebash
export Selenium_User1="example@gmail.com"
export Selenium_Pass1="examplePa$$word"
  1. Save your changes and log out of your computer and log back in.
  2. Run the command: env | grep Selenium
    1. You should get back the variable names and values. If not try running the command
    2. source /etc/profile
  3. In the selenium java code, now create a string variable that you will reference as your password with it value equal to:
    1. System.getenv("<environment variable>");

Opening a Web Browser

System.setProperty("webdriver.chrome.driver", "/home/<username>/file/path/to/chromedriver");

...