/// <summary>
        /// this specific method adding courses to curriculum for specific program
        /// </summary>
        /// <param name="browser"></param>
        public static void AddCourseToCurriculum(IWebDriver browser)
        {
            ProgramsPage         PP         = new ProgramsPage(browser);
            CurriculumCoursePage CoursePage = PP.EditProgramm();

            CoursePage.AddOrRemoveCourses(CoursePage.AvailableCoursesTbl, CoursePage.AddSelectedBtn, 2, 3);
            PGYAssignmentPage Pgy = CoursePage.ClickToAdvance(CoursePage.NextBtn);

            Pgy.Grid_ClickElementWithoutTextInsideRow(Pgy.EditCoursePgyTbl, 2, 3);
            Pgy.Grid_ClickElementWithoutTextInsideRow(Pgy.EditCoursePgyTbl, 3, 3);
            AssignSummaryPage      Summary = Pgy.ClickToAdvance(Pgy.NextBtn);
            AssignConfirmationPage Confirm = Summary.ClickToAdvance(Summary.NextBtn);

            Confirm.ClickToAdvance(Confirm.EditConfirmBtn);
            PP.Search("Anesthesiology");
        }
        /// <summary>
        /// basically creating curriculum all flow
        /// </summary>
        /// <param name="browser"></param>
        /// <param name="curriculumName">  curriculum name </param>
        public static void CurriculumCreationFlow(IWebDriver browser, string curriculumName)
        {
            CurriculumCoursePage CurCoursPage = new CurriculumCoursePage(browser);

            ///  4.Form course page choosing available courses from table by index
            CurCoursPage.AddOrRemoveCourses(CurCoursPage.AvailableCoursesTbl, CurCoursPage.AddSelectedBtn, 1, 7, 12);

            ///  5. Giving the name for curriculum passing parameter from TestCase as a string
            CurCoursPage.CurriculumNameTxt.Clear();
            CurCoursPage.CurriculumNameTxt.SendKeys(curriculumName);

            ///  6.Saving curriculum and navigating to the pgy pages to assigne course to students
            PGYAssignmentPage PGY = CurCoursPage.ClickToAdvance(CurCoursPage.NextBtn);

            ///  7.Choosing student years to assign course by index for each course
            PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 1, 8);
            PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 2, 7);
            PGY.Grid_ClickElementWithoutTextInsideRow(PGY.CourseTbl, 3, 6);

            ///  8. Saving curriculum and navigating to curriculum management page again
            PGY.ClickToAdvance(PGY.SaveExitBtn);
            PGY.Search(curriculumName);
        }
        ///// <summary>
        ///// Clicks the user-specified button or link and then waits for a window to close or open, or a page to load,
        ///// depending on the button that was clicked
        ///// </summary>
        ///// <param name="buttonOrLinkElem">The element to click on</param>
        public dynamic ClickToAdvance(IWebElement buttonOrLinkElem)
        {
            if (Browser.Exists(Bys.AMAPage.SignOutLnk))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == SignOutLnk.GetAttribute("outerHTML"))
                {
                    Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                    HeaderMenuDropDown.Click();
                    SignOutLnk.SendKeys(Keys.Tab);
                    SignOutLnk.Click();
                    //Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);

                    // return  new CurriculumMngPage(Browser);
                    // new WebDriverWait(Browser, TimeSpan.FromSeconds(115)).Until(ExpectedConditions.UrlMatches("https://logintest.ama-assn.org/account/logout"));
                    return(this.Browser);
                }
            }

            if (Browser.Exists(Bys.CurriculumMngPage.CurrulumTemplatesHeader))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == CreateCurriculumTemplateBtn.GetAttribute("outerHTML"))
                {
                    Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                    // new WebDriverWait(Browser, TimeSpan.FromSeconds(15)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates"));
                    CreateCurriculumTemplateBtn.Click();
                    //Thread.Sleep(3000);
                    //Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsEnabled);
                    Browser.WaitForElement(Bys.CurriculumCoursePage.AvailableCoursesTbl, ElementCriteria.IsVisible);
                    //  new WebDriverWait(Browser, TimeSpan.FromSeconds(35)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates/course"));

                    CurriculumCoursePage CCP = new CurriculumCoursePage(Browser);
                    CCP.WaitForInitialize();
                    return(CCP);
                }
            }

            if (Browser.Exists(Bys.CurriculumMngPage.AssignToProgrammLnk))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == AssignToProgrammLnk.GetAttribute("outerHTML"))
                {
                    // Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                    //  new WebDriverWait(Browser, TimeSpan.FromSeconds(15)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates"));
                    // CurriculumMngPage.Actioncell.Click();
                    AssignToProgrammLnk.Click();
                    Browser.WaitForElement(Bys.AssignProgramPage.StartDateCalenderBox, TimeSpan.FromSeconds(240), ElementCriteria.IsVisible);
                    // new WebDriverWait(Browser, TimeSpan.FromSeconds(35)).Until(ExpectedConditions.UrlContains("gme-competency/admin/curriculumtemplates/curriculumprogramtimeframe"));

                    // Browser.SwitchTo().Frame(G.EnterACPDFrame);
                    AssignProgramPage APP = new AssignProgramPage(Browser);
                    APP.WaitForInitialize();
                    return(APP);
                }
            }
            if (Browser.Exists(Bys.AMAPage.AdministrationLnk))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == GMECompetencyEducationProgramLnk.GetAttribute("outerHTML")) //AdministrationLnk.GetAttribute("outerHTML"))
                {
                    GMECompetencyEducationProgramLnk.Click();                                                                 // AdministrationLnk.Click();
                    GCEPPage GP = new GCEPPage(Browser);
                    GP.WaitForInitialize();
                    return(GP);
                }
            }
            else
            {
                throw new Exception("No button or link was found with your passed parameter. You either need to add this button to a new If statement, or if the button is already added, then the page you were on did not contain the button.");
            }

            return(null);
        }