示例#1
0
        public static void ScrollToWebElement(By locator)
        {
            IWebElement element = GenericHelper.GetElement(locator);

            ExecuteScript("window.scrollTo(0," + element.Location.Y + ")");
            Thread.Sleep(300);
            //element.Click();
        }
 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 void ScrollToView(By locator)
        {
            IWebElement element = GenericHelper.GetElement(locator);

            if (element.Location.Y > 200)
            {
                ScrollTo(0, element.Location.Y - 100);
            }
        }
示例#4
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"));
            }
        }
        public static bool IsCheckBoxChecked(By locator)
        {
            element = GenericHelper.GetElement(locator);
            string flag = element.GetAttribute("checked");

            Logger.Info(" Is CheckBox Checked : " + locator);
            if (flag == null)
            {
                return(false);
            }
            else
            {
                return(flag.Equals("true") || flag.Equals("checked"));
            }
        }
示例#6
0
 public static void ClearTextBox(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Clear();
     Logger.Info($" Clear the Textbox @ {locator}");
 }
示例#7
0
 public static void TypeInTextBox(By locator, string text)
 {
     element = GenericHelper.GetElement(locator);
     element.SendKeys(text);
     Logger.Info($" Type in Textbox @ {locator} : value : {text}");
 }
示例#8
0
 public static void ClickLink(By Locator)
 {
     element = GenericHelper.GetElement(Locator);
     element.Click();
     Logger.Info(" Clicking on link : " + Locator);
 }
 public static bool IsButtonEnabled(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     Logger.Info(" Checking Is Button Enabled ");
     return(_element.Enabled);
 }
示例#10
0
 public static void ClickButton(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Click();
     Logger.Info(" Button Click @ " + locator);
 }
示例#11
0
 public static void ClickRadioButton(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
 }
示例#12
0
 public static IList <string> GetAllItem(By locator)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     return(select.Options.Select((x) => x.Text).ToList());
 }
示例#13
0
 public static void SelectElementByValue(By locator, string valueTexts)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByValue(valueTexts);
 }
示例#14
0
 public static void SelectElement(By locator, string visibletext)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByText(visibletext);
 }
示例#15
0
 public static void SelectElement(By locator, int index)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByIndex(index);
 }
 public static void CheckedCheckBox(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
     Logger.Info(" Click on Check box : " + locator);
 }