public void LogOut() { _driver = SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.GetResponseURL); var usernameInput = _driver.FindElement(By.Id("login")); usernameInput.Clear(); usernameInput.SendKeys("*****@*****.**"); var passwordInput = _driver.FindElement(By.Id("passwdInp2")); passwordInput.Clear(); passwordInput.SendKeys("wpisz hasło"); var submitButton = _driver.FindElement(By.XPath("//input[@type='submit']")); submitButton.Submit(); Thread.Sleep(1000); var logout = _driver.FindElement(By.XPath("//a[@href='https://app.getresponse.com/logout.html']")); logout.Click(); Thread.Sleep(1000); Assert.AreEqual("https://app.getresponse.com/loggedout.html", _driver.Url, "Nie udało się poprawnie zalogować."); }
public void IsSubmitButtonPresent() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); if (SeleniumMethodsCheckElement.IsElementPresentXPath(_driver, SeleniumParametersElementsPaths.SubmitButtonXPath) == false) { Assert.Fail(); } }
public void IsLastNameInputPresent() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); if (SeleniumMethodsCheckElement.IsElementPresentXPath(_driver, SeleniumParametersElementsPaths.LastNameInputBoxXPath) == false) { Assert.Fail(); } }
public void FirstNameEmptyAlert0() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); SeleniumMethods.PickAndClickWebElementByXPath(_driver, SeleniumParametersElementsPaths.SubmitButtonXPath); string alertText = _driver.SwitchTo().Alert().Text.ToString(); Assert.AreEqual(alertText, SeleniumParametersReturnStrings.FirstNameEmptyErrorString); _driver.SwitchTo().Alert().Accept(); }
public void LastNameEmptyAlert1() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.FirstNameInputBoxXPath, "Ala ma kota"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.DateInputBoxXPath, "01-01-2000"); SeleniumMethods.PickAndClickWebElementByXPath(_driver, SeleniumParametersElementsPaths.SubmitButtonXPath); string alertText = _driver.SwitchTo().Alert().Text.ToString(); Assert.AreEqual(alertText, SeleniumParametersReturnStrings.LastNameEmptyErrorString); _driver.SwitchTo().Alert().Accept(); }
public void DateFormatNotClassified0() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.FirstNameInputBoxXPath, "Michałek"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.LastNameInputBoxXPath, "PozdrawiaDatowo"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.DateInputBoxXPath, "15,06,2000"); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.ParentsCheckBoxXPath, false); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.DoctorCheckBoxXPath, false); SeleniumMethods.PickAndClickWebElementByXPath(_driver, SeleniumParametersElementsPaths.SubmitButtonXPath); _driver.SwitchTo().Alert().Accept(); string alertText = _driver.SwitchTo().Alert().Text.ToString(); Assert.AreEqual(alertText, SeleniumParametersReturnStrings.DefaultErrorString); _driver.SwitchTo().Alert().Accept(); }
public void DateEquivalenceMethodNotClassified3() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.FirstNameInputBoxXPath, "Michałek"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.LastNameInputBoxXPath, "PozdrawiaRównoważnościowo"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.DateInputBoxXPath, "15-06-2015"); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.ParentsCheckBoxXPath, false); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.DoctorCheckBoxXPath, false); SeleniumMethods.PickAndClickWebElementByXPath(_driver, SeleniumParametersElementsPaths.SubmitButtonXPath); _driver.SwitchTo().Alert().Accept(); string alertText = _driver.SwitchTo().Alert().Text.ToString(); Assert.AreEqual(alertText, SeleniumParametersReturnStrings.NotClassifiedString); _driver.SwitchTo().Alert().Accept(); }
public void DateBoundaryMethodMlodzik1() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.FirstNameInputBoxXPath, "Michałek"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.LastNameInputBoxXPath, "PozdrawiaGranicznie"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.DateInputBoxXPath, "01-01-2010"); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.ParentsCheckBoxXPath, true); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.DoctorCheckBoxXPath, true); SeleniumMethods.PickAndClickWebElementByXPath(_driver, SeleniumParametersElementsPaths.SubmitButtonXPath); _driver.SwitchTo().Alert().Accept(); string alertText = _driver.SwitchTo().Alert().Text.ToString(); Assert.AreEqual(alertText, SeleniumParametersReturnStrings.ClassifiedAsMlodzikString); _driver.SwitchTo().Alert().Accept(); }
public void InputBoxWrongInput3() { SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.USFormURL); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.FirstNameInputBoxXPath, "1410 > 2077"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.LastNameInputBoxXPath, "Artefaktowy"); SeleniumMethods.PickAndFillWebElementByXPath(_driver, SeleniumParametersElementsPaths.DateInputBoxXPath, "12-12-2077"); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.ParentsCheckBoxXPath, false); SeleniumMethods.SetCheckBoxByXPath(_driver, SeleniumParametersElementsPaths.DoctorCheckBoxXPath, false); SeleniumMethods.PickAndClickWebElementByXPath(_driver, SeleniumParametersElementsPaths.SubmitButtonXPath); _driver.SwitchTo().Alert().Accept(); string alertText = _driver.SwitchTo().Alert().Text.ToString(); Assert.AreEqual(alertText, SeleniumParametersReturnStrings.DefaultErrorString); _driver.SwitchTo().Alert().Accept(); }
public void LoginNegativeToGetResponse_EmptyFields() { _driver = SeleniumMethods.GoToWebsite(_driver, SeleniumParameters.GetResponseURL); var usernameInput = _driver.FindElement(By.Id("login")); usernameInput.Clear(); var passwordInput = _driver.FindElement(By.Id("passwdInp2")); passwordInput.Clear(); var submitButton = _driver.FindElement(By.XPath("//input[@type='submit']")); submitButton.Submit(); Thread.Sleep(1000); var errorMessageLabel = _driver.FindElement(By.XPath("//div[@class='error' or @class='error with-captcha']")); Assert.AreEqual("Invalid login details", errorMessageLabel.Text, "Błędny komunikat o niepoprawnym logowaniu."); }