public static bool AreSitesAvailable(IEnumerable <String> sites)
        {
            bool retval = false;

            try
            {
                BrowserUtilities.SwitchToFrame();
                List <String> siteList = (List <String>)sites;
                foreach (String site in siteList)
                {
                    WebTable_SearchCriteriaItemList searchList = new WebTable_SearchCriteriaItemList();
                    searchList.AddSearchItem(new WebTable_SearchCriteriaItem(0, site, TableColumnContentType.CheckboxAndText));
                    IControl row = WebTableUtilities.Table_FindRow(DL_AdvancedSearchWindow.SitesTable, searchList, 1);
                    if (Control_PropertyUtilities.IsControlNull(row))
                    {
                        retval = false;
                    }
                }
                retval = true;
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            BrowserUtilities.SwitchToWindow();
            return(retval);
        }
 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 GetTableRowDataForImportLabDictionaryErrors(List <ImportLabDictErrorData> errorData)
        {
            BrowserUtilities.DS_SwitchToFrame();
            try
            {
                foreach (ImportLabDictErrorData data in errorData)

                {
                    WebTable_SearchCriteriaItemList list = new WebTable_SearchCriteriaItemList();
                    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));
                    if (list.List.Count > 0)
                    {
                        IControl tableRow = WebTableUtilities.Table_FindRow(ImportLabDictionaryPage.ErrorTable, list);
                        if (Control_PropertyUtilities.IsControlNull(tableRow))
                        {
                            Utilities.BrowserUtilities.SwitchToWindow();
                            return(false);
                        }
                    }
                }
                BrowserUtilities.SwitchToWindow();
                return(true);
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(false);
        }
Exemple #4
0
        public static bool VerifyDCF(CRF_DCFTabData data)
        {
            bool retVal = false;
            int  i      = 0;

            try
            {
                while (retVal || i < 120)
                {
                    ++i;
                    IControl row = GetRowFromActiveDCFsSubTab(data);
                    retVal = !Control_PropertyUtilities.IsControlNull(row);
                    Thread.Sleep(1000);
                    if (!retVal)
                    {
                        BrowserUtilities.RefreshPage();
                        BP_FormUtilities.OpenMainTabInForm("DCFs");
                        OpenSubTabUnderDCFTab("All");
                    }
                    else
                    {
                        return(retVal);
                    }
                }
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            return(retVal);
        }
        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 VerifyJobStatus(String process, String expectedStatus)
        {
            int  i     = 0;
            bool found = false;

            try
            {
                while (i < 60 && !found)
                {
                    BrowserUtilities.RefreshPage();
                    IControl cell = GetStatusCell(process, expectedStatus);

                    if (!Control_PropertyUtilities.IsControlNull(cell))
                    {
                        String actualText = Control_PropertyUtilities.GetText(cell);
                        found = actualText.Equals(expectedStatus, StringComparison.InvariantCultureIgnoreCase);
                    }
                    Thread.Sleep(5000);
                    ++i;
                }
            }
            catch (Exception e)
            {
            }
            return(found);
        }
Exemple #7
0
 public static bool EnterReason(String reason)
 {
     try
     {
         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.Textbox_SetText(DL_ModalWindow_ResetCRF.ReasonTextArea, reason, String.Empty);
                 }
             }
         }
         catch (Exception e)
         {
             new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
         }
         BrowserUtilities.SwitchToWindow();
         return(retVal);
     }
     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);
 }
 public void WhenIRefreshThePage()
 {
     if (!BrowserUtilities.RefreshPage())
     {
         ScenarioContext.Current["ActResult"] = "Failed";
     }
 }
Exemple #10
0
        public static bool VerifyLabInfo(LabData data)
        {
            BrowserUtilities.SwitchToFrame();
            bool retVal = false;

            try
            {
                retVal = !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Lab ID: " + data.LabId)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Laboratory Name: " + data.LaboratoryName)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Company: " + data.Company)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Department: " + data.Department)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Address 1: " + data.Address1)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Address 2: " + data.Address2)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Address 3: " + data.Address3)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("City/Town: " + data.City)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("State/Province: " + data.State)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Zip/Postal Code: " + data.Zip)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("ISO Country: " + data.ISOCountry)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Country: " + data.Country)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Phone: " + data.Phone)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Fax: " + data.Fax)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Lab Status: " + data.LaboratoryStatus)) &&
                         !Control_PropertyUtilities.IsControlNull(DL_ModalWindow_LabInformation.GetDataCell("Contact Person: " + data.ContactPerson));
            }
            catch (Exception e)
            {
                new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
            }
            BrowserUtilities.SwitchToWindow();
            return(retVal);
        }
Exemple #11
0
        public void TestMethod8()
        {
            var         Driver         = new BrowserUtilities().Init(driver);
            IWebElement emailTextField = Driver.FindElement(By.XPath(".//*[@id='email']"));

            emailTextField.SendKeys("OpenSeleniumC#");
            Driver.Close();
        }
Exemple #12
0
 public void ThenIDoNotSeeTheTab(string TabName)
 {
     BrowserUtilities.RefreshPage();
     if (!DS_BP_StudyProperties.VerifytabNotPresent(TabName))
     {
         ScenarioContext.Current["ActResult"] = "Failed";
     }
 }
