Advertisement
Guest User

WebLoginPage

a guest
Jul 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. public class WebLoginPage{
  2.     IWebDriver driver;
  3.     public WebLoginPage(IWebDriver driver)
  4.     {
  5.         this.driver = driver;
  6.         PageFactory.InitElements(driver, this);
  7.     }
  8.     [FindsBy(How = How.Id, Using = "login")]
  9.     private IWebElement tLogin;
  10.     [FindsBy(How = How.Id, Using = "pass")]
  11.     private IWebElement tPassword;
  12.     [FindsBy(How = How.Id, Using = "enterSite")]
  13.     private IWebElement bLogin;
  14.    
  15.     public void enterLogin(string login)
  16.     {
  17.         tLogin.SendKeys(login);
  18.     }
  19.    
  20.     public void enterPassword(string password)
  21.     {
  22.         tPassword.SendKeys(password);
  23.     }
  24.    
  25.     public void clickLoginButton()
  26.     {
  27.         bLogin.Click();
  28.     }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement