public void OnBoardingAdmin() { try { Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.XPath("//table[@id='gridBodyTable']/tbody/tr/td[2]/nobr/a"))) { crmGrid_Click.Click(); } AJAXCall.WaitForAjax(); Thread.Sleep(1000); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0,250)", ""); } catch (Exception e) { Console.WriteLine(e.Message); } }
public void TuslaSubmission() { AJAXCall.WaitForAjax(); Thread.Sleep(900); CommonUtils CookiesAction = new CommonUtils(webDriver); CookiesAction.RejectAll_Cookies(); Thread.Sleep(900); SignIn_Page.Click(); Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL); userEmail.getCellData("SPP_TestData", true); UserEmail.SendKeys(Env.Email_Id); Password.SendKeys("Test@123"); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); Thread.Sleep(800); SubmitButton.Click(); MyAccount_Toggle.Click(); TuslaCertificateLink.Click(); AddTusla_Button.Click(); var tuslaNum = Constant_functions.randomString(2); Constant_functions.tuslaNumber = tuslaNum + "1380"; TuslaText.SendKeys(Constant_functions.tuslaNumber); actionButton.Click(); NextButton.Click(); Thread.Sleep(1000); UploadtuslaCert.Click(); Thread.Sleep(1000); webDriver.SwitchTo().Frame(1); Thread.Sleep(1000); AJAXCall.WaitForReady(webDriver); // docOption.Click(); SelectElement docSelection = new SelectElement(eyp_documenttypeid_dropdown); docSelection.SelectByText("TUSLA Certificate"); IWebElement upload = webDriver.FindElement(By.Id("AttachFile")); upload.SendKeys("C:\\temp\\Tech_Cities_Future_report.pdf"); webDriver.FindElement(By.Id("InsertButton")).Click(); Thread.Sleep(1000); AJAXCall.WaitForReady(webDriver); webDriver.SwitchTo().DefaultContent(); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0,500)", ""); js.ExecuteScript("arguments[0].scrollIntoView();", NextButton); Thread.Sleep(500); ReportsGeneration._test.Log(Status.Pass, "SPP TUSLA CERT" + " " + webDriver.Url + " " + "PASSED"); if (AJAXCall.IsElementPresent(By.Id("NextButton"))) { NextButton.Click(); } else { js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("arguments[0].scrollIntoView();", NextButton); NextButton.Click(); } Thread.Sleep(900); //Get Parent window handle var winHandleBefore = webDriver.CurrentWindowHandle; Thread.Sleep(2000); }
public void CRM_SPP_TRN_SearchAndApproval(IWebDriver webDriver) { try { pobalOption_Select.Click(); userName.SendKeys(Credentials_Data.UserName); password.SendKeys(Credentials_Data.Password); signIN.Click(); //webDriver.Navigate().GoToUrl(URLConfig.CRM_SPP_Frame); AJAXCall.WaitForAjax(); Thread.Sleep(1000); tabCRM.Click(); Thread.Sleep(1500); onboardingTab.Click(); Thread.Sleep(2000); webDriver.SwitchTo().ParentFrame(); Thread.Sleep(2000); webDriver.SwitchTo().Frame(0); //webDriver.FindElement(By.Id("crmGrid_findHintText")).Click(); Thread.Sleep(500); webDriver.FindElement(By.Id("crmGrid_findCriteria")).Click(); Thread.Sleep(500); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("crmGrid_findCriteria")) || crmGrid_FindCriteria.Displayed) { //crmSearchGrid.Click(); IWebElement clickwebforms = webDriver.FindElement(By.Id("crmGrid_findCriteria")); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); IWebElement wb = webDriver.FindElement(By.Id("crmGrid_findHintText")); var value = wb.GetAttribute("style"); AJAXCall.WaitForAjax(); if (value.Contains("display: none;")) { AJAXCall.WaitForAjax(); clickwebforms.Click(); if (value.Contains("display: none;")) { Thread.Sleep(1000); clickwebforms.Click(); Excel_Suite ex_TestData = new Excel_Suite(Env.EXCEL_TEST_URL); ex_TestData.getCellData("SPP_TestData", true); Thread.Sleep(900); clickwebforms.SendKeys(Env.Data_Retrieve); Thread.Sleep(1000); clickwebforms.SendKeys(Keys.Enter); AJAXCall.WaitForAjax(); } } else { Thread.Sleep(1000); clickwebforms.Click(); if (value.Contains("display: inline;")) { Thread.Sleep(1000); clickwebforms.Click(); Excel_Suite ex_TestData = new Excel_Suite(Env.EXCEL_TEST_URL); ex_TestData.getCellData("SPP_TestData", true); clickwebforms.SendKeys(Env.Data_Retrieve); Thread.Sleep(1000); clickwebforms.SendKeys(Keys.Enter); Thread.Sleep(1000); } } } Thread.Sleep(1000); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); OnBoardingAdmin(); webDriver.SwitchTo().DefaultContent(); Thread.Sleep(2000); webDriver.SwitchTo().Frame("contentIFrame1"); Thread.Sleep(5000); if (AJAXCall.IsElementPresent(By.XPath("//*[@id='FormSecNavigationControl - Icon']"))) { NavigationFlyOut_Button.Click(); Review_Click.Click(); } else { Actions action = new Actions(webDriver); action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform(); } IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0,250)", ""); Thread.Sleep(1000); IWebElement chkBox_td = webDriver.FindElement(By.Id("eyp_markasapproved_d")); var td = chkBox_td.GetAttribute("class"); Thread.Sleep(2000); approve_chkBox.Click(); /*if(value_box.Contains("display: inline-block;")) * { * approve_chkbox.Click(); * * } */ AJAXCall.WaitForAjax(); Thread.Sleep(1000); webDriver.SwitchTo().ParentFrame(); AJAXCall.WaitForAjax(); Thread.Sleep(800); SaveAndClose.Click(); webDriver.SwitchTo().Frame(1); AJAXCall.WaitForAjax(); js.ExecuteScript("window.scrollBy(0,250)", ""); } catch (Exception e) { Console.WriteLine(e.Message); } }
public void IncomeAccess_ApplicantPortal_ChildData() { Thread.Sleep(1000); eyp_firstname.SendKeys("Test123"); 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(ppsnAlpha); var myDate = DateTime.Now; var newDate = myDate.AddYears(-10); 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(); if (AJAXCall.IsElementPresent(By.Id("initialeducationstage")) && Initialeducationstage.Displayed) { SelectElement EduStage = new SelectElement(Initialeducationstage); EduStage.SelectByText("1st to 6th Class"); } 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"); if (dateNextEduStage.Displayed && dateNextEduStage.Enabled) { 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); }
public void Email_LinkActivation(IWebDriver driver) { try { Thread.Sleep(2000); if (pobalOption_Select.Displayed || pobalOption_Select.Enabled) { pobalOption_Select.Click(); } userName.SendKeys(Credentials_Data.UserName); password.SendKeys(Credentials_Data.Password); signIN.Click(); //webDriver.Navigate().GoToUrl(URLConfig.CRM_SPP_Frame); AJAXCall.WaitForReady(driver); Thread.Sleep(1000); CRM_TabOptions.Click(); Thread.Sleep(1000); Email_Link.Click(); AJAXCall.WaitForReady(driver); Thread.Sleep(2000); webDriver.SwitchTo().Frame(0); var Email_Sequence = "//table[@id='gridBodyTable']/tbody/tr/td"; Thread.Sleep(2000); for (int i = 1; i < 100; i++) { var mesg = Email_Sequence + "[" + i + "]/nobr/a"; IWebElement wb = webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")); var EmailText = wb.Text; AJAXCall.WaitForAjax(); Thread.Sleep(2000); if (EmailText.Contains("Complete your Registration in the Early Years Hive")) { webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")).Click(); break; } else if (EmailText.Contains("Hive")) { Console.WriteLine(EmailText); } } Thread.Sleep(2000); AJAXCall.WaitForAjax(); webDriver.SwitchTo().DefaultContent(); IList <IWebElement> frames; frames = webDriver.FindElements(By.TagName("iframe")); int totalFrames = frames.Count; Dictionary <int, string> frameNamesIDs = new Dictionary <int, string>(); for (int i = 0; i < frames.Count; i++) { frameNamesIDs.Add(i, frames[i].GetAttribute("id").ToString()); } webDriver.SwitchTo().Frame("contentIFrame1"); Thread.Sleep(1000); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); webDriver.SwitchTo().Frame("descriptionEditIFrame"); Thread.Sleep(1000); IWebElement message = webDriver.FindElement(By.XPath("//html/body/p")); //var text_link = message.GetAttribute("textContent"); var email_activationLink = message.GetAttribute("innerHTML"); getEmailFromString(email_activationLink); ReportsGeneration._test.Log(Status.Pass, " " + email_activationLink + " " + "PASSED"); Thread.Sleep(1000); webDriver.Navigate().GoToUrl(Constant_functions.emailActivateURL); Thread.Sleep(1000); InvitationCode_Textfield.SendKeys(Constant_functions.redeemCodeText); submit_RedeemActivateButtn.Click(); Newuser_Password.SendKeys("Test@123"); Thread.Sleep(500); ConfirmNewuser_Password.SendKeys("Test@123"); Register_New_user.Click(); Thread.Sleep(500); js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); accept_rule.Click(); Update_Submitbtn.Click(); } catch (Exception e) { Console.WriteLine(e.Message); Assert.Fail("Failed"); } }
public void MyAccount_NavigationTest(IWebDriver driver) { try { Thread.Sleep(900); CommonUtils CookiesAction = new CommonUtils(driver); CookiesAction.RejectAll_Cookies(); Thread.Sleep(900); SignIn_Page.Click(); Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL); userEmail.getCellData("SPP_TestData", true); UserEmail.SendKeys(Env.Email_Id); Password.SendKeys("Test@123"); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(800)); Thread.Sleep(800); SubmitButton.Click(); MyAccount_Toggle.Click(); Organisation.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "dropdown is working fine"); wait = new WebDriverWait(driver, TimeSpan.FromSeconds(800)); AJAXCall.WaitForAjax(); MyAccount_Toggle.Click(); ServiceProvider_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "dropdown is working fine"); Thread.Sleep(1000); MyAccount_Toggle.Click(); userRoles_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "pageload is working fine"); MyAccount_Toggle.Click(); BankAccount_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "pageload is working fine"); MyAccount_Toggle.Click(); TuslaCertificate_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "pageload is working fine"); Thread.Sleep(500); MyAccount_Toggle.Click(); FeesList_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "pageload is working fine"); MyAccount_Toggle.Click(); ServiceCalendar_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "pageload is working fine"); MyAccount_Toggle.Click(); ECCEPreContracting_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "pageload is working fine"); MyAccount_Toggle.Click(); CapitalWorksEquipment_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "dropdown is working fine"); } catch (Exception e) { Console.WriteLine(e.Message); } }
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 StartOnboarding_ChangeOfCircumstances(IWebDriver webDriver) { try { CommonUtils Cu = new CommonUtils(webDriver); WebDriverWait web = new WebDriverWait(webDriver, TimeSpan.FromSeconds(500)); Thread.Sleep(1000); Cu.NonFunctionaCookies_On(); Cu.AnalyticalCookies_On(); Cu.AcceptAll_Cookies(); Assert.IsTrue(true, "Onboarding Page"); AJAXCall.WaitForAjax(); Cookies cookiePage = new Cookies(webDriver); webDriver.FindElement(By.XPath("//a[contains(text(),'Start On-Boarding Process')]")).Click(); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); // Timeout in seconds wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); cookiePage.getAllCookies(); AJAXCall.WaitForAjax(); this.NextButton.Click(); ReportsGeneration._test.Log(Status.Pass, "SPP" + webDriver.Url + "PASSED"); SelectElement oSelect_1 = new SelectElement(webDriver.FindElement(By.Id("eyp_legalstructure"))); IList <IWebElement> elementCount = oSelect_1.Options; Console.Write(elementCount.Count); string value_0 = "Designated Activity Company Limited by Guarantee"; string value_1 = "Limited Company with Share Capital"; string value_2 = "Organisations established by Statute"; string value_3 = "Private Company Limited by Shares"; string value_4 = "Sole Trader"; oSelect_1.SelectByText(value_4); this.TypeofOrg.Click(); SelectElement oSelect_2 = new SelectElement(TypeofOrg); IList <IWebElement> opt = oSelect_2.Options; Console.Write(opt.Count); ReportsGeneration._test.Log(Status.Pass, value_0); Thread.Sleep(200); string val = "New Organisation"; string val_1 = "Change of Circumstance"; oSelect_2.SelectByText(val_1); Eyp_typeofonboardingdetails.Click(); WebDriverWait LoadJQuery = new WebDriverWait(webDriver, TimeSpan.FromSeconds(900)); Eyp_typeofonboardingdetails.SendKeys("Test- Change of circumtances scenario dropdown"); // AJAXCall.WaitForAjax(); ReportsGeneration._test.Log(Status.Pass, val_1 + "Test- Change of circumtances scenario dropdown" + " " + "dropdown is working fine"); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "legal option" + value_0 + " " + "PASSED"); this.NextButton.Click(); Thread.Sleep(1000); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(900)); firstName.SendKeys("Automation"); lastName.SendKeys("Test"); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(1000)); string gmailAcc = Constant_functions.GetRandomAlphaNumeric() + "@hotmail.com"; var trnNo1 = Constant_functions.randomString(2); var s = Constant_functions.RandomNumGeneration(7); TrnNo = s + trnNo1; Excel_Suite Ex = new Excel_Suite(Env.EXCEL_TEST_URL); email.SendKeys(gmailAcc); confirmEmail.SendKeys(gmailAcc); var contactDetail = Constant_functions.RandomNumGeneration(9); contactNo.SendKeys(contactDetail); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "contact details added successfully" + " " + "PASSED"); this.NextButton.Click(); Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.XPath("//*[@id='eyp_crono']"))) { var croNumber = Constant_functions.RandomNumGeneration(3); croNum.SendKeys("120"); Thread.Sleep(800); croNum.SendKeys(croNumber); ReportsGeneration._test.Log(Status.Pass, "SPP" + "CRO Number=" + croNumber + " " + "PASSED"); Thread.Sleep(600); } Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("eyp_legalname"))) { IWebElement legalName = webDriver.FindElement(By.Id("eyp_legalname")); Console.WriteLine("False- CRO No. (Companies Registration Office Number) selection"); legalName.SendKeys("Pobal Automation"); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + legalName + " " + "PASSED"); } string trnKey = "Key" + TrnNo; dataStoredFile.Add(trnKey, TrnNo); Thread.Sleep(800); foreach (char c in TrnNo) { TRNnumber.SendKeys(c.ToString()); } Thread.Sleep(1000); AJAXCall.WaitForReady(webDriver); Thread.Sleep(1000); webDriver.FindElement(By.XPath("//input[@id='eyp_trn']")).Click(); Thread.Sleep(1000); Thread.Sleep(900); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.XPath("//input[@id='eyp_trn']"))); var randomRecords = Constant_functions.RandomNumGeneration(7); tcanNumber.SendKeys(randomRecords); Thread.Sleep(1000); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(900)); if (AJAXCall.IsElementPresent(By.Id("eyp_communityprivate"))) { SelectElement privateOrcommunity = new SelectElement(communityprivate); IList <IWebElement> opt_privateOrcommunity = privateOrcommunity.Options; privateOrcommunity.SelectByIndex(2); } Thread.Sleep(500); if (AJAXCall.IsElementPresent(By.Id("eyp_registeredcharity"))) { SelectElement regCharity = new SelectElement(registeredcharity); regCharity.SelectByText("No"); } OrgEmail.SendKeys(gmailAcc); var mainPh = Constant_functions.RandomNumGeneration(9); AJAXCall.WaitForReady(webDriver); Thread.Sleep(200); mainPhone.SendKeys(mainPh); Thread.Sleep(1000); TRNnumber.SendKeys(trnNo1); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + webDriver.Url + " " + "PASSED"); NextButton.Click(); AJAXCall.WaitForReady(webDriver); Thread.Sleep(600); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0,0)", ""); //((IJavaScriptExecutor)webDriver).ExecuteScript("arguments[0].scrollIntoView(true);", addressIndex); Thread.Sleep(800); AJAXCall.WaitForAjax(); if (AJAXCall.IsElementPresent(By.XPath("//*[@id='AutoAddressControl']/div/input"))) { var address = "16 Pearse Square, Greenpark Road, Bray, Co. Wicklow"; var address_0 = "17 The Blennicks, Rosses Point, Co.Silgo"; addressIndex.SendKeys(address_0); Thread.Sleep(800); webDriver.FindElement(By.CssSelector(".autoaddress-button")).Click(); Thread.Sleep(800); AJAXCall.WaitForAjax(); js.ExecuteScript("window.scrollBy(0, 250)", ""); Thread.Sleep(800); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); ReportsGeneration._test.Log(Status.Pass, address_0 + " " + "address details added successfully" + " " + "PASSED"); } Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("eyp_county")) && countyName.Displayed) { SelectElement countyName_selection = new SelectElement(countyName); countyName_selection.SelectByIndex(5); } Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.Id("NextButton"))) { NextButton.Click(); } Thread.Sleep(1000); uploadDoc.Click(); AJAXCall.WaitForAjax(); webDriver.SwitchTo().Frame(1); Thread.Sleep(1000); // docOption.Click(); SelectElement docSelection = new SelectElement(docOption); docSelection.SelectByText("Proof of ID"); AJAXCall.WaitForReady(webDriver); Thread.Sleep(1000); IWebElement upload = webDriver.FindElement(By.Id("AttachFile")); upload.SendKeys("C:\\temp\\Tech_Cities_Future_report.pdf"); Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("InsertButton"))) { webDriver.FindElement(By.Id("InsertButton")).Click(); Thread.Sleep(1000); } AJAXCall.WaitForAjax(); Thread.Sleep(500); webDriver.SwitchTo().DefaultContent(); Thread.Sleep(1000); Point loc = webDriver.FindElement(By.Id("NextButton")).Location; Console.WriteLine(loc); js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("javascript:window.scrollBy(0," + loc.Y + ")"); //js.ExecuteScript("window.scrollBy(0, 500)", ""); Thread.Sleep(1000); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + webDriver.Url + " " + "PASSED"); AJAXCall.WaitForReady(webDriver); if (AJAXCall.IsElementPresent(By.Id("NextButton"))) { Thread.Sleep(1000); NextButton.Click(); } else { js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("arguments[0].scrollIntoView();", NextButton); NextButton.Click(); } Thread.Sleep(900); // Get Parent window handle var winHandleBefore = webDriver.CurrentWindowHandle; Thread.Sleep(1000); AJAXCall.WaitForAjax(); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "facility details added successfully" + " " + "PASSED"); Thread.Sleep(1000); if (NextButton.Displayed || AJAXCall.IsElementPresent(By.Id("NextButton"))) { facilityName.SendKeys("Test"); Thread.Sleep(1000); facilityName.SendKeys(Keys.Tab); facilityName.SendKeys("Test"); facilityEmail.SendKeys(Keys.Tab); string gmailAcc_1 = Constant_functions.GetRandomAlphaNumeric() + "@yahoo.com"; facilityEmail.SendKeys(gmailAcc_1); Thread.Sleep(800); facilityNumber.SendKeys(Keys.Tab); facilityNumber.SendKeys(contactDetail); Thread.Sleep(1000); Thread.Sleep(600); NextButton.Click(); } js.ExecuteScript("window.scrollBy(0, 0)", ""); //((IJavaScriptExecutor)webDriver).ExecuteScript("arguments[0].scrollIntoView(true);", addressIndex); AJAXCall.WaitForAjax(); var address_1 = "16 Pearse Square, Greenpark Road, Bray, Co. Wicklow"; addressIndex.SendKeys(address_1); Thread.Sleep(800); webDriver.FindElement(By.CssSelector(".autoaddress-button")).Click(); Thread.Sleep(800); AJAXCall.WaitForAjax(); js.ExecuteScript("window.scrollBy(0, 250)", ""); Thread.Sleep(800); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "address details added successfully" + " " + "PASSED"); Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.Id("NextButton"))) { NextButton.Click(); } Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.Id("eyp_naionra"))) { SelectElement naionraSelect = new SelectElement(naionraSelection); naionraSelect.SelectByText("No"); } SelectElement childminderSelect = new SelectElement(childMinderSelection); childminderSelect.SelectByText("No"); SelectElement schoolpremisesSelect = new SelectElement(schoolpremisesSelection); schoolpremisesSelect.SelectByText("Yes"); SelectElement tuslaregSelect = new SelectElement(TuslaRegServiceSelection); tuslaregSelect.SelectByText("No"); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); NextButton.Click(); Thread.Sleep(1000); accept.Click(); Thread.Sleep(1000); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); NextButton.Click(); IWebElement message = webDriver.FindElement(By.Id("MessageLabel")); var mesgValue = message.Text; ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "OnBoarding Process Submitted to CRM SuccessFully with message :" + " " + mesgValue + " " + " " + "PASSED"); ReportsGeneration._test.Log(Status.Pass, MarkupHelper.CreateLabel("OnBoarding Process Submitted to CRM SuccessFully with message :" + " " + mesgValue, ExtentColor.Yellow)); } catch (Exception e) { Console.WriteLine(e.Message); ReportsGeneration._test.Log(Status.Fail, "SPP" + " " + "OnBoarding Process Failed" + " " + " " + "FAIL"); Assert.Fail(); } }
public void FeeList_Submission_SPP() { AJAXCall.WaitForAjax(); Thread.Sleep(900); CommonUtils cookiesScreen = new CommonUtils(driver); cookiesScreen.RejectAll_Cookies(); Thread.Sleep(900); SignIn_Page.Click(); Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL); userEmail.getCellData("SPP_TestData", true); UserEmail.SendKeys(Env.Email_Id); Password.SendKeys("Test@123"); WebDriverWait wait = new WebDriverWait(driver, System.TimeSpan.FromSeconds(800)); Thread.Sleep(800); SubmitButton.Click(); MyAccount_Toggle.Click(); AJAXCall.WaitForAjax(); FeesList_Link.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); EditLink.Click(); EditButton.Click(); createBox.Click(); Thread.Sleep(800); driver.SwitchTo().Frame(1); Eyp_name.SendKeys("TestAutomation"); Eyp_agerange.SendKeys("5-10"); SelectElement option = new SelectElement(Eyp_ecceavailable); option.SelectByText("Yes"); Eyp_fullpriceperweek_Text.SendKeys("100.00"); Thread.Sleep(800); Eyp_daysperweek.SendKeys("5"); Eyp_hoursperweek.SendKeys("40"); Effective_Date.SendKeys("01/11/2020"); InsertButton.Click(); AJAXCall.WaitForAjax(); driver.SwitchTo().DefaultContent(); }
public void Bank_CodeActivation(IWebDriver driver) { try { Thread.Sleep(4000); pobalOption_Select.Click(); userName.SendKeys("*****@*****.**"); userName.Clear(); userName.SendKeys("*****@*****.**"); password.SendKeys(Credentials_Data.Password); signIN.Click(); webDriver.Navigate().GoToUrl(URLConfig.CRM_SPP_Frame); Thread.Sleep(800); CRM_TabOptions.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(900); Email_Link.Click(); AJAXCall.WaitForReady(driver); Thread.Sleep(1000); webDriver.SwitchTo().Frame(0); var Email_Sequence = "//table[@id='gridBodyTable']/tbody/tr/td"; Thread.Sleep(2000); for (int i = 1; i < 100; i++) { var mesg = Email_Sequence + "[" + i + "]/nobr/a"; IWebElement wb = webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")); var EmailText = wb.Text; AJAXCall.WaitForAjax(); Thread.Sleep(1000); if (EmailText.Contains("Bank Account Validation Code")) { //webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr" + "[" + i + "]" + "/td[2]/nobr/a")).Click(); webDriver.FindElement(By.XPath("//table[@id='gridBodyTable']/tbody/tr/td[2]/nobr/a")).Click(); break; } else if (EmailText.Contains("Bank")) { Console.WriteLine(EmailText); } } Thread.Sleep(1000); webDriver.SwitchTo().DefaultContent(); IList <IWebElement> frames; frames = webDriver.FindElements(By.TagName("iframe")); int totalFrames = frames.Count; Dictionary <int, string> frameNamesIDs = new Dictionary <int, string>(); for (int i = 0; i < frames.Count; i++) { frameNamesIDs.Add(i, frames[i].GetAttribute("id").ToString()); } webDriver.SwitchTo().Frame("contentIFrame1"); Thread.Sleep(1000); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); webDriver.SwitchTo().Frame("descriptionEditIFrame"); Thread.Sleep(1000); IWebElement message = webDriver.FindElement(By.XPath("/html/body/div/p/span[2]")); //var text_link = message.GetAttribute("textContent"); var bankCode = message.GetAttribute("innerHTML"); getBankCodeString(bankCode); ReportsGeneration._test.Log(Status.Pass, " " + bankCode + " " + "PASSED"); Thread.Sleep(1000); var newVal = Constant_functions.bankCode; Excel_Suite Ex = new Excel_Suite(@"C:\Pobal_AutomationProject\Pobal_Test_Project\Automation_Suite\TestData_Repository\BankCode.xlsx"); Ex.SetBankCellData("Bank_Sheet", "BankActivationCode", newVal); // Adds resources to the resource writer. Thread.Sleep(500); js.ExecuteScript("window.scrollTo(0, document.body.scrollHeight)"); } catch (Exception e) { Console.WriteLine(e.Message); Assert.Fail("Failed"); } }
public void BankApproval() { try { AJAXCall.WaitForAjax(); Thread.Sleep(2000); tabCRM.Click(); Thread.Sleep(1500); BankAccount_Link.Click(); Thread.Sleep(2000); webDriver.SwitchTo().ParentFrame(); Thread.Sleep(2000); webDriver.SwitchTo().Frame(0); //webDriver.FindElement(By.Id("crmGrid_findHintText")).Click(); Thread.Sleep(500); webDriver.FindElement(By.Id("crmGrid_findCriteria")).Click(); Thread.Sleep(500); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("crmGrid_findCriteria")) || crmGrid_FindCriteria.Displayed) { //crmSearchGrid.Click(); IWebElement clickwebforms = webDriver.FindElement(By.Id("crmGrid_findCriteria")); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); IWebElement wb = webDriver.FindElement(By.Id("crmGrid_findHintText")); var value = wb.GetAttribute("style"); AJAXCall.WaitForAjax(); if (value.Contains("display: none;")) { AJAXCall.WaitForAjax(); clickwebforms.Click(); if (value.Contains("display: none;")) { Thread.Sleep(1000); clickwebforms.Click(); Excel_Suite ex = new Excel_Suite(Env.BANK_NAME); ex.getBankAccount("BankName"); Thread.Sleep(900); clickwebforms.SendKeys(Env.BankName); Thread.Sleep(1000); clickwebforms.SendKeys(Keys.Enter); AJAXCall.WaitForAjax(); arrowDown.Click(); Thread.Sleep(1000); arrowDown.Click(); } } else { Thread.Sleep(1000); clickwebforms.Click(); if (value.Contains("display: inline;")) { Thread.Sleep(1000); clickwebforms.Click(); Excel_Suite ex = new Excel_Suite(Env.BANK_NAME); ex.getBankAccount("BankName"); Thread.Sleep(900); clickwebforms.SendKeys(Env.BankName); Thread.Sleep(1000); clickwebforms.SendKeys(Keys.Enter); Thread.Sleep(1000); arrowDown.Click(); Thread.Sleep(1000); arrowDown.Click(); } } } Thread.Sleep(1000); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); CRM_UAT_ServiceProviderPortal_Page bankAccSearch = new CRM_UAT_ServiceProviderPortal_Page(webDriver); bankAccSearch.OnBoardingAdmin(); webDriver.SwitchTo().DefaultContent(); Thread.Sleep(2000); webDriver.SwitchTo().Frame("contentIFrame1"); Thread.Sleep(5000); /* if (AJAXCall.IsElementPresent(By.XPath("//*[@id='FormSecNavigationControl - Icon']"))) * { * * NavigationFlyOut_Button.Click(); * Review_Click.Click(); * } * * else * { * Actions action = new Actions(webDriver); * action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform(); * } */ crmContentLink.Click(); IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0, 380)", ""); Thread.Sleep(3000); Thread.Sleep(1000); IWebElement chkBox_td = webDriver.FindElement(By.Id("eyp_markasapproved_d")); var td = chkBox_td.GetAttribute("class"); Thread.Sleep(2000); approve_chkBox.Click(); /*if(value_box.Contains("display: inline-block;")) * { * approve_chkbox.Click(); * * } */ AJAXCall.WaitForAjax(); Thread.Sleep(1000); webDriver.SwitchTo().ParentFrame(); AJAXCall.WaitForAjax(); Thread.Sleep(800); SaveAndClose.Click(); webDriver.SwitchTo().Frame(1); AJAXCall.WaitForAjax(); js.ExecuteScript("window.scrollBy(0,250)", ""); } catch (Exception e) { Console.WriteLine(e.Message); } }
public void ServiceCalendar_Page() { CommonUtils cookieIgnore = new CommonUtils(webDriver); cookieIgnore.RejectAll_Cookies(); SignIn_Page.Click(); Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL); userEmail.getCellData("SPP_TestData", true); UserEmail.SendKeys(Env.Email_Id); Password.SendKeys("Test@123"); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); System.Threading.Thread.Sleep(800); SubmitButton.Click(); Thread.Sleep(1000); MyAccount_Toggle.Click(); AJAXCall.WaitForAjax(); ServiceCalendar_Tab.Click(); CreateCalendar.Click(); SelectElement ProgCell = new SelectElement(Eyp_programmecall); var ECCE2021 = "ECCE 2021"; var ECCE2022 = "ECCE 2022"; var NCS2020 = "NCS 2020"; var NCS2021 = "NCS 2021"; var NCS2022 = "NCS 2022"; ProgCell.SelectByText(NCS2020); Thread.Sleep(800); NextButton.Click(); var startDate = "09:00"; var closeDate = "12:00"; Eyp_monopeningtime.SendKeys(startDate); Eyp_monclosingtime.SendKeys(closeDate); Eyp_tueopeningtime.SendKeys(startDate); Eyp_tueclosingtime.SendKeys(closeDate); Eyp_wedopeningtime.SendKeys(startDate); Eyp_wedclosingtime.SendKeys(closeDate); Eyp_thuopeningtime.SendKeys(startDate); Eyp_thuclosingtime.SendKeys(closeDate); Eyp_friopeningtime.SendKeys(startDate); Eyp_friclosingtime.SendKeys(closeDate); Thread.Sleep(800); NextButton.Click(); }
public void SearchThroughAccountName(IWebDriver driver) { SignIn_Page.Click(); UserEmail.SendKeys("*****@*****.**"); Password.SendKeys("Test@123"); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(800)); Thread.Sleep(800); SubmitButton.Click(); MyAccount_Toggle.Click(); BankAccount_Page.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); downArrow.Click(); wait = new WebDriverWait(driver, TimeSpan.FromSeconds(900)); Thread.Sleep(1000); EditLink.Click(); Actions action = new Actions(driver); action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform(); NextButton.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(2000); if (AJAXCall.IsElementPresent(By.PartialLinkText("Upload Document"))) { action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform(); NextButton.Click(); } else { Thread.Sleep(1000); } AJAXCall.WaitForAjax(); Thread.Sleep(1000); Thread.Sleep(2000); wait = new WebDriverWait(driver, TimeSpan.FromSeconds(100)); if (AJAXCall.IsElementPresent(By.Id("eyp_validationcode"))) { Excel_Suite read_BankCode = new Excel_Suite(@"C:\Pobal_AutomationProject\Pobal_Test_Project\Automation_Suite\TestData_Repository\BankCode.xlsx"); read_BankCode.getCellData("Bank_Sheet", false); IWebElement value_Code = driver.FindElement(By.XPath("//*[@id='eyp_validationcode']")); value_Code.Click(); value_Code.Clear(); Thread.Sleep(2000); value_Code.SendKeys(Keys.Tab); value_Code.SendKeys(Env.Data_Retrieve); } NextButton.Click(); }
public void SP_Portal_SignIN_Submit(IWebDriver driver) { CommonUtils Cu = new CommonUtils(driver); Cu.AcceptAll_Cookies(); SignIn_Page.Click(); Thread.Sleep(900); Excel_Suite userEmail = new Excel_Suite(Env.EXCEL_TEST_URL); userEmail.getCellData("SPP_TestData", true); UserEmail.SendKeys(Env.Email_Id); // UserEmail.SendKeys(Constant_functions.UserEmailId); Password.SendKeys("Test@123"); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(800)); SubmitButton.Click(); MyAccount_Toggle.Click(); BankAccount_Page.Click(); ReportsGeneration._test.Log(Status.Pass, " " + " " + driver.Url + " " + "pageload is working fine"); BankAccountLink_Button.Click(); Thread.Sleep(1000); Excel_Suite Es = new Excel_Suite(Env.EXCEL_BANK_DATA); ExcelData bankData = Es.getBankData("Sheet1"); SelectElement bankBranchOption = new SelectElement(DropDown_Bank); if (bankData != null) { accountName.SendKeys(bankData.AccountName); List <string> bankNames = new List <string> { "AIB", "An Post", "Bank of Ireland", "First Active", "ING Bank", "Aareal Bank AG", "Bank of America Merrill Lynch International Ltd", "Ulster Bank" }; Thread.Sleep(800); IList <IWebElement> bankNames_1 = bankBranchOption.Options; DropDown_Bank.Click(); wait = new WebDriverWait(driver, TimeSpan.FromSeconds(900)); string val = ""; Thread.Sleep(1000); foreach (var bankNameText in bankNames) { if (bankNameText.Contains(bankData.BankName)) { val = bankNameText; if (AJAXCall.IsElementPresent(By.Id("eyp_bank"))) { bankBranchOption.SelectByText(val); } } else { bankBranchOption.SelectByIndex(4); break; } } Thread.Sleep(1000); foreach (char c in bankData.IBAN1) { iban_text.SendKeys(c.ToString()); } Bank_branch.SendKeys(bankData.BankBranch); Accountnumber.SendKeys(bankData.AccountNumber); Thread.Sleep(600); foreach (char s in bankData.BIC) { BIC_Num.SendKeys(s.ToString()); } Thread.Sleep(600); sortCode.SendKeys(bankData.SortCode); } wait = new WebDriverWait(driver, TimeSpan.FromSeconds(900)); NextButton.Click(); AJAXCall.WaitForReady(driver); Thread.Sleep(1000); Upload_Document.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); driver.SwitchTo().Frame(1); SelectElement doc = new SelectElement(dropdown_documenttypeid); doc.SelectByText("Bank Account Statement"); Thread.Sleep(500); AJAXCall.WaitForAjax(); IWebElement upload = driver.FindElement(By.Id("AttachFile")); upload.SendKeys("C:\\temp\\Tech_Cities_Future_report.pdf"); upload_Btn.Click(); Thread.Sleep(1000); AJAXCall.WaitForReady(driver); driver.SwitchTo().DefaultContent(); Thread.Sleep(1000); IJavaScriptExecutor js = (IJavaScriptExecutor)driver; js.ExecuteScript("window.scrollBy(0, 500)", ""); js.ExecuteScript("arguments[0].scrollIntoView();", NextButton); if (AJAXCall.IsElementPresent(By.Id("NextButton"))) { NextButton.Click(); } else { IJavaScriptExecutor jse = (IJavaScriptExecutor)driver; jse = (IJavaScriptExecutor)driver; jse.ExecuteScript("arguments[0].scrollIntoView();", NextButton); } ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + driver.Url + " " + "PASSED"); Thread.Sleep(700); }
public void TuslaCRM_Approval() { webDriver.Navigate().GoToUrl(URLConfig.CRM_SPP_Frame); Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.CssSelector(".idp:nth-child(4) .largeTextNoWrap"))) { pobalOption_Select.Click(); } userName.SendKeys(Credentials_Data.UserName); password.SendKeys(Credentials_Data.Password); signIN.Click(); AJAXCall.WaitForReady(webDriver); Thread.Sleep(1000); CRM_TabOptions.Click(); Thread.Sleep(1500); tuslaTab.Click(); Thread.Sleep(500); webDriver.SwitchTo().DefaultContent(); Thread.Sleep(2000); //webDriver.SwitchTo().Frame("contentIFrame1"); webDriver.SwitchTo().Frame(0); Thread.Sleep(500); ViewSelectorContainer.Click(); webDriver.FindElement(By.Id("crmGrid_findCriteria")).Click(); Thread.Sleep(500); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("crmGrid_findCriteria")) || crmGrid_FindCriteria.Displayed) { //crmSearchGrid.Click(); IWebElement clickwebforms = webDriver.FindElement(By.Id("crmGrid_findCriteria")); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); IWebElement wb = webDriver.FindElement(By.Id("crmGrid_findHintText")); var value = wb.GetAttribute("style"); AJAXCall.WaitForAjax(); if (value.Contains("display: none;")) { AJAXCall.WaitForAjax(); clickwebforms.Click(); if (value.Contains("display: none;")) { Thread.Sleep(1000); clickwebforms.Click(); Thread.Sleep(900); clickwebforms.SendKeys(Constant_functions.tuslaNumber); AJAXCall.WaitForAjax(); clickwebforms.SendKeys(Keys.Enter); Thread.Sleep(1000); } } else { Thread.Sleep(1000); clickwebforms.Click(); if (value.Contains("display: inline;")) { Thread.Sleep(1000); clickwebforms.Click(); Thread.Sleep(900); clickwebforms.SendKeys(Constant_functions.tuslaNumber); AJAXCall.WaitForAjax(); Thread.Sleep(1000); clickwebforms.SendKeys(Keys.Enter); Thread.Sleep(1000); } } } Thread.Sleep(1000); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(800)); CRM_UAT_ServiceProviderPortal_Page tuslaCRMPage = new CRM_UAT_ServiceProviderPortal_Page(webDriver); tuslaCRMPage.OnBoardingAdmin(); webDriver.SwitchTo().DefaultContent(); Thread.Sleep(2000); webDriver.SwitchTo().Frame(0); webDriver.SwitchTo().ParentFrame(); Thread.Sleep(2000); webDriver.SwitchTo().Frame(1); Thread.Sleep(2000); Thread.Sleep(2000); if (AJAXCall.IsElementPresent(By.XPath("//*[@id='FormSecNavigationControl - Icon']"))) { NavigationFlyOut_Button.Click(); Review_Click.Click(); } else { Actions action = new Actions(webDriver); action.KeyDown(Keys.Control).SendKeys(Keys.End).Perform(); } IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0,250)", ""); Thread.Sleep(1000); IWebElement chkBox_td = webDriver.FindElement(By.Id("eyp_markasapproved_d")); var td = chkBox_td.GetAttribute("class"); Thread.Sleep(2000); approve_chkBox.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); webDriver.SwitchTo().DefaultContent(); AJAXCall.WaitForAjax(); Thread.Sleep(800); SaveAndClose.Click(); webDriver.SwitchTo().Frame(1); Thread.Sleep(1000); // webDriver.SwitchTo().DefaultContent(); AJAXCall.WaitForAjax(); }
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")); }
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 OnBoardingWithDifferentOptions(IWebDriver webDriver) { try { var oPropDict = ExcelUtil.poupulateHashFromExcel("TestData", "SPP_TestData"); WebDriverWait web = new WebDriverWait(webDriver, TimeSpan.FromSeconds(100)); Assert.IsTrue(true, "Onboarding Page"); webDriver.FindElement(By.XPath("//a[contains(text(),'Start On-Boarding Process')]")).Click(); WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(500)); // Timeout in seconds wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); AJAXCall.WaitForAjax(); this.NextButton.Click(); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + webDriver.Url + " " + "PASSED"); SelectElement oSelect_1 = new SelectElement(webDriver.FindElement(By.Id("eyp_legalstructure"))); IList <IWebElement> elementCount = oSelect_1.Options; Console.Write(elementCount.Count); //string value = "Designated Activity Company Limited by Guarantee"; string value_1 = "Private Unlimited Company"; string value_2 = "Partnership"; string value_3 = "Sole Trader"; string value_4 = "Limited Company with Share Capital"; var legalStructValue = ""; foreach (IWebElement selection in elementCount) { if (selection.Text.Contains(value_3) || selection.Text.Contains(value_3) || selection.Text.Contains(value_3) || selection.Text.Contains(value_3) || selection.Text.Contains(value_3) ) { oSelect_1.SelectByText(selection.Text); legalStructValue = selection.Text; break; } } ReportsGeneration._test.Log(Status.Pass, " " + legalStructValue + " " + "select by text is pass"); this.TypeofOrg.Click(); SelectElement oSelect_2 = new SelectElement(TypeofOrg); IList <IWebElement> opt = oSelect_2.Options; Console.Write(opt.Count); string val = "New Organisation"; ReportsGeneration._test.Log(Status.Pass, val); Thread.Sleep(200); oSelect_2.SelectByText(val); ReportsGeneration._test.Log(Status.Pass, val + " " + "dropdown is working fine"); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "legal option" + legalStructValue + " " + "PASSED"); this.NextButton.Click(); firstName.SendKeys("Automation"); lastName.SendKeys("Test"); string gmailAcc = Constant_functions.GetRandomAlphaNumeric() + "@yahoo.com"; email.SendKeys(gmailAcc); confirmEmail.SendKeys(gmailAcc); var contactDetail = Constant_functions.RandomNumGeneration(9); contactNo.SendKeys(contactDetail); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "contact details added successfully" + " " + "PASSED"); this.NextButton.Click(); AJAXCall.WaitForReady(webDriver); var croNumber = Constant_functions.RandomNumGeneration(3); Thread.Sleep(500); if (AJAXCall.IsElementPresent(By.XPath("//*[@id='eyp_crono']"))) { wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(400)); croNum.SendKeys("108"); croNum.SendKeys(croNumber); IWebElement CRONO = webDriver.FindElement(By.Id("eyp_crono")); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + CRONO + " " + "PASSED"); } else if (AJAXCall.IsElementPresent(By.Id("eyp_legalname"))) { IWebElement legalName = webDriver.FindElement(By.Id("eyp_legalname")); Console.WriteLine("No CRO No. (Companies Registration Office Number) selection"); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + legalName + " " + "PASSED"); } var trnNo1 = Constant_functions.randomString(2); var s = Constant_functions.RandomNumGeneration(7); //s += trnNo1; string TrnNo = s + "XZ"; AJAXCall.WaitForReady(webDriver); Thread.Sleep(1000); webDriver.FindElement(By.XPath("//input[@id='eyp_trn']")).Click(); Thread.Sleep(1000); webDriver.FindElement(By.XPath("//input[@id='eyp_trn']")).SendKeys(s + trnNo1); //TRNnumber.SendKeys(trnNo1); var randomRecords = Constant_functions.RandomNumGeneration(7); tcanNumber.SendKeys(randomRecords); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.XPath("//input[@id='eyp_trn']"))); webDriver.FindElement(By.XPath("//input[@id='eyp_trn']")).SendKeys("WD"); if (AJAXCall.IsElementPresent(By.Id("eyp_communityprivate"))) { SelectElement privateOrcommunity = new SelectElement(communityprivate); IList <IWebElement> opt_privateOrcommunity = privateOrcommunity.Options; privateOrcommunity.SelectByIndex(2); } if (AJAXCall.IsElementPresent(By.Id("eyp_registeredcharity"))) { SelectElement regCharity = new SelectElement(registeredcharity); regCharity.SelectByText("No"); } OrgEmail.SendKeys(gmailAcc); var mainPh = Constant_functions.RandomNumGeneration(9); AJAXCall.WaitForReady(webDriver); Thread.Sleep(200); mainPhone.SendKeys(mainPh); Thread.Sleep(500); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + webDriver.Url + " " + "PASSED"); NextButton.Click(); /* if (AJAXCall.IsElementPresent(By.Id("eyp_county"))) * { * * SelectElement countyNameEnter = new SelectElement(countyName); * countyNameEnter.SelectByText("Dublin"); * * AJAXCall.WaitForReady(webDriver); * Thread.Sleep(200); * NextButton.Click(); * } */ IJavaScriptExecutor js = (IJavaScriptExecutor)webDriver; js.ExecuteScript("window.scrollBy(0,0)", ""); //((IJavaScriptExecutor)webDriver).ExecuteScript("arguments[0].scrollIntoView(true);", addressIndex); Thread.Sleep(800); AJAXCall.WaitForAjax(); var address = "16 Pearse Square, Greenpark Road, Bray, Co. Wicklow"; var address_0 = "17 The Blennicks, Rosses Point, Co.Silgo"; addressIndex.SendKeys(address_0); Thread.Sleep(800); webDriver.FindElement(By.CssSelector(".autoaddress-button")).Click(); Thread.Sleep(800); AJAXCall.WaitForAjax(); js.ExecuteScript("window.scrollBy(0, 250)", ""); Thread.Sleep(800); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); ReportsGeneration._test.Log(Status.Pass, address_0 + " " + "address details added successfully" + " " + "PASSED"); Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.Id("NextButton"))) { NextButton.Click(); } Thread.Sleep(800); AJAXCall.WaitForReady(webDriver); Thread.Sleep(600); Thread.Sleep(600); uploadDoc.Click(); AJAXCall.WaitForReady(webDriver); Thread.Sleep(1000); webDriver.SwitchTo().Frame(1); // Thread.Sleep(500); wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(500)); // docOption.Click(); SelectElement docSelection = new SelectElement(docOption); docSelection.SelectByText("Proof of ID"); AJAXCall.WaitForReady(webDriver); IWebElement upload = webDriver.FindElement(By.Id("AttachFile")); upload.SendKeys("C:\\temp\\Tech_Cities_Future_report.pdf"); submit.Click(); AJAXCall.WaitForAjax(); Thread.Sleep(1000); if (AJAXCall.IsElementPresent(By.Id("InsertButton"))) { submit.Click(); } else { Console.WriteLine("cursor is in parent window"); } Thread.Sleep(1000); // Get Parent window handle var winHandleBefore = webDriver.CurrentWindowHandle; foreach (var winHandle in webDriver.WindowHandles) { // Switch to parent window webDriver.SwitchTo().DefaultContent(); } // AJAXCall.WaitForAjax(); Thread.Sleep(1000); js.ExecuteScript("window.scrollBy(0,250)", ""); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + webDriver.Url + " " + "PASSED"); if (NextButton.Displayed || AJAXCall.IsElementPresent(By.Id("NextButton"))) { NextButton.Click(); } Thread.Sleep(500); AJAXCall.WaitForAjax(); facilityName.SendKeys("Test"); string gmailAcc_1 = Constant_functions.GetRandomAlphaNumeric() + "@yahoo.com"; facilityEmail.SendKeys(gmailAcc_1); facilityNumber.SendKeys(contactDetail); AJAXCall.WaitForAjax(); ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "facility details added successfully" + " " + "PASSED"); NextButton.Click(); Thread.Sleep(800); js.ExecuteScript("window.scrollBy(0,0)", ""); //((IJavaScriptExecutor)webDriver).ExecuteScript("arguments[0].scrollIntoView(true);", addressIndex); Thread.Sleep(800); AJAXCall.WaitForAjax(); address = "16 Pearse Square, Greenpark Road, Bray, Co. Wicklow"; address_0 = "17 The Blennicks, Rosses Point, Co.Silgo"; addressIndex.SendKeys(address_0); Thread.Sleep(800); webDriver.FindElement(By.CssSelector(".autoaddress-button")).Click(); Thread.Sleep(800); AJAXCall.WaitForAjax(); js.ExecuteScript("window.scrollBy(0, 250)", ""); Thread.Sleep(800); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); ReportsGeneration._test.Log(Status.Pass, address_0 + " " + "address details added successfully" + " " + "PASSED"); Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.Id("NextButton"))) { NextButton.Click(); } Thread.Sleep(800); if (AJAXCall.IsElementPresent(By.Id("eyp_naionra"))) { SelectElement naionraSelect = new SelectElement(naionraSelection); naionraSelect.SelectByText("No"); } SelectElement childminderSelect = new SelectElement(childMinderSelection); childminderSelect.SelectByText("No"); SelectElement schoolpremisesSelect = new SelectElement(schoolpremisesSelection); schoolpremisesSelect.SelectByText("Yes"); SelectElement tuslaregSelect = new SelectElement(TuslaRegServiceSelection); tuslaregSelect.SelectByText("No"); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); NextButton.Click(); accept.Click(); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementExists(By.Id("NextButton"))); NextButton.Click(); IWebElement message = webDriver.FindElement(By.Id("MessageLabel")); var mesgValue = message.Text; ReportsGeneration._test.Log(Status.Pass, "SPP" + " " + "OnBoarding Process Submitted to CRM SuccessFully with message :" + " " + mesgValue + " " + " " + "PASSED"); ReportsGeneration._test.Log(Status.Pass, MarkupHelper.CreateLabel("OnBoarding Process Submitted to CRM SuccessFully with message :" + " " + mesgValue, ExtentColor.Yellow)); // webUtility.inputTextByID(oPropDict["Customer_Name"], ExcelUtil.GetData("CustName")); } catch (Exception e) { Console.WriteLine(e.Message); ReportsGeneration._test.Log(Status.Fail, "SPP" + " " + "OnBoarding Process Failed" + " " + "FAIL"); Assert.Fail(); } }