public void ThenISeeNotificationMessageOnThe(string expectedMessage, string page) { string currentMessage = string.Empty; switch (page) { case "Login popup": currentMessage = new LoginPopUpPage().GetTextMessageError(); break; case "Reset Password": currentMessage = new HtmlElement(By.CssSelector("h4")).Text; break; case "Reset Password popup": currentMessage = new ResetPasswordPopUpPage().GetStatusField(); break; case "Basket Page": currentMessage = new BasketPage().GetTextElement("Basket Is Empty"); break; default: throw new NotImplementedException(); } Assert.AreEqual(expectedMessage.ToLower(), currentMessage.ToLower()); }