Example #1
0
        public static void SelectElementByIndex(By locator, int indx)
        {
            element = GenericHelper.GetElement(locator);
            SelectElement select = new SelectElement(element);

            select.SelectByIndex(indx);
        }
Example #2
0
 public static string GetButtonText(By locator)
 {
     element = GenericHelper.GetElement(locator);
     if (element.GetAttribute("value") == null)
     {
         return(String.Empty);
     }
     return(element.GetAttribute("value"));
 }
Example #3
0
        public static bool IsChecked(By locator)
        {
            element = GenericHelper.GetElement(locator);
            string value = element.GetAttribute("checked");

            /*check if the checkbox is checked or not
             * if it is checked the GetAttribute function is going to return the value "checked" if not it is going to return null  */

            if (value == null)
            {
                return(false);
            }
            else
            {
                return(value.Equals("true") || value.Equals("Checked"));
            }
        }
Example #4
0
 public static void ClickLink(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
 }
Example #5
0
 public static IList <string> SelectElementByText(By locator)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     return(select.Options.Select((x) => x.Text).ToList());
 }
Example #6
0
 public static void SelectElementByText(By locator, string text)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByText(text);
 }
Example #7
0
 public static void SelectElementByValue(By locator, string value)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByValue(value);
 }
Example #8
0
 public static void ClearTextBox(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Clear();
 }
Example #9
0
 public static void SendKeys(By locator, string text)
 {
     element = GenericHelper.GetElement(locator);
     element.SendKeys(text);
 }
Example #10
0
 public static bool IsButtonEnabled(By locator)
 {
     element = GenericHelper.GetElement(locator);
     return(element.Enabled);
 }
Example #11
0
 public static void  ClickRadioButton(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
 }