Exemple #1
0
 public static bool ExpandFlagsPalette()
 {
     try
     {
         IControl expandCollapseIcon = DL_EditDCFPage.DCF_FlagsPaletteCollaseExpandIcon;
         bool     found = false;
         String   src   = Control_PropertyUtilities.GetAttributeValue(expandCollapseIcon, "src", out found);
         if (found)
         {
             if (src.Contains("menuDown"))
             {
                 return(Control_ActionUtilities.Click(expandCollapseIcon, String.Empty));
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool ExpandSearchPalette()
 {
     try
     {
         IControl c           = DL_DCFs_SearchPalette.SearchPalette_ExpandCollapseIcon;
         bool     found       = false;
         String   imageSource = Control_PropertyUtilities.GetAttributeValue(c, "src", out found);
         if (found)
         {
             if (imageSource.Contains("menuDown"))
             {
                 return(Control_ActionUtilities.Click(c, String.Empty));
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool ExpandAllEvents()
 {
     try
     {
         IControl expandCollapseAllIcon = SyncUtilities.FindVisibleElement(By.Id("imgExpandAll"));
         bool     found = false;
         String   src   = Control_PropertyUtilities.GetAttributeValue(expandCollapseAllIcon, "src", out found);
         if (found)
         {
             if (src.Contains("menu_collapse"))
             {
                 Control_ActionUtilities.Click(expandCollapseAllIcon, String.Empty);
             }
             Control_ActionUtilities.Click(expandCollapseAllIcon, String.Empty);
         }
         IControl expandCollapseAllIcon1 = SyncUtilities.FindVisibleElement(By.Id("imgExpandAll"));
         bool     found1 = false;
         String   src1   = Control_PropertyUtilities.GetAttributeValue(expandCollapseAllIcon, "src", out found1);
         if (found1)
         {
             return(src1.Contains("menu_collapse"));
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 public static bool ExpandAttributeMappingGender()
 {
     try
     {
         bool     found;
         IControl expandCollapseAllIcon = SyncUtilities.FindVisibleElement(By.Id("img_LabAttributeReference_0_S"));
         String   src = Control_PropertyUtilities.GetAttributeValue(expandCollapseAllIcon, "src", out found);
         if (found)
         {
             if (src.Contains("expand"))
             {
                 Control_ActionUtilities.Click(expandCollapseAllIcon, String.Empty);
                 CodelistMappingsInAttributeMappings();
                 return(true);
             }
             else
             {
                 CodelistMappingsInAttributeMappings();
                 return(true);
             }
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 public static bool LabMappings()
 {
     try
     {
         bool     found;
         IControl expandCollapseAllIcon = SyncUtilities.FindVisibleElement(By.Id("img_SubDataShape_SC"));
         String   src = Control_PropertyUtilities.GetAttributeValue(expandCollapseAllIcon, "src", out found);
         if (found)
         {
             if (src.Contains("expand"))
             {
                 Control_ActionUtilities.Click(expandCollapseAllIcon, String.Empty);
                 LabMappingsDomain();
                 return(true);
             }
             else
             {
                 LabMappingsDomain();
                 return(true);
             }
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 public static bool TargetStudy()
 {
     try
     {
         IControl CodelistTable             = SyncUtilities.FindVisibleElement(By.Id("LabAttributeReference_0_CodeListMappingsReference_0_CodelistMapping_TT"));
         ReadOnlyCollection <IControl> rows = null;
         if (WebTableUtilities.GetRowCount(CodelistTable, out rows) > 0)
         {
             foreach (IControl row in rows)
             {
                 bool     found;
                 IControl celldata       = WebTableUtilities.GetCell(row, 1);
                 String   attribureValue = Control_PropertyUtilities.GetAttributeValue(celldata, "class", out found);
                 if (found)
                 {
                     if (attribureValue.Contains("modified-cell"))
                     {
                         Control_PropertyUtilities.CompareCSSValue(celldata, "background-color", "#fcdc75");
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(true);
 }
        /*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 bool VerifyFormStautsIcon(String eventName, String formName, String icon)
        {
            try
            {
                IControl formCell = null;
                IControl formRow  = GetFormRow(eventName, formName, out formCell);
                IControl formIcon = DL_CRF_PDEP_EventsPage.GetIcon(formCell);

                if (icon.Equals("Mismatch"))
                {
                    bool   found = false;
                    String src   = Control_PropertyUtilities.GetAttributeValue(formIcon, "src", out found);
                    if (found)
                    {
                        return(src.Contains("PDE_mismatch"));
                    }
                }
                if (icon.Equals("Submitted"))
                {
                    bool   found = false;
                    String src   = Control_PropertyUtilities.GetAttributeValue(formIcon, "src", out found);
                    if (found)
                    {
                        return(src.Contains("Doc_S"));
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
        public static bool VerifyFormRestrictionMessage(List <PDEP_FormAccesssRestrictionMessageData> dataList)
        {
            try
            {
                foreach (PDEP_FormAccesssRestrictionMessageData data in dataList)
                {
                    if (String.IsNullOrEmpty(data.Event) || String.IsNullOrEmpty(data.Form) || String.IsNullOrEmpty(data.RestrictionMessage))
                    {
                        return(false);
                    }

                    IControl formCell = null;
                    IControl formRow  = GetFormRow(data.Event, data.Form, out formCell);
                    if (!Control_PropertyUtilities.IsControlNull(formCell))
                    {
                        IControl formLink = DL_CRF_PDEP_EventsPage.GetFormLink(formCell);
                        bool     found    = false;
                        String   value    = Control_PropertyUtilities.GetAttributeValue(formLink, "rel", out found);
                        if (!found || !value.Equals(data.RestrictionMessage, StringComparison.InvariantCultureIgnoreCase))
                        {
                            return(false);
                        }
                    }
                }
                return(true);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
 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);
 }
Exemple #11
0
        public static bool SelectePatients(List <SiteManagementMigratePatientsData> patients)
        {
            bool isSuccess = false;

            try
            {
                foreach (SiteManagementMigratePatientsData patient in patients)
                {
                    WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
                    list.AddSearchItem(new WebTable_SearchCriteriaItem(0, patient.PatientID, TableColumnContentType.Text));
                    IControl patientRow   = WebTableUtilities.Table_FindRow(DL_MigratePatientsPage.PatientsTable, list, 0);
                    IControl checkboxCell = WebTableUtilities.GetCell(patientRow, 2);
                    IControl checkbox     = WebTableUtilities.GetInputControl(checkboxCell);
                    bool     found        = false;
                    String   propValue    = Control_PropertyUtilities.GetAttributeValue(checkbox, "checked", out found);
                    if (!found)
                    {
                        isSuccess = Control_ActionUtilities.Click(checkbox, String.Empty);
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(isSuccess);
        }
 public static bool CollapseEvent(String eventName, out String patientEventKey)
 {
     patientEventKey = String.Empty;
     try
     {
         int i = 0;
         while (i < 5)
         {
             IControl eventExpandCollapseImage = GetEventExpandCollapseImage(eventName, out patientEventKey);
             if (eventExpandCollapseImage != null && eventExpandCollapseImage.WebElement != null)
             {
                 bool   found    = false;
                 String prop_SRC = Control_PropertyUtilities.GetAttributeValue(eventExpandCollapseImage, "src", out found);
                 if (found && prop_SRC.Contains("menu_collapse.gif"))
                 {
                     Control_ActionUtilities.Click(eventExpandCollapseImage, String.Empty);
                 }
                 else if (found && prop_SRC.Contains("menu_expand.gif"))
                 {
                     return(true);
                 }
             }
             Thread.Sleep(2000);
             ++i;
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 static String GetPatientEventKey(IControl eventRow)
 {
     try
     {
         bool   found = false;
         String rowId = Control_PropertyUtilities.GetAttributeValue(eventRow, "id", out found);
         if (found && !String.IsNullOrEmpty(rowId))
         {
             String[] values = rowId.Split("_".ToCharArray());
             if (values.Length == 2)
             {
                 String key         = values[1];
                 int    i           = 0;
                 bool   isConverted = int.TryParse(key, out i);
                 if (isConverted)
                 {
                     return(key);
                 }
             }
         }
     }
     catch (Exception e)
     {
     }
     return(String.Empty);
 }
Exemple #14
0
 static bool VerifyPrintCheckboxValue(IControl row, DCFPrintWizardStep1Data data)
 {
     try
     {
         if (!String.IsNullOrEmpty(data.IsPrintEnabled))
         {
             if (!Control_PropertyUtilities.IsControlNull(row))
             {
                 IControl printCheckbox = WebTableUtilities.GetElement(row, String.Empty, 5, TableColumnContentType.Checkbox);
                 if (!Control_PropertyUtilities.IsControlNull(printCheckbox))
                 {
                     bool   found        = false;
                     String checkedValue = Control_PropertyUtilities.GetAttributeValue(printCheckbox, "checked", out found);
                     return(found);
                 }
             }
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool ExpandEvent(String eventName, out String identifier)
 {
     identifier = String.Empty;
     try
     {
         ReadOnlyCollection <IControl> rows = WebTableUtilities.GetRows(DL_CRF_PDEP_EventsPage.EventsTable);
         foreach (IControl row in rows)
         {
             if (Control_PropertyUtilities.IsControlVisible(row))
             {
                 IControl cell = WebTableUtilities.GetCell(row, 0);
                 if (Control_PropertyUtilities.GetText(cell).Equals(eventName, StringComparison.InvariantCultureIgnoreCase))
                 {
                     IControl expandCollapseImage = WebTableUtilities.GetElement(row, String.Empty, 0, TableColumnContentType.Image);
                     bool     found       = false;
                     String   imageSource = Control_PropertyUtilities.GetAttributeValue(expandCollapseImage, "src", out found);
                     if (found)
                     {
                         identifier = Control_PropertyUtilities.GetAttributeValue(row, "identifier", out found);
                         if (imageSource.Contains("menu_expand.gif"))
                         {
                             return(Control_ActionUtilities.Click(expandCollapseImage, String.Empty));
                         }
                         return(imageSource.Contains("menu_collapse.gif"));
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool IsTableHistoryIconAvailable_WithoutWait(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.FindElements_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);
 }
 static bool ClickPageNavigationButton(IControl c)
 {
     bool found = false;
     String cssValue = Control_PropertyUtilities.GetAttributeValue(c, "class", out found);
     if (!cssValue.Contains("k-state-disabled"))
     {
         return Control_ActionUtilities.Click(c, String.Empty);
     }
     return false;
 }
        static bool IsFlagTypeExpanded(IControl expandCollapseIcon)
        {
            bool   found         = false;
            String propertyValue = Control_PropertyUtilities.GetAttributeValue(expandCollapseIcon, "src", out found);

            if (found)
            {
                return(propertyValue.Contains("collapse"));
            }
            return(found);
        }
 public static String GetHeaderDataInQuestion()
 {
     try
     {
         return(Control_PropertyUtilities.GetAttributeValue(DS_Forms.HeaderInQuestion, "Value", out bool found));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
         return(null);
     }
 }
        static bool IsIconAvailable(IControl cell, String imageName)
        {
            IControl image = WebTableUtilities.GetImage(cell);
            bool     found = false;
            String   src   = Control_PropertyUtilities.GetAttributeValue(image, "src", out found);

            if (found)
            {
                return(src.ToUpper().Contains(imageName.ToUpper()));
            }
            return(false);
        }
        static bool ClickPageNavigationButton(IControl c)
        {
            bool   found    = true;
            String cssValue = Control_PropertyUtilities.GetAttributeValue(c, "class", out found);

            if (!found)
            {
                return(Control_ActionUtilities.Click(c, String.Empty));
            }
            if (found && !cssValue.Contains("disabled"))
            {
                return(Control_ActionUtilities.Click(c, String.Empty));
            }
            return(false);
        }
        static bool ClickPageNavigationButton(IControl c)
        {
            bool   found    = true;
            String cssValue = Control_PropertyUtilities.GetAttributeValue(c, "disabled", out found);

            if (!found)
            {
                return(Control_ActionUtilities.Click(c, String.Empty));
            }
            if (found && !cssValue.Equals("disabled", StringComparison.InvariantCultureIgnoreCase))
            {
                return(Control_ActionUtilities.Click(c, String.Empty));
            }
            return(false);
        }
Exemple #23
0
 public static bool OpenSubTabUnderDCFTab(String dcfSubTabName)
 {
     try
     {
         IControl tabHeader = DL_FormPage.GetSubTabUnderDCFTabInForm(dcfSubTabName);
         Control_ActionUtilities.Click(DL_FormPage.GetSubtabHeaderLinkToOpen(tabHeader, dcfSubTabName), String.Empty);
         IControl openedTabHeader = DL_FormPage.GetSubTabUnderDCFTabInForm(dcfSubTabName);
         bool     found           = false;
         String   value           = Control_PropertyUtilities.GetAttributeValue(openedTabHeader, "class", out found);
         return(found && value.Contains("selected"));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
Exemple #24
0
        public static bool SeeTheMessage(String message)
        {
            bool   found = false;
            string messageFromApplication;

            try
            {
                messageFromApplication = Control_PropertyUtilities.GetAttributeValue(DS_HomePage.ManageLabsMessage, message, out found);
                string messageFromApplication1 = messageFromApplication.TrimStart(' ');
                string messageFormApplication2 = messageFromApplication1.TrimEnd(' ');
                return(messageFormApplication2.Equals(message));
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
Exemple #25
0
 static bool CheckCheckbox(IControl checkbox)
 {
     try
     {
         bool   found     = false;
         String propValue = Control_PropertyUtilities.GetAttributeValue(checkbox, "checked", out found);
         if (!found)
         {
             found = Control_ActionUtilities.Click(checkbox, String.Empty);
         }
         return(found);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
Exemple #26
0
 public static bool MessageDisplayedOnMouseHover(string Message1, string Message2)
 {
     try
     {
         bool   found = false;
         String textFromApplication = Control_PropertyUtilities.GetAttributeValue(DS_StudyProperties.LabsMouseHover, "title", out found);
         if (found)
         {
             string fromFeatureFile = Message1 + "\"Yes\"" + Message2;
             return(textFromApplication.Equals(fromFeatureFile));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool LabTestMappings()
 {
     try
     {
         bool     found;
         IControl expandCollapseAllIcon = SyncUtilities.FindVisibleElement(By.Id("img_LabDictionary_0_S"));
         String   src = Control_PropertyUtilities.GetAttributeValue(expandCollapseAllIcon, "src", out found);
         if (found)
         {
             if (src.Contains("expand"))
             {
                 return(Control_ActionUtilities.Click(expandCollapseAllIcon, String.Empty));
             }
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
        public static IControl GetTableHistoryIcon(String tableName)
        {
            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(image);
                    }
                }
            }
            return(null);
        }
Exemple #29
0
        public static bool VerifyReadyToPrintStatus(String status)
        {
            try
            {
                IControl image = DL_EditDCFPage.ReadyToPrintFlagStatusIcon;
                bool     found = false;
                String   src   = Control_PropertyUtilities.GetAttributeValue(image, "src", out found);

                if (found && status.Equals("On", StringComparison.InvariantCultureIgnoreCase))
                {
                    return(src.Contains("yes"));
                }
                else if (found && status.Equals("Off", StringComparison.InvariantCultureIgnoreCase))
                {
                    return(src.Contains("no"));
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
Exemple #30
0
        public static bool ClickOnTheFilterButton(string pageHeaderFromApplication)
        {
            bool found = false;

            try
            {
                IControl pageHeader     = DS_StudyProperties.Page(pageHeaderFromApplication);
                string   pageHeaderName = Control_PropertyUtilities.GetAttributeValue(pageHeader, pageHeaderFromApplication, out found);
                if (pageHeaderName.Equals(pageHeaderFromApplication))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }