public AutoFillDto() { tab1 = new Tab1(); tab2 = new Tab2(); tab3 = new Tab3(); tab4 = new Tab4(); }
private static void FillPaymentinfo(IWebDriver webDriver, Tab4 tab4) { var modePofPay = ""; if (tab4.ModeOfPayment == "modeBankSelection") { modePofPay = "onlineRadio"; } else { modePofPay = "offlineRadio"; } var address1 = webDriver.FindElement(By.Id(modePofPay)); address1.Click(); if (modePofPay == "onlineRadio") { var bank = webDriver.FindElement(By.Id("NetBank_Name_c")); var bankDDl = new SelectElement(bank); bankDDl.SelectByText("ICICI Bank"); } MessageBoxResult result = MessageBox.Show("Please fill the captcha and press OK button.", "Confirmation", MessageBoxButton.OK, MessageBoxImage.Asterisk, MessageBoxResult.OK, MessageBoxOptions.DefaultDesktopOnly); var proceedBtn = webDriver.FindElement(By.XPath("//a[@href='#finish']")); proceedBtn.Click(); WaitForReady(webDriver); var confirmCheck = webDriver.FindElement(By.Id("consentCheck")); confirmCheck.Click(); var confirmBtn = webDriver.FindElement(By.Id("Submit")); confirmBtn.Click(); WaitForReady(webDriver); WaitFor(webDriver, 3); // new WebDriverWait(webDriver, TimeSpan.FromSeconds(60)).Until(ExpectedConditions.ElementExists(By.XPath("//button[@data-dismiss='modal']"))); var closeBtn = webDriver.FindElement(By.XPath("//button[@data-dismiss='modal']")); closeBtn.Click(); WaitForReady(webDriver); WaitFor(webDriver, 3); var submitToBankBtn = webDriver.FindElement(By.Id("Submit")); submitToBankBtn.Click(); WaitForReady(webDriver); //var day = webDriver.FindElement(By.Name("pymntDay")); //day.Click(); //var dayDDl = new SelectElement(day); //dayDDl.SelectByText(tab4.DateOfPayment.Day.ToString()); //var month = webDriver.FindElement(By.Name("pymntMonth")); //var monthDDl = new SelectElement(month); //monthDDl.SelectByText(tab4.DateOfPayment.Month.ToString()); //var year = webDriver.FindElement(By.Name("pymntYear")); //var yearDDl = new SelectElement(year); //yearDDl.SelectByText(tab4.DateOfPayment.Year.ToString()); //var dayDeduction = webDriver.FindElement(By.Name("deductionDay")); //dayDeduction.Click(); //var dayDeductionDDl = new SelectElement(dayDeduction); //dayDeductionDDl.SelectByText(tab4.DateOfTaxDeduction.Day.ToString()); //var monthDeduction = webDriver.FindElement(By.Name("deductionMonth")); //var monthDeductionDDl = new SelectElement(monthDeduction); //monthDeductionDDl.SelectByText(tab4.DateOfTaxDeduction.Month.ToString()); //var yearDeduction = webDriver.FindElement(By.Name("deductionYear")); //var yearDeductionDDl = new SelectElement(yearDeduction); //yearDeductionDDl.SelectByText(tab4.DateOfTaxDeduction.Year.ToString()); }