コード例 #1
0
        public static IControl GetActionIcon(IControl actionsCell,String actionName)
        {
            try
            {                
                    ReadOnlyCollection<IControl> actionIconList = SyncUtilities.FindVisibleElements_Parent(actionsCell.WebElement, By.TagName("a"));

                    if (actionName.Equals("Edit") && actionIconList.Count > 0)
                    {
                        return SyncUtilities.FindVisibleElement_Parent(actionsCell.WebElement, By.CssSelector(" a.k-button.k-button-icontext.k-grid-edit"));
                    }
                    else if (actionName.Equals("Copy") && actionIconList.Count > 0)
                    {
                        return SyncUtilities.FindVisibleElement_Parent(actionsCell.WebElement, By.CssSelector("a.k-button.k-button-icontext.k-grid-copy"));
                    }
                    else if (actionName.Equals("Delete") && actionIconList.Count > 0)
                    {
                        return SyncUtilities.FindVisibleElement_Parent(actionsCell.WebElement, By.CssSelector(" a.k-button.k-button-icontext.k-grid-deleterow"));
                    }
                    else if (actionName.Equals("History"))
                    {
                        return SyncUtilities.FindVisibleElement_Parent(actionsCell.WebElement, By.TagName("img"));
                    }
                
            }
            catch(Exception e)
            {

            }
            return null;
        }
コード例 #2
0
        static List <IControl> GetEventFormRowsForFlag(ReadOnlyCollection <IControl> tableRows, String eventName)
        {
            List <IControl> eventFormRows = new List <IControl>();

            try
            {
                bool isEventMatched = false;
                foreach (IControl row in tableRows)
                {
                    IControl eventNameLabel = null;
                    if (IsEventRowForFlag(row, eventName, out eventNameLabel))
                    {
                        String actualEventNameOld = Control_PropertyUtilities.GetText(eventNameLabel);
                        String actualEventNameNew = actualEventNameOld.Replace("(Select all in event)", "");
                        isEventMatched = eventName.Equals(actualEventNameNew.Trim(), StringComparison.InvariantCultureIgnoreCase);
                    }
                    else
                    {
                        if (isEventMatched)
                        {
                            IControl formRow = SyncUtilities.FindVisibleElement_Parent(row.WebElement, By.TagName("span"));
                            if (!Control_PropertyUtilities.IsControlNull(formRow))
                            {
                                eventFormRows.Add(row);
                            }
                        }
                    }
                }
                return(eventFormRows);
            }
            catch (Exception e)
            {
            }
            return(eventFormRows);
        }
