Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public HompePage(WebDriver driver)
- {
- this.driver = driver;
- PageFactory.initElements(driver, this);
- }
- public class BasePage
- {
- private By username = By.id("username");
- private By password = By.id("password");
- private By loginBtn = By.name("loginbtn");
- public void userLogin(String userName, String password)
- {
- driver.findElement(username).sendKeys("testuser");
- driver.findElement(password).sendKeys("testpassword");
- driver.findElement(loginBtn).click();
- }
- }
- public class BasePage {
- @FindBy(id= "username") private WebElement userName;
- @FindBy(id= "password") private WebElement password;
- @FindBy(id= "login") private WebElement loginBtn;
- public void userLogin(String userName, String password) {
- userName.sendKeys(userName);
- password.sendKeys(password);
- loginBtn.click();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement