public void VerifyErrorMessage(ErrorMessageType errorMessageType, string userName, string password) { if (errorMessageType.Equals(ErrorMessageType.UserNameEmpty)) { ObjReport.Info("Verify User Empty Error Message"); ObjLoginPage.Password.SendKeys(password); ObjLoginPage.Login.Submit(); WaitForErrorMessage(); Assert.AreEqual(ErrorMessageType.UserNameEmpty.GetDescription(), ObjLoginPage.ErrorMessage, "Error Message is not matched."); } if (errorMessageType.Equals(ErrorMessageType.PasswordEmpty)) { ObjReport.Info("Verify Password Empty Error Message"); ObjLoginPage.UserName.SendKeys(userName); ObjLoginPage.Login.Submit(); WaitForErrorMessage(); Assert.AreEqual(ErrorMessageType.PasswordEmpty.GetDescription(), ObjLoginPage.ErrorMessage, "Error Message is not matched."); } if (errorMessageType.Equals(ErrorMessageType.InvalidCredentials)) { ObjReport.Info("Verify Invalid Credentials Error Message"); ObjLoginPage.UserName.SendKeys(userName); ObjLoginPage.Password.SendKeys(password); ObjLoginPage.Login.Submit(); WaitForErrorMessage(); Assert.AreEqual(ErrorMessageType.InvalidCredentials.GetDescription(), ObjLoginPage.ErrorMessage, "Error Message is not matched."); } }
public void SetUp() { ObjReport.CreateTest(TestContext.CurrentContext.Test.Name); myContext = TestHarnessContextHelper.CreateDefault(); webDriver.InitializeApplication(); this.loginStep = new LoginStep(webDriver); }
public void SetUp() { ObjReport.CreateTest(TestContext.CurrentContext.Test.Name); myContext = TestHarnessContextHelper.CreateDefault(); webDriver.InitializeApplication(); this.loginStep = new LoginStep(webDriver); educationStep = new EducationStep(webDriver); loginStep.LoginOrangeHRM(appConfigMember.UserName, appConfigMember.Password); }
public void OrangeHrmBaseTestOneTimeTearDown() { if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Failed) { ObjReport.Error(TestContext.CurrentContext.Test.MethodName); } if (TestContext.CurrentContext.Result.Outcome.Status == TestStatus.Warning) { ObjReport.Warning(TestContext.CurrentContext.Test.MethodName); } webDriver.QuitWebDriver(); }
public void verifyLogin(string userName, string password) { ObjReport.Info("Verify Page Url and Text before Login"); validation.VerifyPageText(ObjLoginPage.pageSource); validation.VerifyPageUrl(ObjLoginPage.pageUrl); ObjReport.Info("Enter User Name and Password."); ObjLoginPage.UserName.SendKeys(userName); ObjLoginPage.Password.SendKeys(password); ObjLoginPage.Login.Submit(); ObjReport.Info("Verify Page Url and Text after Login"); validation.VerifyPageText(ObjLoginPage.pageSource); validation.VerifyPageUrl(ObjLoginPage.pageUrl); }
public void AddEducation(string education) { educationPage.Add.Click(); educationPage.Level.SendKeys(education); educationPage.Save.Click(); if (String.IsNullOrEmpty(educationPage.SuccessfullySaved.GetTextValue().Trim())) { ObjReport.Pass("Validate Successfully Saved Message.", educationPage.SuccessfullySaved.Text.Trim()); } var actualEducation = educationPage.GetEducation("Level", CellPosition.VALUE_BASE, education, IsHyperLink: true).Text; validation.VerifyText(education, actualEducation, "Validate Education Level Added Successfully."); webDriver.WaitForAjax(); webDriver.WaitForPage(); }
public void EnsureSatisfied(string passMessage, string failMessage) { if (!this.IsSatisfied) { if (this.lastException != null) { failMessage += "\n ***** Check inner waiter exception. *****\n"; } //ObjReport.Error(failMessage, new TimeoutException(failMessage, this.lastException).Message); throw new TimeoutException(failMessage, this.lastException); } else { ObjReport.Pass(passMessage); } }
private void WaitForErrorMessage() { Waiter.SpinWaitEnsureSatisfied(() => { Logger.Info($"Wait For Error Message...."); try { var msg = ObjLoginPage.ErrorMessage; ObjReport.Info("Error Message", msg, true); } catch (Exception e) { ObjReport.Error("Error Message Did Not Show After 5 Sec.", e.Message, true); } return(true); }, TimeSpan.FromSeconds(5), TimeSpan.FromMilliseconds(200), $"Could not Set clipboard to text "); }
public void VerifyErrorMessage(ErrorMessageType errorMessageType, string userName, string password) { ObjReport.Info("Verify Page Url and Text before Login"); validation.VerifyPageText(ObjLoginPage.pageSource); validation.VerifyPageUrl(ObjLoginPage.pageUrl); if (errorMessageType.Equals(ErrorMessageType.UserNameEmpty)) { ObjLoginPage.Password.SendKeys(password); ObjLoginPage.Login.Submit(); WaitForErrorMessage(); Assert.AreEqual(ErrorMessageType.UserNameEmpty.GetDescription(), ObjLoginPage.ErrorMessage, "Error Message is not matched."); var info = "Expected Error Msg: " + ErrorMessageType.UserNameEmpty.GetDescription() + "\t" + "Actual Error Msg: " + ObjLoginPage.ErrorMessage; ObjReport.Pass("Verify User Empty Error Message", info); } if (errorMessageType.Equals(ErrorMessageType.PasswordEmpty)) { Logger.Info("Verify Password Empty Error Message"); ObjLoginPage.UserName.SendKeys(userName); ObjLoginPage.Login.Submit(); WaitForErrorMessage(); Assert.AreEqual(ErrorMessageType.PasswordEmpty.GetDescription(), ObjLoginPage.ErrorMessage, "Error Message is not matched."); var info = "Expected Error Msg: " + ErrorMessageType.UserNameEmpty.GetDescription() + "\t" + "Actual Error Msg: " + ObjLoginPage.ErrorMessage; ObjReport.Pass("Verify Password Empty Error Message", info); } if (errorMessageType.Equals(ErrorMessageType.InvalidCredentials)) { Logger.Info("Verify Invalid Credentials Error Message"); ObjLoginPage.UserName.SendKeys(userName); ObjLoginPage.Password.SendKeys(password); ObjLoginPage.Login.Submit(); WaitForErrorMessage(); Assert.AreEqual(ErrorMessageType.InvalidCredentials.GetDescription(), ObjLoginPage.ErrorMessage, "Error Message is not matched."); var info = "Expected Error Msg: " + ErrorMessageType.UserNameEmpty.GetDescription() + "\t" + "Actual Error Msg: " + ObjLoginPage.ErrorMessage; ObjReport.Pass("Verify Invalid Credentials Error Message", info); } ObjReport.Info("Verify Page Url and Text After Login"); validation.VerifyPageText(ObjLoginPage.pageSource); validation.VerifyPageUrl(ObjLoginPage.pageUrl); }