示例#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"));
            }
        }
示例#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);
            }
        }
示例#3
0
 public static IList <string> AllDropdownMenuItem(By locator)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     return(_select.Options.Select(x => x.Text).ToList());
 }
示例#4
0
 public static void SelectElementByValue(By locator, string visibleText)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     _select.SelectByValue(visibleText);
 }
示例#5
0
 public static void SelectElementByIndex(By locator, int indextValue)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     _select.SelectByIndex(indextValue);
 }
示例#6
0
 public static void CheckACheckBox(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Click();
 }
示例#7
0
 public static void ClickLink(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Click();
 }
示例#8
0
 public static void ClickRadioButton(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Click();
 }
示例#9
0
 public static void ClearText(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Clear();
 }
示例#10
0
 public static void SendText(By locator, string text)
 {
     _element = GenericHelper.GetElement(locator);
     _element.SendKeys(text);
 }
示例#11
0
 public static bool IsButtonEnable(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     return(_element.Enabled);
 }