public void Cleanup() { try { MenuSelector.SelectMenu("TopLink_SignOut"); LogResults.LogPass("Signed Out successfully"); } catch (Exception ex) { LogResults.LogFail("Failed to Sign Out" + ex); } Driver.Close(); Assert.IsTrue(LogResults.EndLoggingSession()); Thread.Sleep(7000); }
public void Login() { try { var loginInput = Driver.Instance.FindElement(By.Name("SignInEmail")); loginInput.Clear(); loginInput.SendKeys(userName); var passwordInput = Driver.Instance.FindElement(By.Name("SignInPassword")); passwordInput.SendKeys(password); var loginButton = Driver.Instance.FindElement(By.Id("SignInBtn")); loginButton.Click(); try { if (Driver.Instance.FindElement(By.CssSelector("div.rpr-dialog-content-outer")).Enabled) { Driver.Instance.FindElement(By.LinkText("Close")).Click(); } LogResults.LogInfo("Closed the duplicate user login window"); } catch { LogResults.LogPass("Signed In successfully"); } } catch { LogResults.LogFail("Failed to Login"); } }