public static bool UploadStudy(String studyFileName, String label)
        {
            try
            {
                //string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

                String startupPath   = AppDomain.CurrentDomain.BaseDirectory;
                String studiesFolder = String.Empty;
                if (startupPath.EndsWith("\\"))
                {
                    studiesFolder = startupPath.Replace("EDC_Automation\\bin\\Debug\\", "BusinessProcesses\\DataLabs\\Study Files\\");
                }
                else
                {
                    studiesFolder = startupPath.Replace("EDC_Automation\\bin\\Debug", "BusinessProcesses\\DataLabs\\Study Files\\");
                }

                Thread.Sleep(2000);
                //studyFileName = studyFileName.Replace(@"\", @"\\");
                String fullFolderPath = studiesFolder + studyFileName;
                SendKeys.SendWait(fullFolderPath);
                Thread.Sleep(1000);
                SendKeys.SendWait(@"{Enter}");
                Thread.Sleep(1000);

                Control_ActionUtilities.Textbox_SetText(DL_UploadStudyFilePage.StudyLabelTextbox, label, String.Empty);
                Control_ActionUtilities.ClickModalButton(DL_UploadStudyFilePage.UploadButton);
                return(true);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
                return(false);
            }
        }
 public static bool IsStudyAvailableinHomePage(IEnumerable <StudyData> studies)
 {
     try
     {
         bool     isClicked           = false;
         String   notificationMessage = "Study has been successfully deleted";
         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(DS_HomePage.StudiesTable, searchList, 0);
             if (!Control_PropertyUtilities.IsControlNull(row))
             {
                 IControl cell = WebTableUtilities.GetCell(row, 9);
                 if ((Control_ActionUtilities.MouseClick(cell, String.Empty)))
                 {
                     if (Control_ActionUtilities.ClickModalButton(DS_ConfirmationPopup.DeleteJobsContinue))
                     {
                         isClicked = DS_BP_NotificationUtilities.VerifyNotificationForDict(notificationMessage);
                     }
                 }
             }
         }
         return(isClicked);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
예제 #3
0
 public void WhenISelectTheViewButton()
 {
     if (!Control_ActionUtilities.ClickModalButton(wf_Page_Frame.view_button))
     {
         ScenarioContext.Current["ActResult"] = "Failed";
     }
 }
        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 SetStatus(String status, String statusType)
        {
            bool retVal = false;

            try
            {
                BrowserUtilities.SwitchToFrame();
                if (statusType.Equals("Patient Status", StringComparison.InvariantCultureIgnoreCase))
                {
                    retVal = Control_ActionUtilities.ClickModalButton(DL_AdvancedSearchWindow.GetPatientStatusCheckbox(status));
                }
                else if (statusType.Equals("Data Stauts", StringComparison.InvariantCultureIgnoreCase))
                {
                    retVal = Control_ActionUtilities.ClickModalButton(DL_AdvancedSearchWindow.GetDataStatusCheckbox(status));
                }
                else if (statusType.Equals("Signature Status", StringComparison.InvariantCultureIgnoreCase))
                {
                    retVal = Control_ActionUtilities.ClickModalButton(DL_AdvancedSearchWindow.GetSignatureStatusCheckbox(status));
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
 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);
 }
예제 #7
0
        public static bool ClickOk(String titleText, String bodyMessageText)
        {
            BrowserUtilities.SwitchToFrame();
            bool isClicked = false;

            if (IsModalExist_VerifyHeaderTextAndBodyMessage(titleText, bodyMessageText))
            {
                isClicked = Control_ActionUtilities.ClickModalButton(DL_ModalWindow.ContinueButton);
            }
            BrowserUtilities.SwitchToWindow();
            return(isClicked);
        }
예제 #8
0
        public static bool ClickContinue(String bodyMessageText_Partial)
        {
            BrowserUtilities.SwitchToFrame();
            bool isClicked = false;

            if (BP_ModalWindow.IsModalExist_CheckBodyMessage(bodyMessageText_Partial))
            {
                isClicked = Control_ActionUtilities.ClickModalButton(DL_ModalWindow_ResetSession.ContinueButton);
            }
            BrowserUtilities.SwitchToWindow();
            return(isClicked);
        }
        public static bool VerifyStudyContinue(String titleText, String bodyMessageText_Partial)
        {
            BrowserUtilities.DS_SwitchToConfirmationFrame();
            bool isClicked = false;

            if (IsModalExist_CheckHeaderTextAndBodyMessage(titleText, bodyMessageText_Partial))
            {
                isClicked = Control_ActionUtilities.ClickModalButton(VerifyStudyPopup.VerifyContinue);
            }
            BrowserUtilities.SwitchToWindow();
            return(isClicked);
        }
        public static bool ClickYes(String titleText, String bodyMessageText_Partial)
        {
            BrowserUtilities.DS_SwitchToFrame();
            bool isClicked = false;

            if (IsModalExist_CheckHeaderTextAndBodyMessage(titleText, bodyMessageText_Partial))
            {
                isClicked = Control_ActionUtilities.ClickModalButton(CodeListsItemDeleteDialog.ClickYesButton);
            }
            BrowserUtilities.SwitchToWindow();
            return(isClicked);
        }
예제 #11
0
 public static bool ClickContinueButton()
 {
     try
     {
         BrowserUtilities.DS_SwitchToFrame();
         Control_ActionUtilities.ClickModalButton(ManageLabsPage.LabDictContinue);
         BrowserUtilities.SwitchToWindow();
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
예제 #12
0
 public static bool ChangingLabDictPopupOkButton()
 {
     try
     {
         BrowserUtilities.DS_SwitchToConfirmationFrame();
         Control_ActionUtilities.ClickModalButton(DS_ModelDialog.ChangingLabDictOkButton);
         BrowserUtilities.SwitchToWindow();
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
 static bool Click(String titleText, IControl button)
 {
     try
     {
         if (BP_ModalWindow.IsModalExist_CheckHeaderText(titleText))
         {
             return(Control_ActionUtilities.ClickModalButton(button));
         }
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
예제 #14
0
        public static bool ClickCancel()
        {
            BrowserUtilities.SwitchToFrame();
            bool retVal = false;

            try
            {
                retVal = Control_ActionUtilities.ClickModalButton(DL_ModalWindow_ManualDCF.CancelButton);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
        public static bool ClickSearchButton()
        {
            bool retVal = false;

            BrowserUtilities.SwitchToFrame();
            try
            {
                retVal = Control_ActionUtilities.ClickModalButton(DL_AdvancedSearchWindow.SearchButton);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
        public static bool ClickCloseButton()
        {
            bool retVal = false;

            Utilities.BrowserUtilities.SwitchToFrame();
            try
            {
                retVal = Control_ActionUtilities.ClickModalButton(DL_ModalWindow_ItemChangeHistory.CloseButton);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            Utilities.BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
 public static bool ClickContinue(String titleText, String bodyMessageText_Partial)
 {
     try
     {
         if (IsModalExist_CheckHeaderTextAndBodyMessage(titleText, bodyMessageText_Partial))
         {
             BrowserUtilities.DS_SwitchToConfirmationFrame();
             //check message
             Control_ActionUtilities.ClickModalButton(DS_ConfirmationPopup.Continue);
             return(BrowserUtilities.SwitchToWindow());
         }
     }
     catch (Exception e)
     {
     }
     return(false);
 }
예제 #18
0
        public static bool ModelDialog_OkButton()
        {
            BrowserUtilities.DS_SwitchToConfirmationFrame();
            bool isClicked = false;

            try
            {
                isClicked = Control_ActionUtilities.ClickModalButton(DS_ModelDialog.SavePopupErrorOkButton);
                BrowserUtilities.SwitchToWindow();
                return(isClicked);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
 public static bool LoginInExistingPage(String userName, String password)
 {
     try
     {
         Control_ActionUtilities.Textbox_SetText(DL_LoginPage.UserNameTextbox, userName, "Unable to set user name in LoginPage");
         Control_ActionUtilities.Textbox_SetText(DL_LoginPage.PasswordTextbox, password, "Unable to set password in LoginPage");
         Control_ActionUtilities.Click_PerssEnterKey(DL_LoginPage.LoginButton, "Unable to click login button in LoginPage");
         BrowserUtilities.SwitchToFrame();
         Control_ActionUtilities.ClickModalButton(DL_ActivityLogWindow.CloseButton);
         BrowserUtilities.SwitchToWindow();
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
         return(false);
     }
     return(true);
 }
예제 #20
0
        public static bool ClickYesButton(String title)
        {
            BrowserUtilities.SwitchToFrame();
            bool isClicked = false;

            try
            {
                if (IsModalExist_CheckHeaderText(title))
                {
                    isClicked = Control_ActionUtilities.ClickModalButton(DL_ModalWindow.YesButton);
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
                isClicked = false;
            }
            BrowserUtilities.SwitchToWindow();
            return(isClicked);
        }
예제 #21
0
        public static bool ClickSaveButton()
        {
            bool retVal = false;

            BrowserUtilities.SwitchToFrame();
            try
            {
                IControl titleLabel = DL_ModalWindow_AddComment.TitleLabel;
                if (Control_PropertyUtilities.GetText(titleLabel).Equals("Add Comment", StringComparison.InvariantCultureIgnoreCase))
                {
                    retVal = Control_ActionUtilities.ClickModalButton(DL_ModalWindow_AddComment.SaveButton);
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
예제 #22
0
        public static bool PerformTheAction(string button)
        {
            bool retVal = false;

            Utilities.BrowserUtilities.SwitchToFrame();
            try
            {
                if (button.Equals("Close"))
                {
                    retVal = Control_ActionUtilities.ClickModalButton(DL_Lab_Mrr_AuditHistory.CloseButtonInChangeHistoryWindow);
                }
                else if (button.Equals("Print"))
                {
                    retVal = Control_ActionUtilities.ClickModalButton(DL_Lab_Mrr_AuditHistory.PrintButtonInChangeHistoryWindow);
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            Utilities.BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
예제 #23
0
        public static bool ClickContinueButton()
        {
            bool retVal = false;

            BrowserUtilities.SwitchToFrame();
            try
            {
                IControl modalHeaderLabel = DL_ModalWindow_ResetCRF.TitleLabel_Step2;
                if (!Control_PropertyUtilities.IsControlNull(modalHeaderLabel))
                {
                    String headerText = Control_PropertyUtilities.GetText(modalHeaderLabel);
                    if (headerText.Equals("Reset Form", StringComparison.InvariantCultureIgnoreCase))
                    {
                        retVal = Control_ActionUtilities.ClickModalButton(DL_ModalWindow_ResetCRF.ContinueButton);
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
 public static bool ClickUploadButton()
 {
     return(Control_ActionUtilities.ClickModalButton(DL_UploadStudyFilePage.UploadButton));
 }