Esempio n. 1
0
 public static void ClearTextFromTextBox(By Locator)
 {
     //element = GenericHelper.GetElement(Locator);
     //element.Clear();
     ObjectRepository.webelement = GenericHelper.GetElement(Locator);
     ObjectRepository.webelement.Clear();
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public static string GetButtonText(By Locator)
 {
     buttonElement = GenericHelper.GetElement(Locator);
     if (buttonElement.GetAttribute("value") == null)
     {
         return(string.Empty);
     }
     return(buttonElement.GetAttribute("value"));
 }
Esempio n. 4
0
        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"));
            }
        }
Esempio n. 5
0
        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"));
            }
        }
Esempio n. 6
0
 public static void CheckedCheckbox(By locator)
 {
     checkboxElement = GenericHelper.GetElement(locator);
     checkboxElement.Click();
 }
Esempio n. 7
0
 public static bool IsButtonEnabled(By Locator)
 {
     buttonElement = GenericHelper.GetElement(Locator);
     return(buttonElement.Enabled);
 }
Esempio n. 8
0
 public static void ClickButton(IWebElement Locator)
 {
     buttonElement = GenericHelper.GetElement(Locator);
     buttonElement.Click();
 }
Esempio n. 9
0
 private static void ClickRadioButton(By Locator)
 {
     element = GenericHelper.GetElement(Locator);
     element.Click();
 }
Esempio n. 10
0
 public static void ClickLink(By Locator)
 {
     element = GenericHelper.GetElement(Locator);
     element.Click();
 }