Package org.qagile.pages

Source Code of org.qagile.pages.LoginPage

package org.qagile.pages;

import javax.swing.KeyStroke;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.qagile.selenium.Commands;
import org.qagile.selenium.SeleniumHelper;
import org.qagile.selenium.locators.LoginLocator;
import org.qagile.testdata.LoginData;

public class LoginPage extends Commands {
 
  private SeleniumHelper helper;

  public LoginPage() {
    helper = new SeleniumHelper();
  }

  public void login(String user) {
    helper.findElement(LoginLocator.loginLink).click();
    String password = new LoginData().getPassword(user);
    type(helper.findElement(LoginLocator.userName), user);
    type(helper.findElement(LoginLocator.password), password);
    submit(helper.findElement(LoginLocator.submit));
   
  }

 
  public String getLoggedinUserName() {
    return helper.findElement(By.className("profile-link")).getText();
  }

}
TOP

Related Classes of org.qagile.pages.LoginPage

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.