Example #1
0
        public static void SelectFromKendoDropDown(By selectArrow, string value)
        {
            var arrow = GenericHelper.GetElement(selectArrow);

            JavaScriptExecutorHelper.ScrollElementAndClick(arrow);
            Thread.Sleep(500);
            var list = GenericHelper.GetVisiblityOfElement(By.XPath("//li[text()='" + value + "']"));

            list.Click();
            GenericHelper.WaitForLoadingMask();
            Thread.Sleep(1000);
        }
Example #2
0
        public static void SelectItemPerList(string number)
        {
            var arrow = GenericHelper.GetElement(DownArrow);

            JavaScriptExecutorHelper.ScrollElementAndClick(arrow);
            Thread.Sleep(500);
            var list = GenericHelper.GetVisiblityOfElement(By.XPath("//li[text()='" + number + "']"));

            list.Click();
            GenericHelper.WaitForLoadingMask();
            Thread.Sleep(1000);
        }
        public static void ClickVerifyBtnInGrid(string gridXpath, int row, int column)
        {
            if (!GenericHelper.IsElementPresentQuick(
                    By.XPath(GetGridElementXpath(gridXpath, row, column) + "//i[2]")))
            {
                return;
            }

            var element =
                GenericHelper.GetElement(
                    By.XPath(GetGridElementXpath(gridXpath, row, column) + "//i[2]"));

            element.Click();
            GenericHelper.WaitForLoadingMask();
        }
        public static IWebElement GetGridElement(string gridXpath, int row, int column)
        {
            if (
                GenericHelper.IsElementPresentQuick(
                    By.XPath(GetGridElementXpath(gridXpath, row, column) + "/a")))
            {
                return(GenericHelper.GetElement(By.XPath(GetGridElementXpath(gridXpath, row, column) + "/a")));
            }

            if (
                GenericHelper.IsElementPresentQuick(
                    By.XPath(GetGridElementXpath(gridXpath, row, column) + "/span")))
            {
                return(GenericHelper.GetElement(By.XPath(GetGridElementXpath(gridXpath, row, column) + "/span")));
            }

            if (
                GenericHelper.IsElementPresentQuick(
                    By.XPath(GetGridElementXpath(gridXpath, row, column) + "/input")))
            {
                return(GenericHelper.GetElement(By.XPath(GetGridElementXpath(gridXpath, row, column) + "/input")));
            }

            if (
                GenericHelper.IsElementPresentQuick(
                    By.XPath(GetGridElementXpath(gridXpath, row, column) + "//input")))
            {
                return(GenericHelper.GetElement(By.XPath(GetGridElementXpath(gridXpath, row, column) + "//input")));
            }

            if (GenericHelper.IsElementPresentQuick(
                    By.XPath(GetGridElementXpath(gridXpath, row, column))))
            {
                return(GenericHelper.GetElement(By.XPath(GetGridElementXpath(gridXpath, row, column))));
            }

            Logger.Error(string.Format("Grid Element {0} not found", GetGridElementXpath(gridXpath, row, column)));

            return(null);
        }
 public static IWebElement GetGridHeaderElement(string gridXpath, int row, int column)
 {
     return(GenericHelper.IsElementPresentQuick(
                By.XPath(GetGridHeaderXpath(gridXpath, row, column))) ? GenericHelper.GetElement(By.XPath(GetGridHeaderXpath(gridXpath, row, column))) : null);
 }
Example #6
0
 public static void SelectByVisibleText(By locator, string text)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     _select.SelectByText(text);
     Logger.Info(text + " Selected from " + locator);
 }