SHARE
TWEET

Untitled

a guest May 7th, 2016 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public HompePage(WebDriver driver)
  2. {          
  3.    this.driver = driver;
  4.    PageFactory.initElements(driver, this);
  5. }
  6.    
  7. public class BasePage
  8. {
  9. private By username = By.id("username");
  10. private By password = By.id("password");
  11. private By loginBtn = By.name("loginbtn");
  12.  
  13.    public void userLogin(String userName, String password)
  14.    {
  15.         driver.findElement(username).sendKeys("testuser");
  16.         driver.findElement(password).sendKeys("testpassword");
  17.         driver.findElement(loginBtn).click();
  18.    }
  19. }
  20.    
  21. public class BasePage {
  22.   @FindBy(id= "username") private WebElement userName;
  23.   @FindBy(id= "password") private WebElement password;
  24.   @FindBy(id= "login") private WebElement loginBtn;
  25.  
  26.   public void userLogin(String userName, String password) {
  27.     userName.sendKeys(userName);
  28.     password.sendKeys(password);
  29.     loginBtn.click();
  30.   }
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top