Exemple #13
0
 public static bool VerifyHeaderAndErrorMessage(String titleText, String bodyMessageText_Partial)
 {
     BrowserUtilities.DS_SwitchToConfirmationFrame();
     if (IsModalExist_CheckHeaderAndErrorMessage(titleText, bodyMessageText_Partial))
     {
         return(true);
     }
     BrowserUtilities.SwitchToWindow();
     return(false);
 }
        public static bool ValidateFrameHeaderText(String ExpectedText)
        {
            BrowserUtilities.SwitchToWebFocusFrame();
            String actualText = ReadFrameHeaderText(wf_Page_Frame.frameHeader);

            if (!actualText.ToUpper().Equals(ExpectedText.ToUpper()))
            {
                return(false);
            }
            BrowserUtilities.SwitchToWindow();
            return(true);
        }
        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 VerifyandClickErrorLink(String popupTitle, String errorMessage, String errorLinkName)
        {
            BrowserUtilities.DS_SwitchToConfirmationFrame();
            bool isClicked = false;

            if (IsModalExist_CheckHeaderTextAndErrorLinkMessage(popupTitle, errorMessage))
            {
                isClicked = Control_ActionUtilities.Click_PerssEnterKey(DS_HomePage.GetLink(errorLinkName), "Unable to find link " + errorLinkName + " in Designer Home Page");
            }
            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);
        }
Exemple #18
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);
        }
Exemple #19
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);
        }
Exemple #20
0
        public static bool DeleteJobsContinue(String titleText, String bodyMessageText_Partial)
        {
            BrowserUtilities.DS_SwitchToConfirmationFrame();
            bool isClicked = false;

            //if (DeleteJobsModalExist_CheckHeaderTextAndBodyMessage(titleText, bodyMessageText_Partial))
            //{
            //    isClicked = Control_ActionUtilities.ClickModalButton(DS_ConfirmationPopup.DeleteJobsContinue);
            //}
            BrowserUtilities.SwitchToWindow();
            return(isClicked);
        }
 public static bool ClickCompareStudyButton()
 {
     BrowserUtilities.DS_SwitchToConfirmationFrame();
     try
     {
         return(Control_ActionUtilities.Click(CompareStudyPopup.CompareButton, String.Empty));
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     BrowserUtilities.DS_SwitchToConfirmationFrame();
     return(true);
 }
 public static bool StudyPublishContinueButton()
 {
     try
     {
         BrowserUtilities.DS_SwitchToFrame();
         bool isClicked = Control_ActionUtilities.Click(DS_LabMappingsSpecificationDialog.StudyPublishContinue, String.Empty);
         BrowserUtilities.SwitchToWindow();
         return(isClicked);
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 public static bool ClickError(String error)
 {
     BrowserUtilities.DS_SwitchToFrame();
     try
     {
         IControl errorLink = DS_StudyVerificationMessagesDialog.GetErrorLink(error);
         Control_ActionUtilities.Click(errorLink, "Unable to click error " + error);
         BrowserUtilities.SwitchToWindow();
         return(true);
     }
     catch (Exception e)
     {
     }
     return(false);
 }
 public static bool ClickOnFilter()
 {
     BrowserUtilities.DS_SwitchToFrame();
     try
     {
         ImportLabDictionaryPage.FilterOption.WebElement.Click();
         BrowserUtilities.SwitchToWindow();
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
Exemple #25
0
 public static bool SaveButton()
 {
     BrowserUtilities.DS_SwitchToFrame();
     try
     {
         Control_ActionUtilities.Click(CodeListsGroupPage.SaveButton, String.Empty);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
         return(false);
     }
     BrowserUtilities.SwitchToWindow();
     return(true);
 }
Exemple #26
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);
 }
Exemple #27
0
 public static bool StudyPublishLabel(String studyLabel)
 {
     try
     {
         BrowserUtilities.DS_SwitchToFrame();
         Control_ActionUtilities.Textbox_SetText(MapLabDictionary.StudyPublishLabel, studyLabel, String.Empty);
         BrowserUtilities.SwitchToWindow();
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
         return(false);
     }
 }
Exemple #28
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);
 }
 public static bool ClickStudyLink(String linkName)
 {
     BrowserUtilities.DS_SwitchToFrame();
     try
     {
         Control_ActionUtilities.Click_PerssEnterKey(DS_HomePage.GetLink(linkName), "Unable to find link " + linkName + " in Designer Home Page");
         BrowserUtilities.SwitchToWindow();
         return(true);
     }
     catch (Exception e)
     {
         new DebugLogGenerator().WriteException(MethodBase.GetCurrentMethod().DeclaringType.Name, MethodBase.GetCurrentMethod().Name, e);
     }
     return(false);
 }
Exemple #30
0
        static void Main(string[] args)
        {
            //AllTogether.PrintBrowserTabName();

            //BrowserTabs.BrowserTabs bt = new BrowserTabs.BrowserTabs();
            // BrowserTabs_v1.otro();
            //BrowserTabsFirefox btv1 = new BrowserTabsFirefox();

            //BrowserTabsChrome btv1 = new BrowserTabsChrome();

            var res  = BrowserUtilities.ListTabs(BrowserProcessName.GoogleChrome);
            var res2 = BrowserUtilities.ListTabs(BrowserProcessName.Firefox);

            Console.Read();
        }