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 bool SetText(IWebElement element, string text) { bool isTextEntered = false; try { if (element.GetProperty("class") != null) { LoginUtil.ScrollIntoView(element); element.SendKeys(text); isTextEntered = true; } } catch (Exception e) { // LogException("Failed to set text to textbox", e.ToString(), logMessageOnException); } return(isTextEntered); }