public void InitialStudyCreationWithExternalIRB()
        {
            string targetStudy = "AutoTestStudy-" + DataGen.String(5);
            var InitialStudySF = new InitialStudySmartForm();
            var irbSubmissionsPage = new IRBSubmissions();
            var actionsNav = new ActionsNav();
            var workspace = new IRBWorkspace();

            //Log in as PI and Create New Study.
            Store.LoginAsUser(Users.Pi);
            actionsNav.ImgCreateNewStudyLink.Click();

            InitialStudySF.NewSubmissionSmartformPage.TxtDescription.Value = "Random Automated test for IRB submission";
            InitialStudySF.NewSubmissionSmartformPage.TxtTitleStudy.Value = targetStudy;
            InitialStudySF.NewSubmissionSmartformPage.TxtShortTitle.Value = targetStudy;
            InitialStudySF.NewSubmissionSmartformPage.RdoFinancialInterestNo.Selected = true;
            InitialStudySF.NewSubmissionSmartformPage.RdoExternalIrbYes.Selected = true;
            //InitialStudySF.NewSubmissionSmartformPage.AttachProtocol(@"\\pdxstor\public\Aaron.Bentley\automation\testDoc.docx");
            InitialStudySF.NewSubmissionSmartformPage.BtnContinue.Click();

            // External IRB Page

            InitialStudySF.ExternalIrbPage.BtnSelectExternalIRB.Click();
            InitialStudySF.ExternalIrbPage.SelectOrgPopup.SwitchTo();
            InitialStudySF.ExternalIrbPage.SelectOrgPopup.SelectValue("Dummy External Institute");
            InitialStudySF.ExternalIrbPage.SelectOrgPopup.BtnOk.Click();
            InitialStudySF.ExternalIrbPage.SelectOrgPopup.SwitchBackToParent();
            InitialStudySF.ExternalIrbPage.BtnFinish.Click();
            Wait.Until(h => new Link(By.LinkText("Study Created")).Exists);

            //As the PI, Submit the study.
            workspace.Submit(Users.Pi.UserName, Users.Pi.Password);
            Assert.IsTrue(workspace.GetStudyState() == "Pre-Review", "State expected not in 'Pre-Review'.  State currently: " + workspace.GetStudyState());

            //Log in as an IRB coordinator and Confirm External IRB.
            Store.LoginAsUser(Users.Irbc);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(targetStudy);
            workspace.ConfirmExternalIRB();
            Assert.IsTrue(workspace.GetStudyState() == "External IRB", "State expected not in 'External IRB'.  State currently: " + workspace.GetStudyState());

            //Log in as the PI and Update External IRB Status (yes to close study).
            Store.LoginAsUser(Users.Pi);
            irbSubmissionsPage.OpenSubmissionByAllSubmissions(targetStudy);
            workspace.UpdateExternalIRBStatus();
            Assert.IsTrue(workspace.GetStudyState() == "Closed", "State expected not in 'Closed'.  State currently: " + workspace.GetStudyState());
        }