Blame view

src/main/java/com/essa/pageObject/LoginPage.java 989 Bytes
fdd4bb76   zengjin55   windows
1
2
3
4
5
6
7
8
  package com.essa.pageObject;
  
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
  
  import com.essa.framework.BasePage;
  
60b8852f   Administrator   test
9
10
11
12
  /**
   * @author Administrator
   *bpms登录页
   */
fdd4bb76   zengjin55   windows
13
14
15
16
  public class LoginPage extends BasePage{
  
  	public LoginPage(WebDriver driver) {
  		super(driver);
fdd4bb76   zengjin55   windows
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  	}
  
  	/*
  	 * 元素定位
  	 */
  	
  	//账号输入框
  	@FindBy (xpath="//*[@id='username']")
  	WebElement login_account;
  	
  	//密码输入框
  	@FindBy (xpath="//*[@id='password']")
  	WebElement login_password;
  	
  	//登录按钮
  	@FindBy (xpath="//*[@id='subBtn']")
  	WebElement login_submit;
  	
  	/*
  	 * 页面方法
  	 */
  	
60b8852f   Administrator   test
39
  	/**
fdd4bb76   zengjin55   windows
40
41
42
43
  	 * 1.输入帐号
  	 * 2.输入密码
  	 * 3.点击登录
  	 * 4.driver返回
60b8852f   Administrator   test
44
45
46
  	 * @param account
  	 * @param password
  	 * @return HomePage
fdd4bb76   zengjin55   windows
47
48
  	 */
  	public HomePage login(String account,String password) {
fdd4bb76   zengjin55   windows
49
  		sendKeys(login_account, account);
fdd4bb76   zengjin55   windows
50
  		sendKeys(login_password, password);
fdd4bb76   zengjin55   windows
51
  		click(login_submit);
fdd4bb76   zengjin55   windows
52
  		return new HomePage(driver);
fdd4bb76   zengjin55   windows
53
54
  	}
  }