public static void SelectElementByIndex(By locator, int indx) { element = GenericHelper.GetElement(locator); SelectElement select = new SelectElement(element); select.SelectByIndex(indx); }
public static string GetButtonText(By locator) { element = GenericHelper.GetElement(locator); if (element.GetAttribute("value") == null) { return(String.Empty); } return(element.GetAttribute("value")); }
public static bool IsChecked(By locator) { element = GenericHelper.GetElement(locator); string value = element.GetAttribute("checked"); /*check if the checkbox is checked or not * if it is checked the GetAttribute function is going to return the value "checked" if not it is going to return null */ if (value == null) { return(false); } else { return(value.Equals("true") || value.Equals("Checked")); } }
public static void ClickLink(By locator) { element = GenericHelper.GetElement(locator); element.Click(); }
public static IList <string> SelectElementByText(By locator) { select = new SelectElement(GenericHelper.GetElement(locator)); return(select.Options.Select((x) => x.Text).ToList()); }
public static void SelectElementByText(By locator, string text) { select = new SelectElement(GenericHelper.GetElement(locator)); select.SelectByText(text); }
public static void SelectElementByValue(By locator, string value) { select = new SelectElement(GenericHelper.GetElement(locator)); select.SelectByValue(value); }
public static void ClearTextBox(By locator) { element = GenericHelper.GetElement(locator); element.Clear(); }
public static void SendKeys(By locator, string text) { element = GenericHelper.GetElement(locator); element.SendKeys(text); }
public static bool IsButtonEnabled(By locator) { element = GenericHelper.GetElement(locator); return(element.Enabled); }
public static void ClickRadioButton(By locator) { element = GenericHelper.GetElement(locator); element.Click(); }