public AutoFillDto GetAutoFillData(int clientPaymentTransactionID) { AutoFillDto autoFillDto = null; HttpResponseMessage response = new HttpResponseMessage(); response = client.GetAsync("AutoFill/" + clientPaymentTransactionID).Result; if (response.IsSuccessStatusCode) { autoFillDto = response.Content.ReadAsAsync <AutoFillDto>().Result; } return(autoFillDto); }
private bool AutoFillForm26Q(int clientPaymentTransactionID) { AutoFillDto autoFillDto = svc.GetAutoFillData(clientPaymentTransactionID); if (autoFillDto == null) { MessageBox.Show("Data is not available to proceed Form26QB", "alert", MessageBoxButton.OK); return(false);; } var bankLogin = svc.GetBankLoginDetails(); FillForm26Q.AutoFillForm26QB(autoFillDto, tds, bankLogin); return(true); }
public static void AutoFillForm26QB(AutoFillDto autoFillDto, string tds, BankAccountDetailsDto bankLogin) { try { _bankLogin = bankLogin; var driver = GetChromeDriver(); // var driver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory, options); //var driver = new ChromeDriver(options); //driver.Manage().Window.Maximize(); driver.Navigate().GoToUrl("https://onlineservices.tin.egov-nsdl.com/etaxnew/tdsnontds.jsp"); WaitForReady(driver); // var proceedBtn = driver.FindElement(By.XPath("//a[@href='javascript:sendRequest(\'PropertyTaxForm\');']")); driver.FindElement(By.XPath("//*[@id='selectform']/div[3]/div[1]/section/div/div/a")).Click(); //todo improve xpath // MessageBoxResult result = MessageBox.Show("PLease fill the capcha and press ok button", "Confirmation", MessageBoxButton.YesNo); WaitForReady(driver); FillTaxPayerInfo(driver, autoFillDto.tab1); WaitForReady(driver); FillAddress(driver, autoFillDto.tab2); WaitForReady(driver); FillPropertyinfo(driver, autoFillDto.tab3); WaitForReady(driver); FillPaymentinfo(driver, autoFillDto.tab4); WaitForReady(driver); ProcessToBank(driver, tds); } catch (Exception e) { Console.WriteLine(e); MessageBox.Show("Processing Form26QB Failed"); // throw; } }