public static string GetButtonText_alt(By locator) { element = GenericHelper.GetElement(locator); //we are checking the html tag which has the value saved if (element.Text == null) return String.Empty; else return element.Text; }
public static void ClickButton(By locator) { try { element = GenericHelper.GetElement(locator); element.Click(); } catch(ElementNotVisibleException e) { System.Console.WriteLine("Couldn't find button at location: " + locator.ToString() + "\n\n" + e.ToString()); } }
public static string GetRadioButtonText(By locator) { element = GenericHelper.GetElement(locator); //we are checking the html tag which has the value saved if (element.Text == null) { return(String.Empty); } else { return(element.Text); } }
public static bool IsRadioButtonchecked(By locator) { element = GenericHelper.GetElement(locator); //here you give the attritube from the elemets desc by inspecting which tell syouthe value string flag = element.GetAttribute("checked"); if (flag == null) { return(false); } else { return(flag.Equals("true") || flag.Equals("checked")); } }
public static void GetTextAndCompare(By locator, string data) { element = GenericHelper.GetElement(locator); Assert.AreEqual(data, element.Text, ignoreCase: true, "Match failed for : " + locator); }
public static void ClickLink(By Locator) { element = GenericHelper.GetElement(Locator); element.Click(); }
public static void ClickRadioButton(By locator) { element = GenericHelper.GetElement(locator); element.Click(); }
public static void CheckedCheckbox(By locator) { element = GenericHelper.GetElement(locator); element.Click(); }
public static bool IsButonEnabled(By locator) { element = GenericHelper.GetElement(locator); return element.Enabled; }
public static IList <string> GetAllItem(By locator) { select = new SelectElement(GenericHelper.GetElement(locator)); return(select.Options.Select((x) => x.Text).ToList()); }
//the above method is overloaded to select the opion by providing the value public static void SelectElement(By locator, string visible_text) { select = new SelectElement(GenericHelper.GetElement(locator)); select.SelectByValue(visible_text); }
public static void SelectElement(By locator, int index) { select = new SelectElement(GenericHelper.GetElement(locator)); select.SelectByIndex(index); }
public static void ClearTextBody(By locator) { element = GenericHelper.GetElement(locator); element.Clear(); }
public static void TypeInTextbox(By locator, string text) { element = GenericHelper.GetElement(locator); element.SendKeys(text); }