//Reading data from property file :
String username = prop.getProperty("username");
String password = prop.getProperty("password");
@Test
public void testValidCredentials() {
obj.loginAs("username","password");
}
public HomePage loginAs(String username, String password) {
driver.findElement(By.id("id1")).sendKeys(username);
driver.findElement(By.id("id2")).sendKeys(password);
driver.findElement(By.id("id3")).click();
return new HomePage(driver);
}
What i was trying to do is pass username and password to loginAs method but however when i pass it inserts as Email as Username and password as password instead of what i read from my property file. Property file : username = r@t.com password = 1234