Is there a way to login to a website without writing the actual password in the code. For example, I created a function to login:
var isAlreadyLogIn = false;
function LogIn (userId, password) {
if (!isAlreadyLogIn) {
driver.findElement(By.xpath("//*[@id='Email']")).sendKeys(userId);
driver.findElement(By.xpath("//*[@id='Password']")).sendKeys(password);
driver.findElement(By.xpath("//input[@value='Login']")).click();
isAlreadyLogIn = true;
}
}
it('Should login', function(done) {
LogIn("username", "password");
});