Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pageobject;
- import org.openqa.selenium.WebDriver;
- import org.openqa.selenium.WebElement;
- import org.openqa.selenium.support.FindBy;
- public class Login extends Page {
- private WebElement inputPassword;
- private WebElement inputLogin;
- @FindBy(xpath = "html/descendant::button")
- private WebElement buttonEnter;
- @Override
- public Login open() {
- return (Login)super.open();
- }
- public Login(WebDriver webDriver) {
- super(webDriver);
- url = property.getProperty("login.url");
- }
- public Login inputPassword(String password){
- input(this.inputPassword,password);
- return this;
- }
- public Login inputLogin(String login){
- input(this.inputLogin,login);
- return this;
- }
- public Page clickEnter(){
- buttonEnter.click();
- return new pageobject.Main(this.webDriver);
- }
- public Main entry(){
- this.open().
- inputLogin(property.getProperty("login.login"))
- .inputPassword(property.getProperty("login.password"))
- .clickEnter();
- return new pageobject.Main(this.webDriver);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement