//Submit Account Number and Date of Birth public AccountSummaryPage Submit(FileReader fileObj) { txtAccountNumber.SendKeys(fileObj.info(2)); txtDOB1.SendKeys(fileObj.info(3)); btnSubmit.Click(); return new AccountSummaryPage("btnMakePayment"); }
//Login Credentials public SecureLoginPage Login(FileReader fileObj) { txtUserID.SendKeys(fileObj.info(0)); txtPassword.SendKeys(fileObj.info(1)); btnLogin.Submit(); return new SecureLoginPage("account-number"); }
public static void Main(string[] args) { //Initialize browser PropertiesCollection.driver = new FirefoxDriver(); Console.WriteLine("Opened Browser"); //Read File FileReader file = new FileReader(); file.ReadFile("e:/Documents/Programs/C#/LoanPaymentAutomationTests/info.txt"); //Navigate to Loan Site PropertiesCollection.driver.Navigate().GoToUrl(file.info(11)); //Login through 2 pages LoginPage page1 = new LoginPage("user-id"); SecureLoginPage page2 = page1.Login(file); //Make payments and submit AccountSummaryPage page3 = page2.Submit(file); MakeAPaymentPage page4 = page3.MakeAPayment(); SpecialPaymentPage page5 = page4.SubmitPayment(file); PaymentPreviewPage page6 = page5.Next(); page6.btnSubmit.Click(); //Close browser PropertiesCollection.driver.Close(); Console.WriteLine("Close the browser"); Log(); }
//Enter values for each loan and submit public SpecialPaymentPage SubmitPayment(FileReader fileObj) { txtAmount1.Clear(); txtAmount1.SendKeys(fileObj.info(4)); txtAmount2.Clear(); txtAmount2.SendKeys(fileObj.info(5)); txtAmount3.Clear(); txtAmount3.SendKeys(fileObj.info(6)); txtAmount4.Clear(); txtAmount4.SendKeys(fileObj.info(7)); txtAmount5.Clear(); txtAmount5.SendKeys(fileObj.info(8)); txtAmount6.Clear(); txtAmount6.SendKeys(fileObj.info(9)); txtAmount7.Clear(); txtAmount7.SendKeys(fileObj.info(10)); btnNext.Click(); return new SpecialPaymentPage(); }