📜  selenium 中页面工厂的优势 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:09.134000             🧑  作者: Mango

代码示例3
public class BasePage {
  @FindBy(id= "username") private WebElement userName;
  @FindBy(id= "password") private WebElement password;
  @FindBy(id= "login") private WebElement loginBtn;

  public void userLogin(String userName, String password) {
    userName.sendKeys(userName);
    password.sendKeys(password);
    loginBtn.click();
  }
}