/// <summary> /// TestFail method created specificly for the courses AUTOMATION_001 and _002, _003it will take a test and fail with credentials below /// It will take test 3 times and fails and returning GCEP Library Page /// </summary> /// TODO : remove Threads sleep after flickiring isssue will be fixed public dynamic TestFail() { Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(420), ElementCriteria.IsVisible, ElementCriteria.IsEnabled); Thread.Sleep(5000); ContinueBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(420), ElementCriteria.IsVisible, ElementCriteria.IsEnabled); Thread.Sleep(5000); ContinueBtn.Click(); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsEnabled); int i = 0; do { Thread.Sleep(1000); TestLaunchBtn.Click(); Thread.Sleep(0500); Browser.SwitchTo().Frame(PostTestFrame); ElemSet.RdoBtn_ClickMultipleByText(Browser, "B. False", "A. Harmful, abusive", "A. Low grade/poor class evaluation"); Thread.Sleep(0500); TestSubmitBtn.Click(); Thread.Sleep(0500); FrameCloseBtn.Click(); i++; } while (i < 3); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsEnabled, ElementCriteria.IsVisible); Thread.Sleep(5000); ContinueBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(160), ElementCriteria.IsEnabled); Thread.Sleep(5000); ContinueBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(135), ElementCriteria.IsVisible, ElementCriteria.IsEnabled); Thread.Sleep(5000); CertificateCloseBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(160), ElementCriteria.IsNotVisible); return(new GCEPLibraryPage(Browser)); }
/// <summary> /// TestPass method created specificly for the courses AUTOMATION_001 and _002, _003 it will take a test and faipass with credentials below /// GCEP Library Page /// </summary> /// TODO : remove Threads sleep after flickiring isssue will be fixed public dynamic TestPass() { WaitForInitialize(); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsVisible, ElementCriteria.IsEnabled); ContinueBtn.Click(); Thread.Sleep(2000); WaitForInitialize(); ContinueBtn.Click(); //Thread.Sleep(2000); //WaitForInitialize(); //ContinueBtn.Click(); WaitForInitialize(); TestLaunchBtn.Click(); Thread.Sleep(0500); Browser.SwitchTo().Frame(PostTestFrame); ElemSet.RdoBtn_ClickMultipleByText(Browser, "A. True", "B. Harmful, injurious", "D. All of the above"); TestSubmitBtn.Click(); Thread.Sleep(0500); FrameCloseBtn.Click(); Thread.Sleep(0500); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(125), ElementCriteria.IsEnabled); Thread.Sleep(1000); ContinueBtn.Click(); WaitForInitialize(); Thread.Sleep(1000); ContinueBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(90), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(95), ElementCriteria.IsEnabled); Thread.Sleep(4000); CertificateCloseBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(90), ElementCriteria.IsNotVisible); return(new GCEPPage(Browser)); }
/// <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 void ClickToAdvance(IWebElement buttonOrLinkElem) { if (Browser.Exists(Bys.CourseTestPage.ContinueBtn)) { if (buttonOrLinkElem.GetAttribute("xpath") == ContinueBtn.GetAttribute("xpath")) { ContinueBtn.Click(); Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsVisible, ElementCriteria.IsEnabled); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); //new WebDriverWait(Browser, TimeSpan.FromSeconds(15)).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; }
public dynamic LearnerTestPass() { Thread.Sleep(15000); // Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled); ContinueBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled); ContinueBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); // Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled); Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled); ContinueBtn.Click(); TestLaunchBtn.Click(); Thread.Sleep(0500); Browser.SwitchTo().Frame(PostTestFrame); ElemSet.RdoBtn_ClickMultipleByText(Browser, "A. True", "B. Harmful, injurious", "D. All of the above"); TestSubmitBtn.Click(); Thread.Sleep(0500); FrameCloseBtn.Click(); Thread.Sleep(0500); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled); ContinueBtn.Click(); // Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); ////Browser.WaitForElement(Bys.CourseTestPage.ContinueBtn, TimeSpan.FromSeconds(25), ElementCriteria.IsEnabled); //ContinueBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(35), ElementCriteria.IsEnabled); CertificateCloseBtn.Click(); Browser.Navigate().Refresh(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); return(new EducationCenterPage(Browser)); }
public void LogInToApp(string pass) { Password.SendKeys(pass); ContinueBtn.Click(); System.Threading.Thread.Sleep(2000); }
public SignInPage Continue() { ContinueBtn.Click(); return(new SignInPage(_driver, _wait)); }
public dynamic TakeTest(string role, string testStatus) { if (role == "Resident" && testStatus == "Pass") { Thread.Sleep(5000); // WaitForInitialize(); // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled); ContinueBtn.Click(); Thread.Sleep(5000); // WaitForInitialize(); Thread.Sleep(0500); Browser.SwitchTo().Frame(PostTestFrame); ElemSet.RdoBtn_ClickMultipleByText(Browser, "A. True", "B. Harmful, injurious", "D. All of the above"); TestSubmitBtn.Click(); Thread.Sleep(0500); FrameCloseBtn.Click(); Thread.Sleep(0500); Thread.Sleep(5000); // WaitForInitialize(); // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled); ContinueBtn.Click(); Thread.Sleep(5000); //Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); //Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(35), ElementCriteria.IsEnabled); CertificateCloseBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); return(new GCEPLibraryPage(Browser)); } else if (role == "Resident" && testStatus == "Fail") { Thread.Sleep(5000); // WaitForInitialize(); // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled); ContinueBtn.Click(); Thread.Sleep(5000); // WaitForInitialize(); int i = 0; do { Thread.Sleep(0500); TestLaunchBtn.Click(); Thread.Sleep(0500); Browser.SwitchTo().Frame(PostTestFrame); ElemSet.RdoBtn_ClickMultipleByText(Browser, "B. False", "A. Harmful, abusive", "A. Low grade/poor class evaluation"); Thread.Sleep(0500); TestSubmitBtn.Click(); Thread.Sleep(0500); FrameCloseBtn.Click(); i++; } while (i < 3); Thread.Sleep(0500); // WaitForInitialize(); // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled); ContinueBtn.Click(); Thread.Sleep(5000); // WaitForInitialize(); // Browser.WaitForElement(Bys.CourseTestPage.AssessmentTbl, TimeSpan.FromSeconds(60), ElementCriteria.IsEnabled); ContinueBtn.Click(); Thread.Sleep(5000); //Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); //Browser.WaitForElement(Bys.CourseTestPage.CertificateCloseBtn, TimeSpan.FromSeconds(35), ElementCriteria.IsEnabled); CertificateCloseBtn.Click(); Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(60), ElementCriteria.IsNotVisible); return(new GCEPLibraryPage(Browser)); } return(null); }