public static void ClearTextFromTextBox(By Locator) { //element = GenericHelper.GetElement(Locator); //element.Clear(); ObjectRepository.webelement = GenericHelper.GetElement(Locator); ObjectRepository.webelement.Clear(); }
public static bool SetText(IWebElement Locator, string text, string logMessageOnException) { // element = GenericHelper.GetElement(Locator); // element.SendKeys(text); bool isTextEntered = false; try { if (Locator != null && Locator.Displayed) { LoginUtil.ScrollIntoView(Locator); ObjectRepository.webelement = GenericHelper.GetElement(Locator); ObjectRepository.webelement.SendKeys(text); isTextEntered = true; } if (!isTextEntered) { //LogException("Object does not exist and failed to set text to textbox", String.Empty, logMessageOnException); } } catch (Exception e) { // LogException("Failed to set text to textbox", e.ToString(), logMessageOnException); } return(isTextEntered); }
public static string GetButtonText(By Locator) { buttonElement = GenericHelper.GetElement(Locator); if (buttonElement.GetAttribute("value") == null) { return(string.Empty); } return(buttonElement.GetAttribute("value")); }
public static bool IsCheckBoxChecked(By locator) { checkboxElement = GenericHelper.GetElement(locator); string flag = checkboxElement.GetAttribute("checked"); if (flag == null) { return(false); } else { return(flag.Equals("true") || flag.Equals("checked")); } }
public static bool IsRadioButtonSelected(By locator) { element = GenericHelper.GetElement(locator); string flag = element.GetAttribute("checked"); if (flag == null) { return(false); } else { return(flag.Equals("true") || flag.Equals("checked")); } }
public static void CheckedCheckbox(By locator) { checkboxElement = GenericHelper.GetElement(locator); checkboxElement.Click(); }
public static bool IsButtonEnabled(By Locator) { buttonElement = GenericHelper.GetElement(Locator); return(buttonElement.Enabled); }
public static void ClickButton(IWebElement Locator) { buttonElement = GenericHelper.GetElement(Locator); buttonElement.Click(); }
private static void ClickRadioButton(By Locator) { element = GenericHelper.GetElement(Locator); element.Click(); }
public static void ClickLink(By Locator) { element = GenericHelper.GetElement(Locator); element.Click(); }