예제 #1
0
        public static void ScrollToAndClick(By locator)
        {
            IWebElement element = GenericHelper.GetElement(locator);

            ExecuteScript("window.scrollTo(0," + element.Location.Y + ")");
            Thread.Sleep(300);
            element.Click();
        }
예제 #2
0
 public static string GetButtonText(By locator)
 {
     element = GenericHelper.GetElement(locator);
     if (element.GetAttribute("value") == null)
     {
         return(String.Empty);
     }
     return(element.GetAttribute("value"));
 }
예제 #3
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"));
            }
        }
예제 #4
0
 public static void ClickRadioButton(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
 }
예제 #5
0
 public static IList <string> GetAllItem(By locator)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     return(select.Options.Select((x) => x.Text).ToList());
 }
예제 #6
0
 public static void SelectElementByValue(By locator, string valueTexts)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByValue(valueTexts);
 }
예제 #7
0
 public static void SelectElement(By locator, string visibletext)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByText(visibletext);
 }
예제 #8
0
 public static void SelectElement(By locator, int index)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByIndex(index);
 }
예제 #9
0
 public static void ClearTextBox(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Clear();
 }
예제 #10
0
 public static void TypeInTextBox(By locator, string text)
 {
     element = GenericHelper.GetElement(locator);
     element.SendKeys(text);
 }
예제 #11
0
 public static void CheckedCheckBox(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
 }
예제 #12
0
 public static bool IsButtonEnabled(By locator)
 {
     element = GenericHelper.GetElement(locator);
     return(element.Enabled);
 }