public static bool ClickInboxItem(String folderName, String subject)
 {
     try
     {
         int i = 0;
         while (i < 25)
         {
             if (BP_Inbox_ActionPaletteUtilities.InvokeActionPaletteItem(folderName))
             {
                 ReadOnlyCollection <IControl> rows = WebTableUtilities.GetRows(Pages.DataLabs.Inbox.DL_InboxPage.InboxTable);
                 foreach (IControl row in rows)
                 {
                     IControl c = WebTableUtilities.GetElement(row, subject, 3, TableColumnContentType.Link_Partial);
                     if (!Control_PropertyUtilities.IsControlNull(c))
                     {
                         return(Control_ActionUtilities.Click(c, "Unbale to click inbox item for subject " + subject));
                     }
                 }
             }
             ++i;
             Thread.Sleep(5000);
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
        public static bool SelectModalItemsInMainPage(String itemToSelect)
        {
            //INeedToWaitForWebelementToAppearInPage(wf_Page_Main.HomePageLogo,TimeSpan.FromSeconds(loadTime));

            {
                switch (itemToSelect.ToUpper())
                {
                case "DOMAINS":
                    //wf_Page_Main.item_Domains.WebElement.Click();
                    Control_ActionUtilities.DoubleClickOnObject(wf_Page_Main.item_Domains);
                    //Thread.Sleep(3000);
                    break;

                case "WEB CONTENT":
                    //wf_Page_Main.item_WebContent.WebElement.Click();
                    Control_ActionUtilities.DoubleClickOnObject(wf_Page_Main.item_WebContent);
                    //Thread.Sleep(2000);
                    break;

                case "GLOBAL RESOURCES":
                    //wf_Page_Main.item_GlobalResources.WebElement.Click();
                    Control_ActionUtilities.DoubleClickOnObject(wf_Page_Main.item_GlobalResources);
                    //Thread.Sleep(2000);
                    break;

                default:
                    throw new Exception("Invalid Item provided : " + itemToSelect.ToString());
                }
            }
            return(true);
        }
 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 SetQuickExportData(QuickExportData data)
 {
     try
     {
         if (!String.IsNullOrEmpty(data.Site))
         {
             Control_ActionUtilities.Dropdown_SelectItem(DL_QuickExportPage.SiteDropdown, data.Site, String.Empty);
         }
         if (!String.IsNullOrEmpty(data.Patient))
         {
             Control_ActionUtilities.Dropdown_SelectItem(DL_QuickExportPage.PatientDropdown, data.Patient, String.Empty);
         }
         if (!String.IsNullOrEmpty(data.Event))
         {
             Control_ActionUtilities.Dropdown_SelectItem(DL_QuickExportPage.EventDropdown, data.Event, String.Empty);
         }
         if (!String.IsNullOrEmpty(data.Form))
         {
             Control_ActionUtilities.Dropdown_SelectItem(DL_QuickExportPage.FormsDropdown, data.Form, String.Empty);
         }
         if (!String.IsNullOrEmpty(data.Format))
         {
             Control_ActionUtilities.Dropdown_SelectItem(DL_QuickExportPage.FormatDropdown, data.Format, String.Empty);
         }
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, 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);
 }
예제 #6
0
        public static bool EnrollAPatient(string PatientID, EnrollPatientData PatientData)
        {
            bool isEnrollSuccessful = false;

            if (Control_PropertyUtilities.GetText(DL_PatientsPage.SelectedPatient) != PatientID)
            {
                Control_ActionUtilities.LogException("Verification of Patient on selecting a patient.", "Patient detail is not displayed as " + PatientID + " on the screen.", string.Empty);
                return(false);
            }
            string status = Control_PropertyUtilities.GetText(DL_PatientsPage.SelectedPatientStatus);

            if (status != "Screened")
            {
                Control_ActionUtilities.LogException("Verification of Patient status on patient details screen.", "Patient status detail is displayed as " + status + " on the screen.", string.Empty);
                return(false);
            }
            if (BP_ActionPaletteUtilities.InvokeActionPaletteLink("Enroll Patient", DL_PatientsPage.GetPatientActionPaletteID("Patient Actions")))
            {
                if (FillEnrollPatientCRF(PatientData))
                {
                    //Control_ActionUtilities.Click(DL_PatientsPage.EntryCompleteChkBox, "Unable to select Entry Complete checkbox.");
                    isEnrollSuccessful = Control_ActionUtilities.SubmitSaveNCloseButton(DL_CRFPage.SaveNCloseButton_CRF, "Unable to Enroll patient.");
                }
            }
            if (isEnrollSuccessful)
            {
                status = Control_PropertyUtilities.GetText(DL_PatientsPage.SelectedPatientStatus);
                if (status != "Enrolled")
                {
                    isEnrollSuccessful = false;
                }
            }
            return(isEnrollSuccessful);
        }
예제 #7
0
 static bool SelectForm(SignCasebookData data)
 {
     try
     {
         IControl radioButton = DL_SignCasebookPage.GetRadioButton(data.EventName, data.FormName, data.RadioButton);
         if (!Control_PropertyUtilities.IsControlNull(radioButton))
         {
             if (data.RadioButton.Equals("Reject"))
             {
                 Control_ActionUtilities.Click(radioButton, String.Empty);
                 Control_ActionUtilities.Click(DL_SignCasebookPage.GetAddReasonLink(data.EventName, data.FormName), "Unable to Select Add Reason link for " + data.EventName + "-" + data.FormName);
                 BP_Modal_CRF_MarkItemUtilities.EnterComment(data.AddReason);
                 return(BP_Modal_CRF_MarkItemUtilities.ClickOkButton());
             }
             else if (!String.IsNullOrEmpty(data.RadioButton))
             {
                 return(Control_ActionUtilities.Click(radioButton, String.Empty));
             }
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
예제 #8
0
 public static bool VerifyTagsInXMLFile(string FileName, List <XMLData> TagsTable)
 {
     try
     {
         XmlDocument xmlDoc   = new XmlDocument();
         string      FilePath = GetXMLFilePath(FileName);
         xmlDoc.Load(FilePath);
         XmlNodeList nodes = xmlDoc.SelectNodes("//*");
         if (nodes.Count != TagsTable.Count)
         {
             Control_ActionUtilities.LogException("Verification of tags in XML file.", "Tags count in test input is not matching with tags in XML file.", string.Empty);
             return(false);
         }
         int counter = 0;
         foreach (XmlNode node in nodes)
         {
             if (node.Name.Trim() != TagsTable[counter].TagName.Trim())
             {
                 Control_ActionUtilities.LogException("Verification of tags in XML file.", "Tags in test input is not matching with tags in XML file.", string.Empty);
                 return(false);
             }
             counter++;
         }
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
예제 #9
0
        public static bool SelectCheckboxForPatients(List <PatientTableData> PatientList, out List <string> FailedItems)
        {
            bool isSuccess = false;

            FailedItems = new List <string>();
            try
            {
                foreach (PatientTableData Patient in PatientList)
                {
                    if (!Control_PropertyUtilities.IsControlNull(DL_FreezePatientPage.GetFreezeCheckBoxForPatient(Patient.PatientID)))
                    {
                        isSuccess = Control_ActionUtilities.Click(DL_FreezePatientPage.GetFreezeCheckBoxForPatient(Patient.PatientID), "Unable to Select checkbox for - " + Patient.PatientID);
                    }
                    else
                    {
                        FailedItems.Add(Patient.PatientID);
                        isSuccess = false;
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(isSuccess);
        }
예제 #10
0
 public static bool SelectSites(List <StudyArchive_SiteData> sites)
 {
     try
     {
         foreach (StudyArchive_SiteData site in sites)
         {
             WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
             list.AddSearchItem(new WebTable_SearchCriteriaItem(1, site.Site, TableColumnContentType.Text));
             IControl tableRow = WebTableUtilities.Table_FindRow(DL_ArchiveExportPage.SitesTable, list);
             if (!Control_PropertyUtilities.IsControlNull(tableRow))
             {
                 IControl tableCell = WebTableUtilities.GetCell(tableRow, 0);
                 IControl checkbox  = WebTableUtilities.GetInputControl(tableCell);
                 if (!Control_ActionUtilities.Click(checkbox, "Unable to click site " + site.Site + "checkbox in ArchiveExportPage"))
                 {
                     return(false);
                 }
             }
         }
         return(true);
     }
     catch (Exception e)
     {
     }
     return(false);
 }
예제 #11
0
 public static bool VerifyAttributesInExpectedAndActualXMLNodes(XmlNode ExpNode, XmlNode ActNode, string TagName)
 {
     try
     {
         XmlAttributeCollection ExpAttCol = ExpNode.Attributes;
         XmlAttributeCollection ActAttCol = ActNode.Attributes;
         if (ExpAttCol.Count != ActAttCol.Count)
         {
             Control_ActionUtilities.LogException("Verification of attributes in xml tag", "Number of attributes/fields for " + TagName + " in expected and actual xml data files is not matching.", string.Empty);
             return(false);
         }
         foreach (XmlAttribute expAtt in ExpAttCol)
         {
             string       ExpAttName = expAtt.Name;
             XmlAttribute ActAtt     = ActNode.Attributes[ExpAttName];
             if (ActAtt != null)
             {
                 if (ActAtt.Value != expAtt.Value)
                 {
                     return(false);
                 }
             }
             else
             {
                 return(false);
             }
         }
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
        public static bool ApplyFilterForSubHeading(String columnName, String filterText, String filterCriteria, int occurence)
        {
            try
            {
                IControl filterIcon = DL_Lab_MRR_Table.GetColumnFilterLinkForSubColumns(columnName, occurence);
                Control_ActionUtilities.Click(filterIcon, String.Empty);
                //Control_ActionUtilities.Click(filterIcon, String.Empty);


                Control_ActionUtilities.Click(DL_Lab_MRR_Table.FilterDropDownIcon, String.Empty);


                IControl filterCriteriaItem = DL_Lab_MRR_Table.GetActiveFilterItem(filterCriteria);

                Control_ActionUtilities.Click(filterCriteriaItem, String.Empty);

                IControl filterTextbox = DL_Lab_MRR_Table.FilterTextBox;
                Control_ActionUtilities.Textbox_SetText(filterTextbox, filterText, String.Empty);

                IControl filterButton = DL_Lab_MRR_Table.FilterButton;
                Control_ActionUtilities.Click(filterButton, String.Empty);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
                return(false);
            }
            return(true);
        }
예제 #13
0
        public static bool VerifyValuesInDropdown(List <DropDownInfo> dropdownInfoList, String fieldName)
        {
            try
            {
                List <string> dropdown = new List <string>();
                foreach (DropDownInfo dropdownInfo in dropdownInfoList)
                {
                    dropdown.Add(dropdownInfo.Dropdown);
                }

                IControl dropdowncontrol = DL_Lab_MRR_Table.GetDropdownInvoker(fieldName);
                Control_ActionUtilities.Click(dropdowncontrol, "Not able to click on dropdowncontrol");
                IControl selectValueInDropdown = DL_Lab_MRR_Table.GetSelectValueFromDropdown;
                string   selectValue           = Control_PropertyUtilities.GetText(selectValueInDropdown);
                ReadOnlyCollection <IControl> dropdowncontrollist = DL_Lab_MRR_Table.GetDropdownItems();
                List <string> dropdownvalues = new List <string>();
                // dropdownvalues.Add(selectValue);
                foreach (IControl control in dropdowncontrollist)
                {
                    string dropdownvalue = Control_PropertyUtilities.GetText(control);
                    dropdownvalues.Add(dropdownvalue);
                }
                bool comparison = DL_Lab_MRR_Table.AreListsEqual(dropdown, dropdownvalues);
                return(comparison);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
 public static bool FormQuestion(IEnumerable <FormQuestion> Questions)
 {
     try
     {
         IControl QuestionsTable = DS_Forms.QuestionsTable;
         foreach (FormQuestion question in Questions)
         {
             WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList();
             searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, question.Question, TableColumnContentType.Link));
             IControl row = WebTableUtilities.Table_FindRow(QuestionsTable, searchList, 2);
             if (!Control_PropertyUtilities.IsControlNull(row))
             {
                 Control_ActionUtilities.Click(row, "Question not visible");
                 string domainItem = Control_PropertyUtilities.GetText(DS_Forms.LabMappingFormItemName);
                 if (!domainItem.Equals(question.DomainItem))
                 {
                     return(false);
                 }
             }
         }
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool DeleteGroup(String groupName)
 {
     try
     {
         IControl groupsTable = DL_DeleteGroupsPage.GroupsTable;
         WebTable_SearchCriteriaItem     searchCreteriaItem = new WebTable_SearchCriteriaItem(0, groupName, TableColumnContentType.CheckboxAndText);
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(searchCreteriaItem);
         IControl tableRow = WebTableUtilities.Table_FindRow(groupsTable, list);
         if (tableRow != null)
         {
             IControl checkbox = WebTableUtilities.GetElement(tableRow, String.Empty, 0, TableColumnContentType.CheckboxAndText);
             Control_ActionUtilities.Click(checkbox, String.Empty);
             return(Control_ActionUtilities.Click_PerssEnterKey(DL_DeleteGroupsPage.DeleteButton, String.Empty));
         }
         else
         {
             return(Control_ActionUtilities.Click_PerssEnterKey(DL_DeleteGroupsPage.CancelButton, String.Empty));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool AddCommentsToAFlatQuestion(string QuestionPrompt, string Comments)
 {
     try
     {
         if (SelectAddCommentElementForFlatQuestion(QuestionPrompt))
         {
             BrowserUtilities.SwitchToFrame();
             string QuestText = Control_PropertyUtilities.GetText(DL_CRFPage.GetQuestionOnAddCommentModal);
             if (!QuestText.Contains(QuestionPrompt))
             {
                 Control_ActionUtilities.LogException("Verify question prompt on add comments modal.", "Question is not displayed correctly", string.Empty);
                 return(false);
             }
             IControl CommentsTextBox = DL_CRFPage.GetTextAreaOnAddCommentModal;
             Control_ActionUtilities.Textbox_SetText(CommentsTextBox, Comments, "Unable to set comments for the question " + QuestionPrompt);
             IControl SaveButton = DL_CRFPage.GetButtonOnAddCommentModal("Save");
             Control_ActionUtilities.ClickModalButton(SaveButton);
             BrowserUtilities.SwitchToWindow();
             return(true);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
예제 #17
0
        public static bool FillEnrollPatientCRF(EnrollPatientData Data)
        {
            bool isDataFilled = true;

            if (Data.EnrollID != string.Empty)
            {
                if (!BP_CRFUtilities.SetValueInTextBox_FlatQuestion("Enroll ID:", Data.EnrollID))
                {
                    isDataFilled = false;
                }
            }

            if (!BP_CRFUtilities.SetValueInTextBox_FlatQuestion("Enrolled Date:", Data.EnrollDate))
            {
                isDataFilled = false;
            }
            if (Data.EntryComplete == "Yes")
            {
                if (!Control_ActionUtilities.Click(DL_CRFPage.EntryCompleteChkBox, "Unable to select Entry Complete checkbox."))
                {
                    isDataFilled = false;
                }
            }
            return(isDataFilled);
        }
 public static bool GetTableRowData(List <ImportLabDictErrorData> errorData)
 {
     BrowserUtilities.DS_SwitchToFrame();
     try
     {
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         foreach (ImportLabDictErrorData data in errorData)
         {
             list.AddSearchItem(new WebTable_SearchCriteriaItem(0, data.WorkSheet, TableColumnContentType.Text));
             list.AddSearchItem(new WebTable_SearchCriteriaItem(1, data.Row, TableColumnContentType.Text));
             list.AddSearchItem(new WebTable_SearchCriteriaItem(2, data.Column, TableColumnContentType.Text));
             list.AddSearchItem(new WebTable_SearchCriteriaItem(3, data.Error, TableColumnContentType.Text));
             IControl processRow = WebTableUtilities.Table_FindRow(ImportLabDictionaryPage.ImportLabDictErrorTable, list);
             if (!Control_PropertyUtilities.IsControlNull(processRow))
             {
                 Control_ActionUtilities.Click(ImportLabDictionaryPage.ImportLabDictErrorTableOkButton, String.Empty);
                 BrowserUtilities.SwitchToWindow();
                 return(true);
             }
         }
         Control_ActionUtilities.Click(ImportLabDictionaryPage.ImportLabDictErrorTableOkButton, String.Empty);
         BrowserUtilities.SwitchToWindow();
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool SelectScriptingCheckboxToRun(String scriptingType)
 {
     try
     {
         if (!String.IsNullOrEmpty(scriptingType))
         {
             if (scriptingType.Equals("pScripts", StringComparison.InvariantCultureIgnoreCase))
             {
                 return(Control_ActionUtilities.Click(DL_PublishStudyPage_MinorStudyUpdate.pScriptCheckbox, String.Empty));
             }
             else if (scriptingType.Equals("Derivations", StringComparison.InvariantCultureIgnoreCase))
             {
                 return(Control_ActionUtilities.Click(DL_PublishStudyPage_MinorStudyUpdate.DerivationsCheckbox, String.Empty));
             }
             else if (scriptingType.Equals("Queries", StringComparison.InvariantCultureIgnoreCase))
             {
                 return(Control_ActionUtilities.Click(DL_PublishStudyPage_MinorStudyUpdate.QueriesCheckbox, String.Empty));
             }
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool ClickButtonOnDefinePatientIdentifiersPage(string ButtonName)
 {
     try
     {
         IControl Button;
         if (ButtonName.ToUpper() == "SAVE")
         {
             Button = DL_DefinePatientIdentifiers.SaveButton;
         }
         else if (ButtonName.ToUpper() == "SAVE & NEXT")
         {
             Button = DL_DefinePatientIdentifiers.SaveAndNextButton;
         }
         else
         {
             Button = DL_DefinePatientIdentifiers.CancelButton;
         }
         return(Control_ActionUtilities.Click(Button, "Unable to click '" + ButtonName + "' on General Configurations page."));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
        public static bool ClickRadioButton(String radioName)
        {
            try
            {
                switch (radioName.ToUpper().ToString())
                {
                case "YES":
                    Control_ActionUtilities.ClickModalButton(wf_Page_Frame.radio_Yes);
                    break;

                case "NO":
                    Control_ActionUtilities.ClickModalButton(wf_Page_Frame.radio_No);
                    break;

                case "HTML":
                    Control_ActionUtilities.ClickModalButton(wf_Page_Frame.radio_HTML);
                    break;

                case "EXCEL":
                    Control_ActionUtilities.ClickModalButton(wf_Page_Frame.radio_Excel);
                    break;
                //need to add few more radio controls based on forms

                case "Default":
                    return(false);
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }

            return(true);
        }
        public static bool SelectDefaultAsYesForQuestions(List <DefinePatientIdentifiers> QuestionsData, out List <string> FailedQuestions)
        {
            FailedQuestions = new List <string>();
            bool isSuccess = true;

            try
            {
                foreach (DefinePatientIdentifiers DataItem in QuestionsData)
                {
                    IControl DefaultDropdown = DL_DefinePatientIdentifiers.DefaultDropdownForQuestionInCRF(DataItem.QuestionPrompt);
                    if (Control_PropertyUtilities.IsControlNull(DefaultDropdown))
                    {
                        isSuccess = false;
                    }
                    if (!Control_ActionUtilities.Dropdown_SelectItem(DefaultDropdown, "Yes", "Unable to select Yes in Default dropdown for question prompt '" + DataItem.QuestionPrompt + "'."))
                    {
                        FailedQuestions.Add(DataItem.QuestionPrompt);
                        isSuccess = false;
                    }
                }
                return(isSuccess);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, 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 SelectEventOnPatientIdentifiersPageAndWait(string EventToSelect)
 {
     try
     {
         IControl EventField = DL_DefinePatientIdentifiers.EventSelectionDropdown;
         if (!Control_ActionUtilities.Dropdown_SelectItem(EventField, EventToSelect, "Unable to select " + EventToSelect + " from Event dropdown."))
         {
             return(false);
         }
         IControl FormsLoadSection = DL_DefinePatientIdentifiers.FormsLoaded;
         if (FormsLoadSection != null && FormsLoadSection.WebElement != null)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
        public static bool VerifyTestCaseDropDownValues(List <DropDownInfo> dropdownInfoList)
        {
            try
            {
                List <string> dropdown = new List <string>();
                foreach (DropDownInfo dropdownInfo in dropdownInfoList)
                {
                    dropdown.Add(dropdownInfo.Dropdown);
                }

                IControl dropdowncontrol = ScriptingPage.DropDownOptions;

                Control_ActionUtilities.Click(dropdowncontrol, "Not able to click on dropdowncontrol");
                IControl selectValueInDropdown = ScriptingPage.DropDownOptions;

                string        selectValue    = Control_PropertyUtilities.GetText(selectValueInDropdown);
                bool          found          = false;
                List <String> dropdownvalues = Control_ActionUtilities.Dropdown_GetItems(dropdowncontrol, out found);
                if (found)
                {
                    bool comparison = DL_Lab_MRR_Table.AreListsEqual(dropdown, dropdownvalues);
                }
                return(true);
            }

            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
        public static bool ApplyFilterWithInvalidData(string columnName, string columnData, string filterCriteria)
        {
            try
            {
                IControl filterTextbox = WebTableUtilities.GetFilterTextbox(DL_Lab_ManageReferenceRanges.LabsGridFilterRow, GetColumnIndex(columnName));
                Control_ActionUtilities.Textbox_SetText(filterTextbox, columnData, String.Empty);

                IControl filterCriteriaIcon = WebTableUtilities.GetFilterCriteriaIcon(DL_Lab_ManageReferenceRanges.LabsGridFilterRow, GetColumnIndex(columnName));
                Control_ActionUtilities.Click(filterCriteriaIcon, String.Empty);

                IControl filterCriteriaItem = DL_CommonObjects.GetActiveFilterItem(filterCriteria);
                Control_ActionUtilities.Click(filterCriteriaItem, String.Empty);

                IControl filterTextbox1 = WebTableUtilities.GetFilterTextbox(DL_Lab_ManageReferenceRanges.LabsGridFilterRow, GetColumnIndex(columnName));
                Control_ActionUtilities.Textbox_SetText(filterTextbox1, columnData, String.Empty);

                IControl filterCriteriaIcon1 = WebTableUtilities.GetFilterCriteriaIcon(DL_Lab_ManageReferenceRanges.LabsGridFilterRow, GetColumnIndex(columnName));
                Control_ActionUtilities.Click(filterCriteriaIcon1, String.Empty);

                IControl filterCriteriaItem1 = DL_CommonObjects.GetActiveFilterItem(filterCriteria);
                Control_ActionUtilities.Click(filterCriteriaItem1, String.Empty);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
                return(false);
            }
            return(true);
        }
        public static bool SelectFreezeThawButton(String buttonName)
        {
            try
            {
                switch (buttonName.ToUpper())
                {
                case "FREEZE":
                    return(Control_ActionUtilities.Click(DL_FreezeThawCRFs.freezeButton, "Unable to Select the Freeze button"));

                case "THAW":
                    return(Control_ActionUtilities.Click(DL_FreezeThawCRFs.thawButton, "Unable to Select the Thaw button"));

                case "CANCEL":
                    return(Control_ActionUtilities.Click(DL_FreezeThawCRFs.cancelButton, "Unable to Select the Cancel button"));

                case "SELECT ALL":
                    return(Control_ActionUtilities.Click(DL_FreezeThawCRFs.selectAllButton, "Unable to Select the Select All button"));

                case "CLEAR ALL":
                    return(Control_ActionUtilities.Click(DL_FreezeThawCRFs.selectAllButton, "Unable to Select the Clear All button"));
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
 public static bool OpenLab(ManageReferenceLabGridRowData labGridRowData)
 {
     try
     {
         WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
         list.AddSearchItem(new WebTable_SearchCriteriaItem(0, labGridRowData.labId, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(1, labGridRowData.laboratoryName, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(2, labGridRowData.Company, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(3, labGridRowData.Department, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(4, labGridRowData.Address, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(5, labGridRowData.City, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(6, labGridRowData.State, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(7, labGridRowData.Country, TableColumnContentType.Text));
         list.AddSearchItem(new WebTable_SearchCriteriaItem(8, labGridRowData.Lab_Status, TableColumnContentType.Text));
         IControl labRow = WebTableUtilities.Table_FindRow(DL_Lab_ManageReferenceRanges.LabsTable, list);
         if (labRow != null)
         {
             IControl labIdLink = WebTableUtilities.GetElement(labRow, labGridRowData.labId, 0, TableColumnContentType.Link);
             return(Control_ActionUtilities.Click(labIdLink, String.Empty));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 public static bool IsStudyAvailable(IEnumerable <StudyData> studies)
 {
     try
     {
         IControl StudiesTable = DS_HomePage.StudiesTable;
         foreach (StudyData study in studies)
         {
             WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList();
             searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, study.StudyName, TableColumnContentType.Link));
             IControl row = WebTableUtilities.Table_FindRow(StudiesTable, searchList, 0);
             if (Control_PropertyUtilities.IsControlNull(row))
             {
                 return(false);
             }
             IControl cell = WebTableUtilities.GetCell(row, 1);
             IControl link = WebTableUtilities.GetLink(cell);
             Control_ActionUtilities.Click(link, "linknotfound");
         }
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
        public static bool DeleteTheRecordUsingDeleteIcon(string refID, string action)
        {
            try
            {
                DL_Lab_MRR_Table.NavigateToFirstPage(DL_Lab_MRR_Table.Pager);
                do
                {
                    WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList();
                    searchList.AddSearchItem(new WebTable_SearchCriteriaItem(1, refID, TableColumnContentType.Text));
                    IControl row = WebTableUtilities.Table_FindRow(DL_Lab_MRR_Table.MrrTable, searchList, 0);
                    if (!Control_PropertyUtilities.IsControlNull(row))
                    {
                        IControl actionsCell = WebTableUtilities.GetCell(row, 13);
                        IControl icon        = DL_Lab_MRR_Table.GetActionIcon(actionsCell, action);
                        return(Control_ActionUtilities.Click(icon, String.Empty));
                    }
                }while (DL_Lab_MRR_Table.NavigateToNextPage(DL_Lab_MRR_Table.Pager));
            }

            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }