Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. package pageobject;
  2.  
  3. import org.openqa.selenium.WebDriver;
  4. import org.openqa.selenium.WebElement;
  5. import org.openqa.selenium.support.FindBy;
  6.  
  7. public class Login extends Page {
  8.  
  9.     private WebElement inputPassword;
  10.  
  11.     private WebElement inputLogin;
  12.  
  13.     @FindBy(xpath = "html/descendant::button")
  14.     private WebElement buttonEnter;
  15.  
  16.     @Override
  17.     public Login open() {
  18.         return (Login)super.open();
  19.     }
  20.  
  21.     public Login(WebDriver webDriver) {
  22.         super(webDriver);
  23.         url = property.getProperty("login.url");
  24.     }
  25.  
  26.     public Login inputPassword(String password){
  27.         input(this.inputPassword,password);
  28.         return this;
  29.     }
  30.  
  31.     public Login inputLogin(String login){
  32.         input(this.inputLogin,login);
  33.         return this;
  34.     }
  35.  
  36.     public Page clickEnter(){
  37.         buttonEnter.click();
  38.         return  new pageobject.Main(this.webDriver);
  39.     }
  40.  
  41.     public Main entry(){
  42.        this.open().
  43.        inputLogin(property.getProperty("login.login"))
  44.        .inputPassword(property.getProperty("login.password"))
  45.        .clickEnter();
  46.  
  47.  
  48.  
  49.        return new pageobject.Main(this.webDriver);
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement