Exemplo n.º 1
0
        public static void SelectFromDropDownWithLabel(string label, string value)
        {
            var arrow = GenericHelper.GetElement(By.XPath(GetXpathUsingLabel(label)));

            JavaScriptExecutorHelper.ScrollElementAndClick(arrow);
            Thread.Sleep(1000);
            var list = GenericHelper.GetVisiblityOfElement(By.XPath(GetListElement(value)));

            list.Click();
            Thread.Sleep(1000);
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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 void ClearTextBox(By locator)
 {
     _element = GenericHelper.GetElement(locator);
     _element.Clear();
 }
 public static void TypeInTextBox(By locator, string text)
 {
     _element = GenericHelper.GetElement(locator);
     _element.SendKeys(text);
 }
Exemplo n.º 6
0
 public static void SelectByIndex(By locator, int index)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     _select.SelectByIndex(index);
 }
Exemplo n.º 7
0
 public static void SelectByVisibleText(By locator, string text)
 {
     _select = new SelectElement(GenericHelper.GetElement(locator));
     _select.SelectByText(text);
 }
Exemplo n.º 8
0
 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);
 }