public void AwardPage() { 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(); }
public void Page_IncomeAssessedApplicant() { 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(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); NewApplication.Click(); startIncomeAssessedApplication.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); Dataprivacystatement_label.Click(); NextButton.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); SelectElement residentOption = new SelectElement(Resident); residentOption.SelectByText("No"); AJAXCall.WaitForAjax(); SelectElement EuCitizen = new SelectElement(Eyp_eucitizen); EuCitizen.SelectByText("No"); AJAXCall.WaitForAjax(); SelectElement EftaCitizen = new SelectElement(Eyp_eftacitizen); EftaCitizen.SelectByText("No"); AJAXCall.WaitForAjax(); SelectElement Asylumseeker = new SelectElement(Eyp_asylumrefugee); Asylumseeker.SelectByText("No"); AJAXCall.WaitForAjax(); SelectElement selfEmployed = new SelectElement(Eyp_employedinireland); selfEmployed.SelectByText("Yes"); NextButton.Click(); //AJAXCall.WaitForAjax(); var address_0 = "17 The Blennicks, Rosses Point, Co.Silgo"; TextBox_Address.SendKeys(address_0); Thread.Sleep(800); driver.FindElement(By.CssSelector(".autoaddress-button")).Click(); Thread.Sleep(800); AJAXCall.WaitForAjax(); IJavaScriptExecutor js = (IJavaScriptExecutor)driver; js.ExecuteScript("window.scrollBy(0, 500)", ""); Thread.Sleep(800); //wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); ReportsGeneration._test.Log(AventStack.ExtentReports.Status.Pass, address_0 + " " + "address details added successfully" + " " + "PASSED"); AJAXCall.WaitForAjax(); if (AJAXCall.IsElementPresent(By.Id("btnNext"))) { NextButton.Click(); } Thread.Sleep(1000); SelectElement LivingWithPartner = new SelectElement(Eyp_livingwithpartner); LivingWithPartner.SelectByText("Yes"); Eyp_livingwithpartnerdeclaration_label.Click(); Eyp_partnerfirstname.SendKeys("Test"); Eyp_partnerlastname.SendKeys("AddPartner"); Eyp_partnerppsn.SendKeys("8967543AS"); DOB_Calendar.SendKeys("18/11/1979"); Eyp_partneremailaddress.SendKeys("*****@*****.**"); NextButton.Click(); /* 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("ZX"); * var myDate = DateTime.Now; * * var newDate = myDate.AddYears(-8); * * var chickDOB = newDate.ToString("dd/MM/yyyy"); * DOB_Calendar.SendKeys(chickDOB); * * SelectElement genderVateal = new SelectElement(Genderid); * genderVal.SelectByText("Female"); */ CHICK_ApplicantPortal_Page Ap = new CHICK_ApplicantPortal_Page(driver); Ap.IncomeAccess_ApplicantPortal_ChildData(); NextButton.Click(); SelectElement partnerEmp = new SelectElement(Eyp_employmentstatusid); partnerEmp.SelectByText("Employed"); Eyp_occupationname.SendKeys("Pobal"); Eyp_occupationphone.SendKeys("0897654567"); var emailId = Constant_functions.randomString(9); Eyp_occupationemailaddress.SendKeys(emailId + "@hotmail.com"); Thread.Sleep(1000); TextBox_Address.SendKeys("16 Pearse Square, Greenpark Road, Bray, Co. Wicklow"); driver.FindElement(By.XPath("//*[@id='AutoAddressControl']/div/button")).Click(); Thread.Sleep(1000); AJAXCall.WaitForAjax(); Thread.Sleep(1000); js.ExecuteScript("window.scrollBy(0, 500)", ""); NextButton.Click(); SelectElement partnerProfession = new SelectElement(Eyp_partneremploymentstatusid); partnerProfession.SelectByText("Education / Training"); Thread.Sleep(1000); js.ExecuteScript("window.scrollBy(0, 500)", ""); Thread.Sleep(1000); Eyp_partneroccupationname.SendKeys("Pobal CO."); Eyp_partneroccupationtitle.SendKeys("Masters"); SelectElement Partnercourseleadtonfqaward = new SelectElement(Eyp_partnercourseleadtonfqaward); Partnercourseleadtonfqaward.SelectByText("Yes"); SelectElement Partnernfqlevelid = new SelectElement(Eyp_partnernfqlevelid); Partnernfqlevelid.SelectByText("Level 8"); NextButton.Click(); SelectElement revenueAssist = new SelectElement(Eyp_revenuejointassessed); revenueAssist.SelectByText("Yes"); SelectElement fastTrack = new SelectElement(Eyp_fasttrack); fastTrack.SelectByText("Yes"); NextButton.Click(); SelectElement Form12 = new SelectElement(Eyp_earnnonpayey1); Form12.SelectByText("Yes"); SelectElement Declare_Form12 = new SelectElement(Eyp_Declare_earnnonpayey1); Declare_Form12.SelectByText("Yes"); Eyp_incomeearnednonpayey1.SendKeys("200"); SelectElement Partner_Form12 = new SelectElement(Eyp_earnnonpayey2); Partner_Form12.SelectByText("Yes"); Eyp_incomeearnednonpayey2.SendKeys("300"); NextButton.Click(); SelectElement recvePaymentMaintenance = new SelectElement(Eyp_receivedmaintenance); recvePaymentMaintenance.SelectByText("No"); Eyp_maintenancereceivedy1.SendKeys("400"); Eyp_maintenancereceivedy2.SendKeys("200"); SelectElement paidMaintenance = new SelectElement(Eyp_paidmaintenance); paidMaintenance.SelectByText("Yes"); Eyp_maintenancepaidy1.SendKeys("200"); Eyp_maintenancepaidy2.SendKeys("200"); SelectElement Earnedincomeoutside = new SelectElement(Eyp_earnedincomeoutside); Earnedincomeoutside.SelectByText("Yes"); Eyp_incomeoutsidey1.SendKeys("400"); Eyp_incomeoutsidey2.SendKeys("200"); SelectElement Privatepensioncontributed = new SelectElement(Eyp_privatepensioncontributed); Privatepensioncontributed.SelectByText("Yes"); Eyp_privatepensioncontributiony1.SendKeys("300"); Eyp_privatepensioncontributiony2.SendKeys("200"); SelectElement Partnerreceivedmaintenance = new SelectElement(Eyp_partnerreceivedmaintenance); Partnerreceivedmaintenance.SelectByText("Yes"); Eyp_partnermaintenancereceivedy1.SendKeys("200"); Eyp_partnermaintenancereceivedy2.SendKeys("300"); SelectElement Partnerpaidmaintenance = new SelectElement(Eyp_partnerpaidmaintenance); Partnerpaidmaintenance.SelectByText("Yes"); Eyp_partnermaintenancepaidy1.SendKeys("300"); Eyp_partnermaintenancepaidy2.SendKeys("200"); SelectElement Partnerearnedincomeoutside = new SelectElement(Eyp_partnerearnedincomeoutside); Partnerearnedincomeoutside.SelectByText("Yes"); Eyp_partnerincomeoutsidey1.SendKeys("300"); Eyp_partnerincomeoutsidey2.SendKeys("300"); SelectElement Partnerprivatepensioncontributed = new SelectElement(Eyp_partnerprivatepensioncontributed); Partnerprivatepensioncontributed.SelectByText("Yes"); Eyp_partnerprivatepensioncontributiony1.SendKeys("200"); Eyp_partnerprivatepensioncontributiony2.SendKeys("400"); NextButton.Click(); Assert.Equals(driver.Url, driver.Url); AJAXCall.WaitForAjax(); Thread.Sleep(2000); js.ExecuteScript("window.scrollBy(0,document.body.scrollHeight)"); NextButton.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(); NextButton.Click(); Thread.Sleep(2000); AJAXCall.WaitForAjax(); BtnModalSubmit.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")); }