Exemplo n.º 1
0
        public static bool IsCheckBoxChecked(By locator)
        {
            _element = GenericHelper.GetElement(locator);
            var checkBox = _element.GetAttribute("type");

            if (checkBox != null) //(checkBox == null) if true code
            {
                return(false);
            }
            else
            {
                return(checkBox.Equals("checkbox") || checkBox.Equals("true"));
            }
        }
Exemplo n.º 2
0
        public static bool IsRadioButtonSelected(By locator)
        {
            _element = GenericHelper.GetElement(locator);
            var radioButtonStatus = _element.GetAttribute("checked");

            if (radioButtonStatus != null) //(checkBox == null) if true code
            {
                return(radioButtonStatus.Equals("true") || radioButtonStatus.Equals("checked"));
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 3
0
 public static IList <string> AllDropdownMenuItem(By locator)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     return(_select.Options.Select(x => x.Text).ToList());
 }
Exemplo n.º 4
0
 public static void SelectElementByValue(By locator, string visibleText)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     _select.SelectByValue(visibleText);
 }
Exemplo n.º 5
0
 public static void SelectElementByIndex(By locator, int indextValue)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     _select.SelectByIndex(indextValue);
 }
Exemplo n.º 6
0
 public static void CheckACheckBox(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Click();
 }
Exemplo n.º 7
0
 public static void ClickLink(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Click();
 }
Exemplo n.º 8
0
 public static void ClickRadioButton(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Click();
 }
Exemplo n.º 9
0
 public static void ClearText(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Clear();
 }
Exemplo n.º 10
0
 public static void SendText(By locator, string text)
 {
     _element = GenericHelper.GetElement(locator);
     _element.SendKeys(text);
 }
Exemplo n.º 11
0
 public static bool IsButtonEnable(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     return(_element.Enabled);
 }