public void SuccessAlert() { var wait = new WebDriverWait(Driver.driver, new TimeSpan(0, 0, 10)); wait.Until(WaitDriver => WaitDriver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]")).Text.Contains("Availability updated")); IWebElement ValueAlert = Driver.driver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]")); Assert.AreEqual(ValueAlert.Text, "Availability updated"); }
public void PressUpdateButton() { //pressing the update button and then click IWebElement UpdtLanguageBtn = Driver.driver.FindElement(By.XPath("(//input[@value='Update'])[1]")); UpdtLanguageBtn.Click(); //Assert that the values have been properly accepted by the system var wait = new WebDriverWait(Driver.driver, new TimeSpan(0, 0, 10)); wait.Until(WaitDriver => WaitDriver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]"))); wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[contains(@class,'ns-box-inner')]"))); IWebElement ValueAlert = Driver.driver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]")); Driver.TurnOnWait(); Assert.AreEqual(ValueAlert.Text, "Hindi has been updated to your languages"); IWebElement ValueClose = Driver.driver.FindElement(By.XPath("//a[contains(@class,'ns-close')]")); ValueClose.Click(); Driver.TurnOnWait(); }
public void PressAddButton() { //Identifying the add button, click , sending value Driver.TurnOnWait(); IWebElement languageadd = Driver.driver.FindElement(By.XPath("(//input[contains(@value,'Add')])")); languageadd.Click(); //Assert that the values have been properly accepted by the system var wait = new WebDriverWait(Driver.driver, new TimeSpan(0, 0, 10)); wait.Until(WaitDriver => WaitDriver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]"))); wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[contains(@class,'ns-box-inner')]"))); IWebElement ValueAlert = Driver.driver.FindElement(By.XPath("//div[contains(@class,'ns-box-inner')]")); Driver.TurnOnWait(); Assert.AreEqual(ValueAlert.Text, "Bengali has been added to your languages"); IWebElement ValueClose = Driver.driver.FindElement(By.XPath("//a[contains(@class,'ns-close')]")); ValueClose.Click(); Driver.TurnOnWait(); }