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);
 }
Exemplo n.º 2
0
 public static IControl GetFormCheckbox(String formName)
 {
     try
     {
         IControl formsTable = SyncUtilities.FindVisibleElement(By.Id("UnscheduledEvent_chkList"));
         ReadOnlyCollection <IControl> rows = SyncUtilities.FindVisibleElements_Parent(formsTable.WebElement, By.TagName("tr"));
         foreach (IControl c in rows)
         {
             IControl formLabel = SyncUtilities.FindElement(By.TagName("label"));
             if (!Control_PropertyUtilities.IsControlNull(formLabel))
             {
                 String labelText = Control_PropertyUtilities.GetText(formLabel);
                 if (labelText.Equals(formName, StringComparison.InvariantCultureIgnoreCase))
                 {
                     return(new Control(c.WebElement.FindElement(By.TagName("input"))));
                     //return SyncUtilities.FindElement(By.TagName("input"));
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(null);
 }
 public static bool IsTableHistoryIconAvailable(String tableName)
 {
     try
     {
         IControl tableNameHost = null;
         IControl tableHost     = GetTableHost(tableName, 0, out tableNameHost);
         if (tableHost != null && tableNameHost != null && tableNameHost.WebElement != null)
         {
             ReadOnlyCollection <IControl> images = SyncUtilities.FindVisibleElements_Parent(tableNameHost.WebElement, By.TagName("img"));
             foreach (IControl image in images)
             {
                 bool   found    = false;
                 String imageSrc = Control_PropertyUtilities.GetAttributeValue(image, "src", out found);
                 if (found && imageSrc.EndsWith("changeHistory.gif"))
                 {
                     return(true);
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
        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;
        }
 public static ReadOnlyCollection <IControl> GetQueryList(String queriesType)
 {
     try
     {
         IControl messageHolderCell = SyncUtilities.FindVisibleElement(By.ClassName("modMessageHolder"));
         if (messageHolderCell != null && messageHolderCell.WebElement != null)
         {
             ReadOnlyCollection <IControl> messageBlockList = SyncUtilities.FindVisibleElements_Parent(messageHolderCell.WebElement, By.ClassName("modMessage"));
             if (messageBlockList != null && messageBlockList.Count > 0)
             {
                 foreach (IControl c in messageBlockList)
                 {
                     if (c.WebElement.Text.StartsWith(queriesType, StringComparison.InvariantCultureIgnoreCase))
                     {
                         return(SyncUtilities.FindVisibleElements_Parent(c.WebElement, By.TagName("li")));
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(null);
 }
Exemplo n.º 6
0
 public static IControl GetImageControl(IControl host, string imageName)
 {
     try
     {
         System.Collections.ObjectModel.ReadOnlyCollection <IControl> cc = SyncUtilities.FindVisibleElements_Parent(host.WebElement, By.TagName("image"));
         List <IControl> imageList = SyncUtilities.FindVisibleElements_Parent(host.WebElement, By.TagName("input")).ToList <IControl>();
         if (imageName.Equals("SaveAnd"))
         {
             foreach (IControl image in imageList)
             {
                 bool   found;
                 String imageProp = Control_PropertyUtilities.GetAttributeValue(image, "id", out found);
                 if (found)
                 {
                     if (imageProp.EndsWith("btnSaveAdd"))
                     {
                         return(image);
                     }
                 }
             }
             return(null);
         }
         else if (imageName.Equals("Save"))
         {
             foreach (IControl image in imageList)
             {
                 bool   found;
                 String imageProp = Control_PropertyUtilities.GetAttributeValue(image, "id", out found);
                 if (found)
                 {
                     if (imageProp.EndsWith("btnSave"))
                     {
                         return(image);
                     }
                 }
             }
             return(null);
         }
         else if (imageName.Equals("Cancel"))
         {
             foreach (IControl image in imageList)
             {
                 bool   found;
                 String imageProp = Control_PropertyUtilities.GetAttributeValue(image, "id", out found);
                 if (found)
                 {
                     if (imageProp.EndsWith("btnCancel"))
                     {
                         return(image);
                     }
                 }
             }
             return(null);
         }
     }
     catch (Exception e)
     {
     }
     return(null);
 }
        /*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);
        }
        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")));
        }
        public static ReadOnlyCollection<IControl> GetMrrTableRows()
        {

            if (IsInReferenceRangePage())
            {                
                IControl tbody = SyncUtilities.FindVisibleElement(By.XPath("//div[@id='gridReferenceRanges']//tbody"));
                return SyncUtilities.FindVisibleElements_Parent(tbody.WebElement, By.TagName("tr"));                
            }
            return null;
        }
Exemplo n.º 10
0
        public static bool HasText(IControl siteRow, int columnIndex, String cellText)
        {
            ReadOnlyCollection <IControl> cells = SyncUtilities.FindVisibleElements_Parent(siteRow.WebElement, By.TagName("td"));

            if (cells.Count > columnIndex)
            {
                return(HasText(cells[columnIndex].WebElement, cellText));
            }
            return(false);
        }
Exemplo n.º 11
0
        public static IControl GetCell(IControl tableRow, int columnIndex)
        {
            ReadOnlyCollection <IControl> cells = SyncUtilities.FindVisibleElements_Parent(tableRow.WebElement, By.TagName("td"));

            if (cells.Count > columnIndex)
            {
                return(cells[columnIndex]);
            }
            return(null);
        }
        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")));
        }
        public static ReadOnlyCollection <IControl> GetDropdownItems()
        {
            String   dropdonwItemsHostCSSSelector = ".k-animation-container ul";
            IControl host = SyncUtilities.FindVisibleElement(By.CssSelector(dropdonwItemsHostCSSSelector));

            if (!Control_PropertyUtilities.IsControlNull(host))
            {
                return(SyncUtilities.FindVisibleElements_Parent(host.WebElement, By.TagName("li")));
            }
            return(null);
        }
 static IControl GetFilterCriteriaItem(IControl activeFilters, String filterCriteria)
 {
     ReadOnlyCollection<IControl> list = SyncUtilities.FindVisibleElements_Parent(activeFilters.WebElement, By.TagName("li"));
     foreach (IControl c in list)
     {
         if (c.WebElement.Text.Equals(filterCriteria, StringComparison.InvariantCultureIgnoreCase))
         {
             return c;
         }
     }
     return null;
 }
Exemplo n.º 15
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);
        }
Exemplo n.º 16
0
 static bool IsEventRow(IControl row, out IControl eventNameLabel)
 {
     eventNameLabel = null;
     try
     {
         ReadOnlyCollection <IControl> cells = SyncUtilities.FindVisibleElements_Parent(row.WebElement, By.TagName("td"));
         eventNameLabel = SyncUtilities.FindElement_Parent(cells[0].WebElement, By.Id("lblEventName"));
         return(!Control_PropertyUtilities.IsControlNull(eventNameLabel));
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 public static ReadOnlyCollection<IControl> GetHeaderRows()
 {            
     
         if (IsInReferenceRangePage())
         {                    
             IControl grid = SyncUtilities.FindElement(By.CssSelector("#gridReferenceRanges"));
             IControl headerheader = SyncUtilities.FindElement_Parent(grid.WebElement, By.CssSelector("div.k-grid-header"));
             IControl table = SyncUtilities.FindElement_Parent(headerheader.WebElement, By.TagName("table"));
             IControl header = SyncUtilities.FindElement_Parent(table.WebElement, By.CssSelector("thead"));
             return SyncUtilities.FindVisibleElements_Parent(header.WebElement, By.TagName("tr"));
     }
         return null;
     
 }
Exemplo n.º 18
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);
        }
        protected static IControl GetQuestionHost(String questionNumber, String questionPrompt)
        {
            IControl crfTabContent = SyncUtilities.FindVisibleElement(By.Id("divCRFTab"));
            ReadOnlyCollection <IControl> questionList = SyncUtilities.FindVisibleElements_Parent(crfTabContent.WebElement, By.ClassName("table100pct"));

            foreach (IControl question in questionList)
            {
                ReadOnlyCollection <IControl> questionParts = SyncUtilities.FindVisibleElements_Parent(question.WebElement, By.TagName("td"));
                if (IsQuestionNumberAndPromptAvailable(questionParts, questionNumber, questionPrompt))
                {
                    return(question);
                }
            }
            return(null);
        }
Exemplo n.º 20
0
        static IControl GetPatientsTable()
        {
            IControl mainContent      = SyncUtilities.FindVisibleElement(By.Id("tblMainContent"));
            IControl patientTableHost = SyncUtilities.FindVisibleElement_Parent(mainContent.WebElement, By.Id("bodyCol"));
            ReadOnlyCollection <IControl> tableList = SyncUtilities.FindVisibleElements_Parent(patientTableHost.WebElement, By.TagName("table"));

            foreach (IControl table in tableList)
            {
                if (IsPatiensTable(table))
                {
                    return(table);
                }
            }
            return(null);
        }
Exemplo n.º 21
0
 static List <IControl> GetCodelistLinkage_Item_DropdownItems()
 {
     try
     {
         IControl host = SyncUtilities.FindVisibleElement(By.Id("ctl00_ctl00_ContentBody_ContentBody_questionTab_questionData_rcbItems_DropDown"));
         if (!Control_PropertyUtilities.IsControlNull(host))
         {
             return(SyncUtilities.FindVisibleElements_Parent(host.WebElement, By.CssSelector(".rcbScroll > ul > li")).ToList <IControl>());
         }
     }
     catch (Exception e)
     {
     }
     return(null);
 }
        public static IControl GetRowByReferenceRangeID(string RRID)
        {
            IControl referenceRangeTable = ReferenceRangesPage.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]"));
                if (RRID.Equals(referenceRangeId.WebElement.Text.Trim()))
                {
                    return row;
                }

            }
            return new Control(null);
        }
Exemplo n.º 23
0
 static IControl GetFormAddReasonLink(List <IControl> eventFormRows, String formName)
 {
     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))
             {
                 return(SyncUtilities.FindVisibleElement_Parent(cells[6].WebElement, By.TagName("a")));
             }
         }
     }
     return(null);
 }
        public static IControl GetTabHeader(String headerText)
        {
            IControl host = SyncUtilities.FindVisibleElement(By.Id("editPrefTabs"));
            ReadOnlyCollection <IControl> headerList = SyncUtilities.FindVisibleElements_Parent(host.WebElement, By.TagName("li"));

            foreach (IControl c in headerList)
            {
                IControl link     = SyncUtilities.FindVisibleElement_Parent(c.WebElement, By.TagName("a"));
                String   linkText = Control_PropertyUtilities.GetText(link);
                if (headerText.Equals(linkText, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(link);
                }
            }
            return(null);
        }
Exemplo n.º 25
0
        public static IControl GetSiteCheckbox(String site)
        {
            IControl table = SyncUtilities.FindVisibleElement(By.Id("ctl00_ctl00_CPH_body_ContentBody_chboxlistSite"));
            ReadOnlyCollection <IControl> spanList = SyncUtilities.FindVisibleElements_Parent(table.WebElement, By.TagName("span"));

            foreach (IControl c in spanList)
            {
                IControl siteLabel = SyncUtilities.FindVisibleElement_Parent(c.WebElement, By.TagName("label"));
                String   text      = Control_PropertyUtilities.GetText(siteLabel);
                if (text.Equals(site, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(SyncUtilities.FindVisibleElement_Parent(c.WebElement, By.TagName("input")));
                }
            }
            return(null);
        }
Exemplo n.º 26
0
        public static IControl GetActionPaletteItemToInvoke(IControl actionPaletteGroup, String actionPaletteItemName)
        {
            ReadOnlyCollection <IControl> tdList = SyncUtilities.FindVisibleElements_Parent(actionPaletteGroup.WebElement, By.TagName("td"));

            if (tdList.Count > 0)
            {
                foreach (IControl td in tdList)
                {
                    if (td.WebElement.Text.Contains(actionPaletteItemName))
                    {
                        return(SyncUtilities.FindVisibleElement_Parent(td.WebElement, By.TagName("span")));
                    }
                }
            }
            return(null);
        }
 static ReadOnlyCollection <IControl> GetFormsRowsUnderEvent(String eventName)
 {
     try
     {
         String patientEventkey = String.Empty;
         if (ExpandEvent(eventName, out patientEventkey) && !String.IsNullOrEmpty(patientEventkey))
         {
             String cssSelector = "tr[patienteventkey='" + patientEventkey + "']";
             return(SyncUtilities.FindVisibleElements_Parent(DL_Patient_EventFormsPage.EvetnsTable.WebElement, By.CssSelector(cssSelector)));
         }
     }
     catch (Exception e)
     {
     }
     return(null);
 }
Exemplo n.º 28
0
 public static IControl GetAddReasonLink(String eventName, String formName)
 {
     try
     {
         IControl table = SyncUtilities.FindVisibleElement(By.Id("SignCasebook"));
         ReadOnlyCollection <IControl> rows = SyncUtilities.FindVisibleElements_Parent(table.WebElement, By.CssSelector("tbody > tr"));
         if (rows.Count > 0)
         {
             List <IControl> eventFormRows = GetEventFormRows(rows, eventName);
             return(GetFormAddReasonLink(eventFormRows, formName));
         }
     }
     catch (Exception e)
     {
     }
     return(null);
 }
        public static IControl GetFreezeCheckBoxForPatient(string patientId)
        {
            ReadOnlyCollection <IControl> Rows = SyncUtilities.FindVisibleElements_Parent(DL_FreezePatientPage.PatientsTable.WebElement, By.TagName("tr"));

            foreach (IControl row in Rows)
            {
                ReadOnlyCollection <IControl> columns = SyncUtilities.FindVisibleElements_Parent(row.WebElement, By.TagName("td"));
                string PatientName = columns[0].WebElement.Text;
                PatientName = PatientName.Trim();
                if (patientId.Equals(PatientName, StringComparison.InvariantCultureIgnoreCase))
                {
                    return(SyncUtilities.FindVisibleElement_Parent(columns[3].WebElement, By.TagName("input")));
                }
            }

            return(null);
        }
 public static IControl GetRadioButtonForFlag(String eventName, String formName, String radioButtonName)
 {
     try
     {
         IControl table = SyncUtilities.FindVisibleElement(By.Id("tblCRFList"));
         ReadOnlyCollection <IControl> rows = SyncUtilities.FindVisibleElements_Parent(table.WebElement, By.CssSelector("tbody > tr"));
         if (rows.Count > 0)
         {
             List <IControl> eventFormRows = GetEventFormRowsForFlag(rows, eventName);
             return(GetFormRadioButtonForFlag(eventFormRows, formName, radioButtonName));
         }
     }
     catch (Exception e)
     {
     }
     return(null);
 }