package com.mridul.framework.selenium.pages;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import java.util.Arrays;
import java.util.List;
/**
* Created by Mridul on 3/10/2016.
*/
public final class LoginPage extends AbstractPage {
@FindBy(id="lblTop")
private WebElement lbl_DashStaging_Anchor;
@FindBy(id="LogoImage")
private WebElement lbl_Southwest_Anchor;
@FindBy(id="ContentPlaceHolder1_MFALoginControl1_UserIDView_txtUserid")
private WebElement txtfld_UserId;
@FindBy(id="ContentPlaceHolder1_MFALoginControl1_UserIDView_tbxPassword" )
private WebElement txtfld_Password;
@FindBy(id="ContentPlaceHolder1_MFALoginControl1_UserIDView_btnSubmit")
private WebElement btn_Submit;
public LoginPage(WebDriver driver){
super(driver);
}
@Override
protected List<WebElement> registerAnchors() {
return Arrays.asList(lbl_DashStaging_Anchor, lbl_Southwest_Anchor);
}
@Override
public LoginPage and() {
return this;
}
@Override
public LoginPage then() {
return this;
}
public LoginPage navigateToURL(String url){
super.getURL(url);
return this;
}
public LoginPage typeInUserId(String userid){
super.populateTextField(txtfld_UserId, userid);
return this;
}
public LoginPage typeInPassword(String userid){
super.populateTextField(txtfld_Password, userid);
return this;
}
////TODO-change this to new page
public HomePage clickOnSubmitButton(){
super.clickOnButton(btn_Submit);
return new HomePage(driver);
}
}
Friday, August 5, 2016
LoginPage
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment