Skip to content

Instantly share code, notes, and snippets.

@disegmvm
Created July 15, 2023 08:25
Show Gist options
  • Save disegmvm/f1daece44801afeb4d6ea681123b9b15 to your computer and use it in GitHub Desktop.
Save disegmvm/f1daece44801afeb4d6ea681123b9b15 to your computer and use it in GitHub Desktop.
public class LoginPage {
private WebDriver driver;
// Web elements
private By usernameInput = By.id("username");
private By passwordInput = By.id("password");
private By loginButton = By.id("loginButton");
public LoginPage(WebDriver driver) {
this.driver = driver;
}
public void enterUsername(String username) {
driver.findElement(usernameInput).sendKeys(username);
}
public void enterPassword(String password) {
driver.findElement(passwordInput).sendKeys(password);
}
public void clickLoginButton() {
driver.findElement(loginButton).click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment