示例#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 ClickToAdvance(IWebElement buttonOrLinkElem)
        {
            if (Browser.Exists(Bys.PGYAssignmentPage.SaveExitBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == SaveExitBtn.GetAttribute("outerHTML"))
                {
                    Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                    // ElemSet.ScrollToElement(Browser, buttonOrLinkElem);
                    SaveExitBtn.Click();
                    Browser.WaitForElement(Bys.CurriculumMngPage.SearchTxt, TimeSpan.FromSeconds(300), ElementCriteria.IsVisible);
                    Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(120), ElementCriteria.IsNotVisible);
                    return(new CurriculumMngPage(Browser));
                }
            }
            if (Browser.Exists(Bys.PGYAssignmentPage.NextBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == NextBtn.GetAttribute("outerHTML"))
                {
                    Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(120), ElementCriteria.IsNotVisible);
                    Thread.Sleep(1000);
                    // ElemSet.ScrollToElement(Browser, buttonOrLinkElem);
                    NextBtn.Click();
                    Browser.WaitForElement(Bys.AssignSummaryPage.EditProgramSummarytbl, TimeSpan.FromSeconds(180), ElementCriteria.IsVisible, ElementCriteria.IsEnabled);
                    Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(120), ElementCriteria.IsNotVisible);
                    return(new AssignSummaryPage(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);
        }
示例#2
0
 public static void SiginOperation(string emailOrPhone, string password)
 {
     // SignInBtm.Click();
     //  ChangeLanguageForSignIn();
     Assert.IsTrue(IsAtEnterEmailOrPhoneScreen());
     EmailOrPhoneField.SendKeys(emailOrPhone);
     NextBtn.Click();
     Assert.IsTrue(IsAtEnterPasswordScreen());
     PasswordField.SendKeys(password);
     NextBtn.Click();
 }
示例#3
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 ClickToAdvance(IWebElement buttonOrLinkElem)
        {
            if (Browser.Exists(Bys.AssignProgramPage.NextBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == NextBtn.GetAttribute("outerHTML"))
                {
                    //ElemSet.ScrollToElement(Browser, NextBtn);
                    NextBtn.Click();
                    Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(120), ElementCriteria.IsNotVisible);
                    AssignSummaryPage ASP = new AssignSummaryPage(Browser);
                    ASP.WaitForInitialize();
                    return(ASP);
                }
            }
            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);
        }
        ///// <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.CurriculumCoursePage.NextBtn))
            {
                if (buttonOrLinkElem.GetAttribute("outerHTML") == NextBtn.GetAttribute("outerHTML"))
                {
                    // ElemSet.ScrollToElement(Browser, buttonOrLinkElem);
                    NextBtn.Click();
                    //Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
                    //Browser.WaitForElement(Bys.PGYAssignmentPage.UltimateTbl, TimeSpan.FromSeconds(120), ElementCriteria.IsEnabled,ElementCriteria.IsVisible);
                    // Browser.SwitchTo().Frame(G.EnterACPDFrame);
                    PGYAssignmentPage PGYAP = new PGYAssignmentPage(Browser);
                    PGYAP.WaitForInitialize();
                    return(PGYAP);
                }
            }

            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);
        }
示例#5
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 ClickToAdvance(IWebElement buttonorElem)
        {
            if (Browser.Exists(Bys.AssignSummaryPage.NextBtn))
            {
                if (buttonorElem.GetAttribute("id") == NextBtn.GetAttribute("id"))
                {
                    Browser.WaitForElement(Bys.AssignSummaryPage.NextBtn, ElementCriteria.IsEnabled);
                    Thread.Sleep(0500);
                    ElemSet.ScrollToElement(Browser, NextBtn);
                    NextBtn.Click();
                    Browser.WaitForElement(Bys.AMAPage.BreadCrumbLnksContainer, TimeSpan.FromSeconds(90), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
                    AssignConfirmationPage ACP = new AssignConfirmationPage(Browser);
                    ACP.WaitForInitialize();
                    return(ACP);
                }
            }
            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);
        }
示例#6
0
 public void ClickNextButton()
 {
     WaitForElementToBeVisibleById(NextBtn);
     NextBtn.Click();
 }
        public void Chick_UniversalApplication_Subsidy(string CitizenOption)
        {
            string parentWindow = driver.CurrentWindowHandle;

            Thread.Sleep(700);

            CommonUtils Cu = new CommonUtils(driver);

            Cu.AcceptAll_Cookies();

            if (AJAXCall.IsElementPresent(By.XPath("/html/body/div[1]/div/a")))
            {
                Dimisscookie_Message.Click();
            }
            Admin_SignIn.Click();

            Username.SendKeys("*****@*****.**");

            Password.SendKeys("Pobal123!");

            Thread.Sleep(1000);
            SignIn_Page.Click();

            MyApplicationsLink.Click();
            ViewApplications.Click();

            //MyAwards_NCS();

            AJAXCall.WaitForAjax();
            Thread.Sleep(1000);

            NewApplication.Click();
            startUniversal_Application.Click();
            eyp_dataprivacystatement.Click();

            Thread.Sleep(1000);
            NextBtn.Click();

            switch (CitizenOption)
            {
            case "IrelandCitizen":

                SelectElement value1 = new SelectElement(eyp_irelandresident);
                value1.SelectByText("Yes");

                Console.WriteLine(CitizenOption);
                break;

            case "EUCitizen":
                SelectElement value2 = new SelectElement(eyp_irelandresident);
                value2.SelectByText("No");

                SelectElement value_EU = new SelectElement(Eyp_eucitizen);
                value_EU.SelectByText("Yes");

                Console.WriteLine(CitizenOption);
                break;

            case "SW_IC_NR_Citizen":
                SelectElement value3 = new SelectElement(eyp_irelandresident);
                value3.SelectByText("No");

                SelectElement value_EU_No = new SelectElement(Eyp_eucitizen);
                value_EU_No.SelectByText("No");

                SelectElement value_SW_IC_NR = new SelectElement(Eyp_eftacitizen);
                value_SW_IC_NR.SelectByText("Yes");

                Console.WriteLine(CitizenOption);
                break;

            case "Asylum_Seeker_RefugeeCitizen":

                SelectElement value4 = new SelectElement(eyp_irelandresident);
                value4.SelectByText("No");

                SelectElement value_EU_No_1 = new SelectElement(Eyp_eucitizen);
                value_EU_No_1.SelectByText("No");

                SelectElement value_SW_IC_NR_No = new SelectElement(Eyp_eftacitizen);
                value_SW_IC_NR_No.SelectByText("No");

                SelectElement value_Aslyum_Refugee = new SelectElement(Eyp_asylumrefugee);
                value_Aslyum_Refugee.SelectByText("Yes");

                Console.WriteLine(CitizenOption);
                break;

            case "Self_Employed":

                SelectElement value5 = new SelectElement(eyp_irelandresident);
                value5.SelectByText("No");

                SelectElement value_EU_No_2 = new SelectElement(Eyp_eucitizen);
                value_EU_No_2.SelectByText("No");

                SelectElement value_SW_IC_NR_No_1 = new SelectElement(Eyp_eftacitizen);
                value_SW_IC_NR_No_1.SelectByText("No");

                SelectElement value_Aslyum_Refugee_1 = new SelectElement(Eyp_asylumrefugee);
                value_Aslyum_Refugee_1.SelectByText("No");


                SelectElement value_Employed = new SelectElement(Eyp_Employed);
                value_Employed.SelectByText("Yes");

                Console.WriteLine(CitizenOption);
                break;

            default:
                Console.WriteLine("Default case");
                break;
            }



            NextBtn.Click();

            var address = "17 Bleach Road, Dún Brinn, Athy, Co.Kildare";

            addressSection.SendKeys(address);

            AJAXCall.WaitForAjax();
            Thread.Sleep(1000);
            driver.FindElement(By.CssSelector(".autoaddress-button")).Click();

            Thread.Sleep(2000);

            AJAXCall.WaitForAjax();

            IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

            js.ExecuteScript("window.scrollBy(0, 500)", "");
            Thread.Sleep(1000);


            ReportsGeneration._test.Log(Status.Pass, "SPP" + "      " + "address details added successfully" + "      " + "PASSED");
            Thread.Sleep(800);
            if (AJAXCall.IsElementPresent(By.Id("btnNext")))
            {
                NextBtn.Click();
            }

            Thread.Sleep(2000);

            eyp_firstname.SendKeys("Test");
            eyp_lastname.SendKeys("Automation");

            var ppsndigit = Constant_functions.RandomNumGeneration(7);

            var ppsnAlpha = Constant_functions.randomString(2);
            var ppsn      = ppsndigit + ppsnAlpha;

            Eyp_ppsn.SendKeys(ppsn);

            Eyp_ppsn.SendKeys("AS");

            var myDate  = DateTime.Now;
            var newDate = myDate.AddYears(-1);

            var chickDOB = newDate.ToString("dd/MM/yyyy");

            DateOfBirth.SendKeys(chickDOB);

            SelectElement genderVal = new SelectElement(Genderid);

            genderVal.SelectByText("Female");

            Thread.Sleep(1000);
            SelectElement relToChild = new SelectElement(Eyp_relationshipapplicantid);

            relToChild.SelectByIndex(4);

            Thread.Sleep(1000);
            AJAXCall.WaitForAjax();

            Thread.Sleep(2000);

            AJAXCall.WaitForAjax();

            if (AJAXCall.IsElementPresent(By.Id("//*[@id='nexteducationstage']")) && nextEduStage.Displayed)
            {
                SelectElement NextEduStage = new SelectElement(nextEduStage);

                myDate  = DateTime.Now;
                newDate = myDate.AddYears(+1);
                NextEduStage.SelectByIndex(3);

                Thread.Sleep(1000);
            }
            BtnSubmitChild.Click();

            Thread.Sleep(2000);
            driver.SwitchTo().DefaultContent();

            AJAXCall.WaitForReady(driver);

            Thread.Sleep(2000);
            NextBtn.Click();

            Thread.Sleep(1000);
            IWebElement chick_Number      = driver.FindElement(By.Id("eyp_id"));
            var         store_ChickNumber = chick_Number.GetAttribute("value");

            AJAXCall.WaitForAjax();

            Thread.Sleep(2000);
            js.ExecuteScript("window.scrollBy(0,document.body.scrollHeight)");

            NextBtn.Click();
            Thread.Sleep(2000);

            IWebElement label = driver.FindElement(By.XPath("//label[@for='eyp_custodydeclaration']"));

            new Actions(driver).MoveToElement(label, 1, 1).Click().Perform();



            AJAXCall.WaitForAjax();

            Eyp_informationtruthfuldeclaration_label.Click();

            NextBtn.Click();
            Thread.Sleep(2000);

            AJAXCall.WaitForAjax();

            BtnModalSubmit.Click();
        }
        public void Chick_UniversalApplication_NoSubsidy()
        {
            string parentWindow = driver.CurrentWindowHandle;

            Thread.Sleep(700);

            CommonUtils Cu = new CommonUtils(driver);

            Cu.AcceptAll_Cookies();

            if (AJAXCall.IsElementPresent(By.XPath("/html/body/div[1]/div/a")))
            {
                Dimisscookie_Message.Click();
            }

            Username.SendKeys("*****@*****.**");

            Password.SendKeys("Pobal123!");

            Thread.Sleep(1000);
            SignIn_Page.Click();

            MyApplicationsLink.Click();
            ViewApplications.Click();

            AJAXCall.WaitForAjax();
            Thread.Sleep(1000);

            NewApplication.Click();
            startUniversal_Application.Click();
            eyp_dataprivacystatement.Click();

            Thread.Sleep(1000);
            NextBtn.Click();

            SelectElement value = new SelectElement(eyp_irelandresident);

            value.SelectByText("Yes");

            NextBtn.Click();

            var address = "17 Bleach Road, Dún Brinn, Athy, Co.Kildare";

            addressSection.SendKeys(address);

            AJAXCall.WaitForAjax();
            Thread.Sleep(1000);
            driver.FindElement(By.CssSelector(".autoaddress-button")).Click();

            Thread.Sleep(2000);

            AJAXCall.WaitForAjax();

            IJavaScriptExecutor js = (IJavaScriptExecutor)driver;

            js.ExecuteScript("window.scrollBy(0, 500)", "");
            Thread.Sleep(1000);


            ReportsGeneration._test.Log(Status.Pass, "SPP" + "      " + "address details added successfully" + "      " + "PASSED");
            Thread.Sleep(800);
            if (AJAXCall.IsElementPresent(By.Id("btnNext")))
            {
                NextBtn.Click();
            }

            Thread.Sleep(2000);

            eyp_firstname.SendKeys("Test");
            eyp_lastname.SendKeys("Automation");


            Eyp_ppsn.SendKeys("7865481TR");


            var myDate  = DateTime.Now;
            var newDate = myDate.AddYears(-3);

            var chickDOB = newDate.ToString("dd/MM/yyyy");

            DateOfBirth.SendKeys(chickDOB);
            SelectElement genderVal = new SelectElement(Genderid);

            genderVal.SelectByText("Female");

            Thread.Sleep(1000);
            SelectElement relToChild = new SelectElement(Eyp_relationshipapplicantid);

            relToChild.SelectByIndex(5);

            Thread.Sleep(1000);
            AJAXCall.WaitForAjax();
            if (AJAXCall.IsElementPresent(By.Id("initialeducationstage")) || Initialeducationstage.Displayed)
            {
                SelectElement EduStage = new SelectElement(Initialeducationstage);
                EduStage.SelectByText("ECCE / ECCE Eligible");
            }
            Thread.Sleep(1000);

            AJAXCall.WaitForAjax();
            if (AJAXCall.IsElementPresent(By.Id("eyp_movetonexteducationstage")) || EduStageDate_Option.Displayed)
            {
                SelectElement eduStageDate = new SelectElement(EduStageDate_Option);
                eduStageDate.SelectByText("Yes");
            }
            Thread.Sleep(2000);

            AJAXCall.WaitForAjax();
            SelectElement NextEduStage = new SelectElement(nextEduStage);

            NextEduStage.SelectByIndex(3);

            Thread.Sleep(2000);
            myDate = DateTime.Now;

            newDate = myDate.AddYears(+1).AddDays(8);

            var nextyearDate = newDate.ToString("dd/MM/yyyy");

            dateNextEduStage.Click();

            dateNextEduStage.SendKeys(nextyearDate);


            BtnSubmitChild.Click();

            Thread.Sleep(2000);
            AJAXCall.WaitForAjax();

            if (AJAXCall.IsElementPresent(By.XPath("//*[@id='btnModalSubmit']")))
            {
                caretChild_Click.Click();
                Thread.Sleep(2000);
            }



            AJAXCall.WaitForReady(driver);

            Thread.Sleep(2000);
            NextBtn.Click();

            Thread.Sleep(1000);
            IWebElement chick_Number      = driver.FindElement(By.Id("eyp_id"));
            var         store_ChickNumber = chick_Number.GetAttribute("value");

            AJAXCall.WaitForAjax();

            Thread.Sleep(2000);
            js.ExecuteScript("window.scrollBy(0,document.body.scrollHeight)");

            NextBtn.Click();

            Thread.Sleep(1000);
            Thread.Sleep(2000);

            IWebElement label = driver.FindElement(By.XPath("//label[@for='eyp_custodydeclaration']"));

            new Actions(driver).MoveToElement(label, 1, 1).Click().Perform();

            AJAXCall.WaitForAjax();

            Eyp_informationtruthfuldeclaration_label.Click();

            NextBtn.Click();
            Thread.Sleep(2000);

            AJAXCall.WaitForAjax();

            BtnModalSubmit.Click();

            Assert.AreEqual("", "Applicant Portal Passed", "" + ReportsGeneration._test.Log(Status.Pass, "SPP" + "      " + "address details added successfully" + "      " + "PASSED"));
        }
示例#9
0
 public void ClickNextButton()
 {
     NextBtn.Click();
 }