public void SpecifyResearchTypes(params TypeOfResearch[] researchTypes)
        {
            string name = "";
            foreach (var type in researchTypes)
            {
                switch (type)
                {
                    case TypeOfResearch.BiomedicalClinical:
                    {
                        name = "Biomedical";
                        break;
                    }
                    case TypeOfResearch.SocialBehavioralEducation:
                    {
                        name = "Social";
                        break;
                    }
                    case TypeOfResearch.Other:
                    {
                        name = "Other";
                        break;
                    }
                }
                var chkbox = new Checkbox(By.XPath(".//td[contains(.,'" + name + "')]/../td/table/tbody/tr/td/input[1]"));
                chkbox.Click();
                Trace.WriteLine("Checking option: " + type);

            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="option"></param>
 public void SelectDetermination(Determinations value)
 {
     string name = "";
     switch (value)
     {
         case Determinations.UnanticipatedProblem: { name = "Unanticipated problem involving risks to subjects or others"; break; }
         case Determinations.SuspensionOrTermination: { name = "Suspension or termination of IRB approval"; break; }
         case Determinations.SeriousNonCompliance: { name = "Serious non-compliance"; break; }
         case Determinations.ContinuingNonCompliance: { name = "Continuing non-compliance"; break; }
         case Determinations.NonComplianceNotSerious: { name = "Non-compliance that is neither serious nor continuing"; break; }
         case Determinations.AllegationOfNonCompliance: { name = "Allegation of non-compliance with no basis in fact"; break; }
         case Determinations.NoneOfTheAbove: { name = "None of the above"; break; }
         case Determinations.AdditionalReviewRequired: { name = "Additional review required"; break; }
     }
     var chkbox = new Checkbox(By.XPath(".//td[text()='" + name + "']/../td/table/tbody/tr/td/input[1]"));
     chkbox.Click();
     Trace.WriteLine("Checking option: " + value);
 }
        public void SelectRoles(params Roles[] roles)
        {
            string name = "";

            foreach (var role in roles)
            {
                switch (role)
                {
                    case Roles.CoInvestigator:
                    {
                        name = "Co-investigator";
                        break;
                    }
                    case Roles.DataAnalyst:
                    {
                        name = "Data Analyst";
                        break;
                    }
                    case Roles.ResearchAssistant:
                    {
                        name = "Research Assistant";
                        break;
                    }
                    case Roles.Statistician:
                    {
                        name = "Statistician";
                        break;
                    }
                    case Roles.LayObserver:
                    {
                        name = "Lay Observer";
                        break;
                    }
                }
                var chkbox = new Checkbox(By.XPath(".//td[contains(.,'" + name + "')]/../td/table/tbody/tr/td/input[1]"));
                chkbox.Click();
                Trace.WriteLine("Checking option: " + role);
            }
        }
 public void DeleteBackgroundOperation(String name)
 {
     var checkbox = new Checkbox(By.XPath("//a[text()='" + name + "']/../../td[1]/input"));
     checkbox.Click();
     BtnDelete.Click();
 }
 public void CopyBranching(String sourceStepName, string targetStepName, String copyType = "all", Boolean eraseAll = false)
 {
     var btnAddBranch = new Button(
         By.XPath("(//*[@id='_webrRSV_DIV_0']/table/tbody/tr/td[3]/a[text()='" + sourceStepName +
                  "'])[1]/../../td[6]/input[@value='Copy Branches']"));
     btnAddBranch.Click();
     var popup = new CopyBranchesPopup();
     popup.SwitchTo();
     var chkTarget = new Checkbox(By.XPath("//span[text()='" + targetStepName + "']/../../td[1]/input[@type='checkbox']"));
     chkTarget.Click();
     var rdoCopyType = copyType == "smart" ? popup.RdoSmartCopy : popup.RdoAllBranches;
     rdoCopyType.Click();
     popup.ChkEraseExisting.Checked = eraseAll;
     popup.BtnOk.Click();
     popup.SwitchBackToParent(WaitForPopupToClose.Yes);
     Thread.Sleep(1500);
     WaitForPageLoad(5000);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="option"></param>
 public void ChooseResearchMilestone(params MileStones[] value)
 {
     string name = "";
     foreach (var milestone in value)
     {
         switch (milestone)
         {
             case MileStones.StudyPermanentlyClosedToEnrollment:
             {
                 name = "Study is permanently closed to enrollment OR was never open for enrollment";
                 break;
             }
             case MileStones.AllSubjectCompletedStudyRelatedInterventions:
             {
     //                        name = @"
     //	                    All subjects have completed all study-related interventions OR not applicable (e.g. study did not include interventions, no subjects were enrolled)";
                 name = @"All subjects have completed";
                 break;
             }
             case MileStones.CollectionOfPrivateInfoComplete:
             {
                 //name =
                 //    @"Collection of private identifiable information is complete OR not applicable (no subjects were enrolled)";
                 name = @"Collection of private";
                 break;
             }
             case MileStones.AnalysisOfPrivateInfoComplete:
             {
                 //name =
                 //    @"Analysis of private identifiable information is complete OR not applicable (no subjects were enrolled)";
                 name = @"Analysis of private";
                 break;
             }
             case MileStones.RemainingStudyActivitiesLimited:
             {
                 name = @"Remaining study activities are limited to data analysis";
                 break;
             }
             case MileStones.StudyRemainsActive:
             {
                 name = @"Study remains active only for long-term follow-up of subjects";
                 break;
             }
         }
         //var chkbox = new Checkbox(By.XPath(".//td[text()='" + name + "']/../td/table/tbody/tr/td/input[1]"));
         var chkbox = new Checkbox(By.XPath(".//td[contains(.,'" + name + "')]/../td/table/tbody/tr/td/input[1]"));
         chkbox.Click();
         Trace.WriteLine("Checking option: " + value);
     }
 }
 public void ChooseModificationScope(Scope scope)
 {
     string name = "";
     if (scope == Scope.OtherPartsOfTheStudy)
     {
         name = "Other parts of the study";
     }
     if (scope == Scope.StudyTeamMemberInformation)
     {
         name = "Study team member information";
     }
     Checkbox scopePurpose = new Checkbox(By.XPath(".//td[text()='" + name + "']/../td[1]/table/tbody/tr/td/input[1]"));
     scopePurpose.Click();
 }