Exemplo n.º 1
0
 /// <summary>
 /// Try to log in by user name and password.
 /// Throws Invalid operation exception if login or password are not right
 /// </summary>
 /// <param name="userName">string with user name</param>
 /// <param name="userPassword">string with user password</param>
 /// <returns>Next page, if log in is correct</returns>
 public WorkspacePage LogIn(string userName, string userPassword)
 {
     LoginTextField.SendKeys(userName);
     PasswordTextField.SendKeys(userPassword);
     while (LoginTextField.GetAttribute("value") != userName)
     {
         LoginTextField.Clear();
         LoginTextField.SendKeys(userName);
     }
     SubmitButton.Click();
     Driver.SwitchTo().Window(Driver.WindowHandles.Last());
     if (Driver.Title == title)
     {
         throw new InvalidOperationException();
     }
     return(new WorkspacePage(Driver));
 }
Exemplo n.º 2
0
 public void FillLoginTextField(string content)
 {
     LoginTextField.SendKeys(content);
 }