Created
July 15, 2023 08:25
-
-
Save disegmvm/d04ed4ce003bec07bd05f3f78a22bea8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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