Blame view

src/main/java/com/buyer/pageObject/BuyerLoginPage.java 940 Bytes
27d9a429   suweicheng   开发梳理;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  package com.buyer.pageObject;
  
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.support.FindBy;
  
  import com.essa.framework.BasePage;
  
  /**
   * 采购商登录页
   * @author Administrator
   *
   */
  public class BuyerLoginPage extends BasePage {
  	public BuyerLoginPage(WebDriver driver) {
  		super(driver);
  	}
  	/*
  	 * 页面元素定位
  	 */
  	//用户名:邮箱
  	@FindBy (xpath = "//*[@id='username']")
  	WebElement userName;
  	
  	//密码
  	@FindBy (xpath = "//*[@id='password']")
  	WebElement passWord;
  	
  	//登录按钮
  	@FindBy (xpath = "//*[@id='login']")
  	WebElement signIn;
  	
  	/*
  	 * 页面方法
  	 */
  	/**
  	 * 采购商登录方法
  	 * @param account 账号
  	 * @param password 密码
  	 * @return  IndexPage
  	 */
  	public IndexPage login(String account,String password) {
  		sendKeys(userName, account);
  		sendKeys(passWord, password);
  		click(signIn);
  		return new IndexPage(driver);
  	}
  }