Esempio n. 1
0
 public static void CreateNewClick()
 {
     WaitHelper.WaitUntilTableIsVisible(GridId);
     WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//*[@id='" + GridId + "']/div[1]/a")));
     SeleniumDriver.driver.FindElement(By.XPath("//*[@id='" + GridId + "']/div[1]/a")).Click();
     WaitHelper.WaitToFinishloading();
 }
Esempio n. 2
0
        public static void RefreshPage()
        {
            SeleniumDriver.driver.Navigate().Refresh();

            AdminPageHelper.AdminButtonClick();

            AdminPageHelper.SwitchToIframeInContainerId(IframeInContainerId);

            GoToActiveTab();

            WaitHelper.WaitUntilTableIsVisible(GridId);

            if (!string.IsNullOrWhiteSpace(DropDownTaxonomyName))
            {
                DropDownTaxonomyClick();

                IList <IWebElement> containers = DropDownGetContainers();

                IList <IWebElement> optionslist = containers[containers.Count - 1].FindElements(By.TagName("li"));

                IWebElement option = optionslist[DropDownTaxonomyValue];

                WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(option));

                option.Click();

                WaitHelper.WaitToFinishloading();
            }
        }
Esempio n. 3
0
        public static IWebElement FindRow()
        {
            WaitHelper.WaitToFinishloading();

            tableRows = GetGridRows();

            foreach (IWebElement row in tableRows)
            {
                RowTD = row.FindElements(By.TagName("td"));

                var rowTdText = string.Empty;

                if (UpdateIdColumn)
                {
                    rowTdText = RowTD[ColumnsToEdit[0].ColumnNum].Text;
                }
                else
                {
                    if (ColumnsToEdit != null)
                    {
                        rowTdText = RowTD[ColumnsToEdit[1].ColumnNum].Text;
                    }
                    else
                    {
                        rowTdText = RowTD[0].Text;
                    }
                }
                if (rowTdText.Equals(RowId))
                {
                    return(row);
                }
            }

            return(null);
        }
Esempio n. 4
0
        public static void DialogWindowBtnClick()
        {
            WaitHelper.WaitToDialogWindow();

            SeleniumDriver.driver.FindElement(By.XPath("//button")).Click();

            WaitHelper.WaitToFinishloading();
        }
Esempio n. 5
0
        public static void BtnClick(string type)
        {
            var buttons = GetRowButtons(RowId);

            WaitHelper.WaitToFinishloading();
            if (type == "UpdateNewRow")
            {
                buttons = GetRowButtons(RowId, true);
            }

            if (buttons != null)
            {
                switch (type)
                {
                case "Edit":
                    WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(buttons[0]));
                    buttons[0].Click();
                    break;

                case "Update":
                    WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(buttons[0]));
                    buttons[0].Click();
                    break;

                case "UpdateNewRow":
                    WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(buttons[0]));
                    buttons[0].Click();
                    break;

                case "Cancel":
                    var td = RowTD.Where(x => x.Text.Contains("בטל עריכה")).FirstOrDefault();

                    if (td != null)
                    {
                        Thread.Sleep(100);
                        td.Click();
                    }
                    break;

                case "Delete":
                    td = RowTD.Where(x => x.Text.Contains("מחק")).FirstOrDefault();

                    if (td != null)
                    {
                        Thread.Sleep(100);
                        td.Click();
                    }
                    break;

                default:
                    break;
                }
            }

            WaitHelper.WaitToFinishloading();
        }
Esempio n. 6
0
        public static IList <IWebElement> GetRowButtons(string rowId, bool getFirstRowButtns = false)
        {
            WaitHelper.WaitToFinishloading();

            tableRows = GetGridRows();

            foreach (IWebElement row in tableRows)
            {
                RowTD = row.FindElements(By.TagName("td"));
                var rowTdText = string.Empty;

                if (rowTdText.Contains("מחק"))
                {
                    rowTdText = RowTD[RowTD.Count - 1].Text;
                }

                if (ColumnsToEdit != null)
                {
                    if (ColumnsToEdit.Count > 1)
                    {
                        rowTdText = RowTD[ColumnsToEdit[1].ColumnNum].Text;
                    }
                }
                else
                {
                    rowTdText = RowTD[0].Text;
                }

                IList <IWebElement> buttons = row.FindElements(By.TagName("a"));
                if (UpdateIdColumn)
                {
                    rowTdText = RowTD[ColumnsToEdit[0].ColumnNum].Text;
                }

                if (getFirstRowButtns)
                {
                    return(buttons);
                }
                if (rowTdText.Equals("יש להכניס מזהה ייחודי") ||
                    rowTdText.Equals("שדה חובה"))
                {
                    return(buttons);
                }
                if (rowTdText.Equals(rowId) ||
                    rowTdText.Equals(string.Empty))
                {
                    return(buttons);
                }
            }
            return(null);
        }
Esempio n. 7
0
        public static void SelectValueDropDownList(DropDownsToEdit dropDown)
        {
            tableRows = GetGridRows();

            foreach (IWebElement row in tableRows)
            {
                RowTD = row.FindElements(By.TagName("td"));
                WaitHelper.Wait.Until(ExpectedConditions.ElementIsVisible(By.ClassName("k-select")));
                IWebElement select = RowTD[dropDown.ColumnNum].FindElement(By.ClassName("k-select"));
                select.Click();

                IList <IWebElement> containers = DropDownGetContainers();


                IWebElement list = containers[dropDown.NumOfDropDownOnGrid].FindElement(By.TagName("ul"));

                WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(list));

                DropDownListValues = list.FindElements(By.TagName("li"));

                SetDropDownListTextValuesFromDropDownListValues();

                IWebElement option;

                if (dropDown.ContainsEmptyValue)
                {
                    option = DropDownListValues[dropDown.selectedValue];

                    WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(option));

                    option.Click();
                }
                else
                {
                    option = DropDownListValues[dropDown.selectedValue];

                    WaitHelper.Wait.Until(ExpectedConditions.ElementToBeClickable(option));

                    option.Click();
                }
                break;
            }
            WaitHelper.WaitToFinishloading();
        }
Esempio n. 8
0
        public static void ConfrimButtonClick(bool btnConfrim)
        {
            WaitHelper.Wait.Timeout = TimeSpan.FromSeconds(3);
            var dialog = WaitHelper.WaitToConfrimWindow();

            WaitHelper.Wait.Timeout = TimeSpan.FromSeconds(10);

            var btnOk     = dialog.FindElement(By.XPath("//button[contains(text(),'אישור')]"));
            var btnCancel = dialog.FindElement(By.XPath("//button[contains(text(),'ביטול')]"));

            if (btnConfrim)
            {
                btnOk.Click();
            }
            else
            {
                btnCancel.Click();
            }
            WaitHelper.WaitToFinishloading();
        }