Esempio n. 1
0
        /// <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 ClickButtonToAdvance(IWebElement buttonOrLinkElem)
        {
            if (Browser.Exists(Bys.ProgramsPage.UnassignCurriculumLnk))
            {
                if (buttonOrLinkElem.GetAttribute("id") == UnassignCurriculumLnk.GetAttribute("id"))
                {
                    UnassignCurriculumLnk.Click();
                    new WebDriverWait(Browser, TimeSpan.FromSeconds(60)).Until(ExpectedConditions.UrlContains("Courses.aspx"));
                    return(new EducationCenterPage(Browser));
                }
                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);
        }
Esempio n. 2
0
 /// <summary>
 /// Enters text in the username and password field, clicks the login button, then waits for the URL
 /// of the Library page to load
 /// </summary>
 /// <param name="userName"></param>
 /// <param name="password"></param>
 public dynamic UnassignCurriculum()
 {
     try {
         do
         {
             ActionBtn.Click();
             UnassignCurriculumLnk.Click();
             Thread.Sleep(0500);
             AcceptBtn.Click();
             Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(90), ElementCriteria.IsNotVisible);
         }while (ActionBtn.Displayed);
     }
     catch (NoSuchElementException)
     {
         GCEPPage Gcep = new GCEPPage(Browser);
         // Gcep.GMECompetencyEducationProgramLnk.Click();
         Browser.Navigate().Back();
         Gcep.WaitForInitialize();
         return(Gcep);
     }
     return(null);
 }