コード例 #3
0
 protected static void NavigateToPage(IControl tableHost, int rowNumber)
 {
     try
     {
         if (rowNumber > 0)
         {
             int      rowsPerPage       = 15;
             int      pageNumber        = ((rowNumber - 1) / rowsPerPage) + 1;
             IControl paginationControl = SyncUtilities.FindVisibleElement_Parent(tableHost.WebElement, By.ClassName("pagination"));
             String   pageTitle         = "li[title='Page :" + pageNumber + "']";
             IControl pageLi            = SyncUtilities.FindVisibleElement_Parent(paginationControl.WebElement, By.CssSelector(pageTitle));
             if (!Control_PropertyUtilities.IsControlNull(pageLi))
             {
                 IControl pageNumberControl = SyncUtilities.FindElement_Parent(pageLi.WebElement, By.TagName("a"));
                 if (!Control_PropertyUtilities.IsControlNull(pageNumberControl))
                 {
                     Control_ActionUtilities.Click(pageLi, String.Empty);
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
 }
コード例 #4
0
        /*public static bool OpenForm(String eventName, String formName)
         * {
         * try
         * {
         *     ReadOnlyCollection<IControl> rows = GetFormsRowsUnderEvent(eventName);
         *     foreach (IControl row in rows)
         *     {
         *         ReadOnlyCollection<IControl> cells = SyncUtilities.FindVisibleElements_Parent(row.WebElement, By.TagName("td"));
         *         if (cells.Count > 0)
         *         {
         *             IControl crfCell = cells[0];
         *             IControl crfLink = SyncUtilities.FindVisibleElement_Parent(crfCell.WebElement, By.TagName("a"));
         *             if (!Control_PropertyUtilities.IsControlNull(crfLink))
         *             {
         *                 bool found = false;
         *                 String innerText = Control_PropertyUtilities.GetAttributeValue(crfLink, "innertext", out found);
         *                 if (found && !String.IsNullOrEmpty(innerText) && innerText.Equals(formName, StringComparison.InvariantCultureIgnoreCase))
         *                 {
         *                     return Control_ActionUtilities.Click(crfLink, String.Empty);
         *                 }
         *             }
         *         }
         *     }
         * }
         * catch (Exception e)
         * {
         * }
         * return false;
         * }*/

        internal static IControl GetFormRow(String eventName, String formName, out IControl crfCell)
        {
            crfCell = null;
            try
            {
                ReadOnlyCollection <IControl> rows = GetFormsRowsUnderEvent(eventName);
                foreach (IControl row in rows)
                {
                    ReadOnlyCollection <IControl> cells = SyncUtilities.FindVisibleElements_Parent(row.WebElement, By.TagName("td"));
                    if (cells.Count > 0)
                    {
                        crfCell = cells[0];
                        IControl crfLink = SyncUtilities.FindVisibleElement_Parent(crfCell.WebElement, By.TagName("a"));
                        if (!Control_PropertyUtilities.IsControlNull(crfLink))
                        {
                            bool   found     = false;
                            String innerText = Control_PropertyUtilities.GetAttributeValue(crfLink, "innertext", out found);
                            if (found && !String.IsNullOrEmpty(innerText) && innerText.Equals(formName, StringComparison.InvariantCultureIgnoreCase))
                            {
                                return(row);
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
            }
            return(null);
        }
コード例 #5
0
 static IControl GetFormRadioButtonForFlag(List <IControl> eventFormRows, String formName, String radioButtonName)
 {
     foreach (IControl formRow in eventFormRows)
     {
         ReadOnlyCollection <IControl> cells = SyncUtilities.FindVisibleElements_Parent(formRow.WebElement, By.TagName("td"));
         if (cells.Count > 6)
         {
             if (formName.Equals(Control_PropertyUtilities.GetText(cells[0]), StringComparison.InvariantCultureIgnoreCase))
             {
                 if (radioButtonName.Equals("No Change", StringComparison.InvariantCultureIgnoreCase))
                 {
                     return(SyncUtilities.FindVisibleElement_Parent(cells[2].WebElement, By.TagName("input")));
                 }
                 else if (radioButtonName.Equals("Mark Required", StringComparison.InvariantCultureIgnoreCase))
                 {
                     return(SyncUtilities.FindVisibleElement_Parent(cells[3].WebElement, By.TagName("input")));
                 }
                 else if (radioButtonName.Equals("Mark All", StringComparison.InvariantCultureIgnoreCase))
                 {
                     return(SyncUtilities.FindVisibleElement_Parent(cells[4].WebElement, By.TagName("input")));
                 }
                 else if (radioButtonName.Equals("Unmark All", StringComparison.InvariantCultureIgnoreCase))
                 {
                     return(SyncUtilities.FindVisibleElement_Parent(cells[5].WebElement, By.TagName("input")));
                 }
             }
         }
     }
     return(null);
 }
コード例 #6
0
        public static IControl GetPrimaryTab(String primaryTabName)
        {
            IControl pageHeadDiv  = SyncUtilities.FindElement(By.ClassName("page-head"));
            IControl siteNavDiv   = SyncUtilities.FindVisibleElement_Parent(pageHeadDiv.WebElement, By.ClassName("site-nav"));
            IControl primayNavDiv = SyncUtilities.FindVisibleElement_Parent(siteNavDiv.WebElement, By.Id("primary-nav"));

            return(SyncUtilities.FindVisibleElement_Parent(primayNavDiv.WebElement, By.PartialLinkText(primaryTabName)));
        }
コード例 #7
0
        public static ReadOnlyCollection <IControl> HistoryTable()
        {
            IControl changeHistory = SyncUtilities.FindVisibleElement(By.ClassName("change-history"));
            IControl historyTable  = SyncUtilities.FindVisibleElement_Parent(changeHistory.WebElement, By.ClassName("history-table"));
            IControl historyRows   = SyncUtilities.FindVisibleElement_Parent(historyTable.WebElement, By.ClassName("history-rows"));
            IControl historyRow    = SyncUtilities.FindVisibleElement_Parent(historyTable.WebElement, By.ClassName("history-row"));

            return(SyncUtilities.FindVisibleElements_Parent(historyTable.WebElement, By.ClassName("history-row")));
        }
コード例 #8
0
        static IControl GetHost()
        {
            IControl mainContent    = SyncUtilities.FindElement(By.Id("mainContent"));
            IControl tblMainContent = SyncUtilities.FindVisibleElement_Parent(mainContent.WebElement, By.Id("tblMainContent"));
            IControl bodyColtd      = SyncUtilities.FindVisibleElement_Parent(tblMainContent.WebElement, By.CssSelector("td#bodyCol.bodyCol"));

            //return tblMainContent;
            return(bodyColtd);
        }
コード例 #9
0
        public static IControl GetClickableBreadCrumbItem(string breadCrumbItemName)
        {
            IControl host = SyncUtilities.FindVisibleElement(By.ClassName("bcrumbRow"));

            if (!Control_PropertyUtilities.IsControlNull(host))
            {
                return(SyncUtilities.FindVisibleElement_Parent(host.WebElement, By.LinkText(breadCrumbItemName)));
            }
            return(null);
        }
コード例 #10
0
        public static IControl ActionPalette_GetActionsHost(String actionPaletteName)
        {
            String actionPaletteId = GetActionPaletteId(actionPaletteName);

            if (!String.IsNullOrEmpty(actionPaletteId))
            {
                return(SyncUtilities.FindVisibleElement_Parent(Sidebar.WebElement, By.Id(actionPaletteId)));
            }
            return(null);
        }
コード例 #11
0
        public static IControl GetClearFilterButton(IControl filterRow, int columnIndex)
        {
            IControl filterCell = GetFilterCell(filterRow, columnIndex);

            if (filterCell != null)
            {
                return(SyncUtilities.FindVisibleElement_Parent(filterCell.WebElement, By.CssSelector("button[title='Clear']")));
            }
            return(null);
        }
コード例 #12
0
        public static IControl GetFilterCriteriaIcon(IControl filterRow, int columnIndex)
        {
            IControl filterCell = GetFilterCell(filterRow, columnIndex);

            if (filterCell != null)
            {
                return(SyncUtilities.FindVisibleElement_Parent(filterCell.WebElement, By.CssSelector("span[role='listbox']")));
            }
            return(null);
        }
コード例 #13
0
        public static IControl GetFilterTextbox(IControl filterRow, int columnIndex)
        {
            IControl filterCell = GetFilterCell(filterRow, columnIndex);

            if (filterCell != null)
            {
                return(SyncUtilities.FindVisibleElement_Parent(filterCell.WebElement, By.CssSelector("input[class='k-input'][data-role='autocomplete']")));
            }
            return(null);
        }
コード例 #14
0
        public static ReadOnlyCollection <IControl> GetLabsTestHeaderRows()
        {
            IControl labAppDiv        = SyncUtilities.FindElement(By.CssSelector("div[ng-app=labApp]"));
            IControl labControllerDiv = SyncUtilities.FindElement_Parent(labAppDiv.WebElement, By.CssSelector("div[ng-controller=labMainController]"));
            IControl grid             = SyncUtilities.FindVisibleElement_Parent(labControllerDiv.WebElement, By.CssSelector("div#grid.k-grid.k-widget"));
            IControl headerHost       = SyncUtilities.FindVisibleElement_Parent(grid.WebElement, By.CssSelector("div.k-grid-header"));
            IControl header           = SyncUtilities.FindVisibleElement_Parent(grid.WebElement, By.TagName("thead"));

            return(SyncUtilities.FindVisibleElements_Parent(header.WebElement, By.TagName("tr")));
        }
コード例 #15
0
 public static IControl GetCodelistMappingButton(IControl containerCell)
 {
     try
     {
         return(SyncUtilities.FindVisibleElement_Parent(containerCell.WebElement, By.CssSelector("input")));
     }
     catch (Exception e)
     {
     }
     return(null);
 }
コード例 #16
0
 public static IControl GetStatusLink(IControl cell, string statusText)
 {
     try
     {
         return(SyncUtilities.FindVisibleElement_Parent(cell.WebElement, By.LinkText(statusText)));
     }
     catch (Exception e)
     {
     }
     return(null);
 }
コード例 #17
0
 public static IControl GetSubtabHeaderLinkToOpen(IControl header, String subTabText)
 {
     try
     {
         return(SyncUtilities.FindVisibleElement_Parent(header.WebElement, By.TagName("a")));
     }
     catch (Exception e)
     {
     }
     return(null);
 }
コード例 #18
0
        static IControl GetEventDateObjectForEvent(String eventName, string EventDate)
        {
            IControl eventRow = GetEventRow(eventName);

            if (eventRow != null)
            {
                IControl eventNameCell = WebTableUtilities.GetCell(eventRow, 0);
                return(SyncUtilities.FindVisibleElement_Parent(eventRow.WebElement, By.XPath(".//a[contains(text(), '" + EventDate + "')]")));
            }
            return(null);
        }
コード例 #19
0
 public static IControl GetTableQuestionElement(IControl TableRow, string QuestionPrompt)
 {
     try
     {
         return(SyncUtilities.FindVisibleElement_Parent(TableRow.WebElement, By.XPath(".//td[text()='" + QuestionPrompt + "']/parent::tr")));
     }
     catch (Exception e)
     {
         return(null);
     }
 }
コード例 #20
0
 //Pagination needs to be implemented
 public static IControl GetRowOfTableInCRF(IControl Table, string RowNum)
 {
     try
     {
         return(SyncUtilities.FindVisibleElement_Parent(Table.WebElement, By.XPath(".//div[contains(@id, 'r" + RowNum + "_RowHtml')]")));
     }
     catch (Exception e)
     {
         return(null);
     }
 }
コード例 #21
0
 public static IControl GetCodeListLink(IControl proecssCell, string processText)
 {
     try
     {
         return(SyncUtilities.FindVisibleElement_Parent(proecssCell.WebElement, By.LinkText(processText)));
     }
     catch (Exception e)
     {
     }
     return(null);
 }
コード例 #22
0
        public static IControl GetTableRowButton(String tableName, String buttonName)
        {
            IControl tableNameHost = null;
            IControl tableHost     = GetTableHost(tableName, -1, out tableNameHost);
            String   selector      = "[type='button'][value='" + buttonName + "'][class='btnNormal']";
            IControl button        = SyncUtilities.FindVisibleElement_Parent(tableHost.WebElement, By.CssSelector(selector));

            //IControl button = SyncUtilities.FindVisibleElement(By.CssSelector(selector));
            return(button);
            //String selector = "input[type='button'][value='" + buttonName + "'][class='btnNormal']";
        }
コード例 #23
0
 public static IControl GetProcessLink(IControl proecssCell, string processText)
 {
     try
     {
         return(SyncUtilities.FindVisibleElement_Parent(proecssCell.WebElement, By.LinkText(processText)));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(null);
 }
コード例 #24
0
 public static IControl GetItemDropdown(IControl containerCell)
 {
     try
     {
         IControl      dropdown = SyncUtilities.FindVisibleElement_Parent(containerCell.WebElement, By.CssSelector("select:nth-of-type(3)"));
         SelectElement select   = new SelectElement(dropdown.WebElement);
         return(new Control(dropdown.WebElement, select));
     }
     catch (Exception e)
     {
     }
     return(null);
 }
 public static IControl GetColumnFilterLink(String columnName)
 {
     if (!String.IsNullOrEmpty(columnName))
     {
         IControl headerCell = GetFilterCell(DL_Lab_ManageReferenceRanges.LabsTestGridTitleRow, GetColumnIndex(columnName));
         if (!Control_PropertyUtilities.IsControlNull(headerCell))
         {
             IControl filterIcon = SyncUtilities.FindVisibleElement_Parent(headerCell.WebElement, By.ClassName("k-grid-filter"));
             return(filterIcon);
         }
     }
     return(null);
 }
コード例 #26
0
        static IControl GetEventExpandCollapseImage(String eventName, out String patientEventKey)
        {
            patientEventKey = String.Empty;
            IControl eventRow = GetEventRow(eventName);

            if (eventRow != null)
            {
                patientEventKey = GetPatientEventKey(eventRow);
                IControl eventNameCell = WebTableUtilities.GetCell(eventRow, 0);
                return(SyncUtilities.FindVisibleElement_Parent(eventNameCell.WebElement, By.TagName("img")));
            }
            return(null);
        }
コード例 #27
0
        public static List <string> GetReferenceRangesID()
        {
            List <string> refernceRangeIdsList = new List <string>();
            IControl      referenceRangeTable  = ReferenceRangesGrid();
            ReadOnlyCollection <IControl> rows = SyncUtilities.FindVisibleElements_Parent(referenceRangeTable.WebElement, By.TagName("tr"));

            foreach (IControl row in rows)
            {
                IControl referenceRangeId = SyncUtilities.FindVisibleElement_Parent(row.WebElement, By.XPath(".//td[2]"));
                refernceRangeIdsList.Add(referenceRangeId.WebElement.Text);
            }
            return(refernceRangeIdsList);
        }
コード例 #28
0
 public static IControl GetFilterCriteriaIcon(string columnName)
 {
     if (columnName.Equals("Start Date"))
     {
         IControl headerCell = WebTableUtilities.GetColumnHeader(MrrTableGridTitleRow, columnName, TableColumnContentType.Text);
         if (!Control_PropertyUtilities.IsControlNull(headerCell))
         {
             return SyncUtilities.FindVisibleElement_Parent(headerCell.WebElement, By.CssSelector("k-grid-filter"));
         }
         
     }
     return null;
 }
コード例 #29
0
 public static IControl GetColumnHeaderTitle_SecondRow(String columnName)
 {
     if (!String.IsNullOrEmpty(columnName))
     {
         //Change title row
         IControl headerCell = WebTableUtilities.GetColumnHeader(MrrTableGridTitleRow, columnName, TableColumnContentType.Text,1);
         if (!Control_PropertyUtilities.IsControlNull(headerCell))
         {
             return SyncUtilities.FindVisibleElement_Parent(headerCell.WebElement, By.LinkText(columnName));
         }
     }
     return null;
 }
コード例 #30
0
        static IControl GetStatusCheckbox(IControl parent, String status)
        {
            ReadOnlyCollection <IControl> statusCheckboxHostList = SyncUtilities.FindVisibleElements_Parent(parent.WebElement, By.ClassName("ui-dropdownchecklist-item"));

            foreach (IControl c in statusCheckboxHostList)
            {
                IControl statusLabel = SyncUtilities.FindVisibleElement_Parent(c.WebElement, By.TagName("label"));
                if (Control_PropertyUtilities.GetText(statusLabel).Equals(status, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(SyncUtilities.FindVisibleElement_Parent(c.WebElement, By.TagName("input")));
                }
            }
            return(null);
        }