public static void SetByTextDropDown(string locator, string testData, IWebDriver driver)
 {
     WaitKeywordAction.WaitForElement(locator, driver);
     Helper.HighlightElement(driver, driver.FindElement(By.XPath(locator)));
     dropdown = new SelectElement(driver.FindElement(By.XPath(locator)));
     dropdown.SelectByText(testData);
 }
 public bool VerifyErrorMessage(string locator, string dataTest, IWebDriver driver)
 {
     try
     {
         WaitKeywordAction.WaitForElement(locator, driver);
         Helper.HighlightElement(driver, driver.FindElement(By.XPath(locator)));
         _elementselected = driver.FindElement(By.XPath(locator));
         return(_elementselected.Text.Equals(dataTest));
     }
     catch (NoSuchElementException elementNotVisibleException)
     {
         SValues.Logger.Error(
             "Element : " + locator + "  Was Not Visible, * Error Message *" + elementNotVisibleException);
         return(false);
     }
 }
 public static void SetText(string locator, string testData, IWebDriver driver)
 {
     try
     {
         WaitKeywordAction.WaitForElement(locator, driver);
         Helper.HighlightElement(driver, driver.FindElement(By.XPath(locator)));
         driver.FindElement(By.XPath(locator)).Clear();
         driver.FindElement(By.XPath(locator)).SendKeys(testData);
         //Doing click on blank area in page
         driver.FindElement(By.XPath("//body")).Click();
     }
     catch (ElementNotVisibleException ve)
     {
         SValues.Logger.Error("Trying to locate element : " + locator);
         Assert.Fail();
     }
 }