public void securedDetais(string orderNumber, string parcelNumber) { try { Tax_Year = driver.FindElement(By.Id("PaymentApplicationContent_divTaxBillYear")).Text; Current_Owner = driver.FindElement(By.Id("CurrentOwner")).Text; Current_Owner = WebDriverTest.After(Current_Owner, "OWNER"); Tax_Type = driver.FindElement(By.Id("display-section-header")).Text; Secured_Details = Current_Owner + "~" + Tax_Year + "~" + Tax_Type + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + "" + "~" + ""; gc.insert_date(orderNumber, parcelNumber, 952, Secured_Details, 1, DateTime.Now); IWebElement TaxHistoryTB = driver.FindElement(By.XPath("//*[@id='PaymentApplicationContent_dataTableSecured']/tbody")); IList <IWebElement> TaxHistoryTR = TaxHistoryTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxHistoryTD; foreach (IWebElement TaxHistory in TaxHistoryTR) { TaxHistoryTD = TaxHistory.FindElements(By.TagName("td")); if (TaxHistoryTD.Count != 0 && !TaxHistory.Text.Contains("Parcel Number") && TaxHistoryTD.Count != 6) { Parcel_No = TaxHistoryTD[0].Text; Installment = TaxHistoryTD[1].Text; Installment_Amount = TaxHistoryTD[2].Text; Deliquent_After = TaxHistoryTD[3].Text; Status = TaxHistoryTD[4].Text; Amount_Due = TaxHistoryTD[5].Text; Total_Due = TaxHistoryTD[6].Text; Secured_Details1 = "" + "~" + "" + "~" + "" + "~" + Installment + "~" + Installment_Amount + "~" + Deliquent_After + "~" + Status + "~" + Amount_Due + "~" + Total_Due; gc.insert_date(orderNumber, Parcel_No, 952, Secured_Details1, 1, DateTime.Now); } if (TaxHistoryTD.Count == 6) { Installment1 = TaxHistoryTD[0].Text; Installment_Amount1 = TaxHistoryTD[1].Text; Deliquent_After1 = TaxHistoryTD[2].Text; Status1 = TaxHistoryTD[3].Text; Amount_Due1 = TaxHistoryTD[4].Text; Total_Due1 = TaxHistoryTD[5].Text; Secured_Details2 = "" + "~" + "" + "~" + "" + "~" + Installment1 + "~" + Installment_Amount1 + "~" + Deliquent_After1 + "~" + Status1 + "~" + Amount_Due1 + "~" + Total_Due1; gc.CreatePdf(orderNumber, Parcel_No, "Secured Details" + Tax_Year, driver, "CA", "San Diego"); gc.insert_date(orderNumber, Parcel_No, 952, Secured_Details2, 1, DateTime.Now); } } } catch { } }
public string FTP_CASantaClara(string address, string assessment_id, string parcelNumber, string searchType, string orderNumber, string directParcel, string ownername) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; //var driverService = PhantomJSDriverService.CreateDefaultService(); //driverService.HideCommandPromptWindow = true; // driver = new PhantomJSDriver(); //driver = new ChromeDriver(); var option = new ChromeOptions(); option.AddArgument("No-Sandbox"); using (driver = new ChromeDriver(option)) { try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, "", "CA", "Santa Clara"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_CASantaClara"] = "Zero"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { try { driver.Navigate().GoToUrl("https://www.sccassessor.org/index.php/online-services/property-search/real-property"); Thread.Sleep(2000); IWebElement iframeElementAdd = driver.FindElement(By.XPath("//*[@id='blockrandom']")); driver.SwitchTo().Frame(iframeElementAdd); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id='searchinput']")).SendKeys(address); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "CA", "Santa Clara"); driver.FindElement(By.Id("btnAddress")).SendKeys(Keys.Enter); Thread.Sleep(4000); //MultiParcel try { IWebElement MultiTable = driver.FindElement(By.XPath("//*[@id='asrGrid']/div[2]/table/tbody")); IList <IWebElement> MultiTR = MultiTable.FindElements(By.TagName("tr")); IList <IWebElement> MultiTD; gc.CreatePdf_WOP(orderNumber, "Multi Address search", driver, "CA", "Santa Clara"); int maxCheck = 0; foreach (IWebElement multi in MultiTR) { if (maxCheck <= 25) { MultiTD = multi.FindElements(By.TagName("td")); if (MultiTD.Count != 0) { parcelNumber = MultiTD[0].Text; property_Address = MultiTD[1].Text; MultiParcelData = property_Address; gc.insert_date(orderNumber, parcelNumber, 547, MultiParcelData, 1, DateTime.Now); } maxCheck++; } } if (MultiTR.Count > 25) { HttpContext.Current.Session["multiParcel_SantaClara_Multicount"] = "Maximum"; } else { HttpContext.Current.Session["multiparcel_SantaClara"] = "Yes"; } driver.Quit(); return("MultiParcel"); } catch { } } catch { } try { //No Data Found string nodata = driver.FindElement(By.XPath("//*[@id='ContentMasterPage_lblError']/div")).Text; if (nodata.Contains("No records meet your search criteria:")) { HttpContext.Current.Session["Nodata_CASantaClara"] = "Zero"; driver.Quit(); return("No Data Found"); } } catch { } try { //No Data Found string nodata = driver.FindElement(By.XPath("//*[@id='ui-id-1']")).Text; if (nodata.Contains("No Such Address")) { HttpContext.Current.Session["Nodata_CASantaClara"] = "Zero"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { try { driver.Navigate().GoToUrl("https://www.sccassessor.org/index.php/online-services/property-search/real-property"); Thread.Sleep(2000); IWebElement iframeElement1 = driver.FindElement(By.XPath("//*[@id='blockrandom']")); driver.SwitchTo().Frame(iframeElement1); Thread.Sleep(2000); driver.FindElement(By.XPath("//*[@id='myTab-accordion']/div[3]/div[1]/h4/a")).Click(); Thread.Sleep(2000); driver.FindElement(By.Id("apninput")).SendKeys(parcelNumber); gc.CreatePdf_WOP(parcelNumber, "Parcel search", driver, "CA", "Santa Clara"); driver.FindElement(By.Id("btnAPN")).SendKeys(Keys.Enter); Thread.Sleep(4000); try { //No Data Found string nodata = driver.FindElement(By.XPath("//*[@id='ContentMasterPage_lblError']/div")).Text; if (nodata.Contains("No records meet your search criteria:")) { HttpContext.Current.Session["Nodata_CASantaClara"] = "Zero"; driver.Quit(); return("No Data Found"); } } catch { } } catch { } } //Property Details parcelno = driver.FindElement(By.XPath("//*[@id='divFrame']/div[1]/div/div[1]")).Text; parcelno = WebDriverTest.After(parcelno, ":").Replace("\r\n", " ").Trim(); Property_Address = driver.FindElement(By.XPath("//*[@id='oneAddress']/div/div[1]/div")).Text; //Assessment Deatils Tax_Default_Date = driver.FindElement(By.XPath("//*[@id='tab-1-collapse']/div/div/div[1]/div/div/div/table/tbody/tr[2]/td[2]")).Text; Tax_Default_Date = WebDriverTest.After(Tax_Default_Date, ": "); IWebElement AssementTB = driver.FindElement(By.XPath("//*[@id='tab-1-collapse']/div/div/div[2]/div/div[2]/div/table/tbody")); IList <IWebElement> AssementTR = AssementTB.FindElements(By.TagName("tr")); IList <IWebElement> AssementTD; foreach (IWebElement Assement in AssementTR) { AssementTD = Assement.FindElements(By.TagName("td")); if (AssementTD.Count != 0 || !Assement.Text.Contains(" ")) { lan = AssementTD[0].Text; if (lan.Contains("Land:")) { Land_Value = AssementTD[1].Text; } Imp = AssementTD[0].Text; if (Imp.Contains("Improvements:")) { Impovement = AssementTD[1].Text; } TAss = AssementTD[0].Text; if (TAss.Contains("Total:")) { Total_Assessed = AssementTD[1].Text; } } } IWebElement AssementTB1 = driver.FindElement(By.XPath("//*[@id='tab-1-collapse']/div/div/div[2]/div/div[4]/div/table/tbody")); IList <IWebElement> AssementTR1 = AssementTB1.FindElements(By.TagName("tr")); IList <IWebElement> AssementTD1; foreach (IWebElement Assement1 in AssementTR1) { AssementTD1 = Assement1.FindElements(By.TagName("td")); if (AssementTD1.Count != 0 || !Assement1.Text.Contains(" ")) { Homeowner = AssementTD1[0].Text; if (Homeowner.Contains("Homeowner:")) { Home_Owner = AssementTD1[1].Text; } other = AssementTD1[0].Text; if (other.Contains("Other:")) { Other = AssementTD1[1].Text; } TExe = AssementTD1[0].Text; if (TExe.Contains("Total:")) { Total_Expections = AssementTD1[1].Text; } } } IWebElement AssementTB2 = driver.FindElement(By.XPath("//*[@id='tab-1-collapse']/div/div/div[2]/div/div[5]/div/table/tbody")); IList <IWebElement> AssementTR2 = AssementTB2.FindElements(By.TagName("tr")); IList <IWebElement> AssementTD2; foreach (IWebElement Assement2 in AssementTR2) { AssementTD2 = Assement2.FindElements(By.TagName("td")); if (AssementTD2.Count != 0 || !Assement2.Text.Contains(" ")) { Net_Total = AssementTD2[0].Text; if (Net_Total.Contains("Total:")) { Net_Assed_Value = AssementTD2[1].Text; } } } Assesssment_Details = Land_Value + "~" + Impovement + "~" + Total_Assessed + "~" + Home_Owner + "~" + Other + "~" + Total_Expections + "~" + Net_Assed_Value + "~" + Tax_Default_Date; gc.CreatePdf(orderNumber, parcelno, "Assessment Details", driver, "CA", "Santa Clara"); ByVisibleElement(driver.FindElement(By.XPath("//*[@id='tab-1-collapse']/div/div/div[2]/div/div[2]/div/table/tbody/tr[4]/td[1]"))); gc.CreatePdf(orderNumber, parcelno, "Assessment Details1", driver, "CA", "Santa Clara"); ByVisibleElement(driver.FindElement(By.XPath("//*[@id='tab-1-collapse']/div/div/div[2]/div/div[4]/div/table/thead/tr/td"))); gc.CreatePdf(orderNumber, parcelno, "Assessment Details2", driver, "CA", "Santa Clara"); gc.insert_date(orderNumber, parcelno, 542, Assesssment_Details, 1, DateTime.Now); driver.FindElement(By.XPath("//*[@id='myTab-accordion']/div[5]/div[1]/h4/a")).Click(); Thread.Sleep(2000); TRA = driver.FindElement(By.XPath("//*[@id='tab-5-collapse']/div/div/div/div/div[1]/div[1]/div/div/div[1]")).Text; TRA = gc.Between(TRA, "TAX RATE AREA INFORMATION ", "(Tax Rate Information as").Trim(); Property_Details = Property_Address + "~" + TRA; gc.insert_date(orderNumber, parcelno, 541, Property_Details, 1, DateTime.Now); AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //Tax Information driver.Navigate().GoToUrl("https://payments.sccgov.org/propertytax/Secured"); Thread.Sleep(2000); //Address Search //driver.FindElement(By.XPath("//*[@id='tab2_link']/a")).SendKeys(Keys.Enter); //Thread.Sleep(2000); //driver.FindElement(By.Id("FullAddress")).SendKeys(address); //driver.FindElement(By.XPath("//*[@id='FullAddress']")).SendKeys(Keys.Enter); //Thread.Sleep(2000); //parcelno = driver.FindElement(By.XPath("/html/body/div[2]/div/div[2]/div/form/div[1]/div/dl/dd[1]")).Text; //parcelno = WebDriverTest.Before(parcelno, " View Payment History"); driver.FindElement(By.Id("ParcelNumber")).SendKeys(parcelno); try { gc.CreatePdf(orderNumber, parcelno, "Tax Details 1", driver, "CA", "Santa Clara"); driver.FindElement(By.Id("ParcelSubmit")).SendKeys(Keys.Enter); Thread.Sleep(2000); } catch { } try { ByVisibleElement(driver.FindElement(By.XPath("//*[@id='index_avoidconv_link']/span"))); gc.CreatePdf(orderNumber, parcelno, "Tax Details 2", driver, "CA", "Santa Clara"); } catch { } //Tax Payment History Details try { driver.FindElement(By.XPath("//*[@id='tabs']/a/span")).Click(); Thread.Sleep(5000); } catch { } try { driver.FindElement(By.XPath("/html/body/div[2]/div/div[2]/div/form/div[1]/div/dl/dd[1]/a")).Click(); Thread.Sleep(5000); } catch { } IWebElement TaxHistoryTB = driver.FindElement(By.XPath("//*[@id='historybody']")); IList <IWebElement> TaxHistoryTR = TaxHistoryTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxHistoryTD; foreach (IWebElement TaxHistory in TaxHistoryTR) { TaxHistoryTD = TaxHistory.FindElements(By.TagName("td")); if (TaxHistoryTD.Count != 0) { Tax_Year_Payment = TaxHistoryTD[0].Text; APN_Suffix_Payment = TaxHistoryTD[1].Text; Installment_Payment = TaxHistoryTD[2].Text; Tax_Amount_Payment = TaxHistoryTD[3].Text; Additional_Charges_Payment = TaxHistoryTD[4].Text; Paid_Amount_Payment = TaxHistoryTD[5].Text; Paid_Date_Payment = TaxHistoryTD[6].Text; Taxpayment_Details = Tax_Year_Payment + "~" + APN_Suffix_Payment + "~" + Installment_Payment + "~" + Tax_Amount_Payment + "~" + Additional_Charges_Payment + "~" + Paid_Amount_Payment + "~" + Paid_Date_Payment; gc.CreatePdf(orderNumber, parcelno, "Tax Payment History Details", driver, "CA", "Santa Clara"); gc.insert_date(orderNumber, parcelno, 544, Taxpayment_Details, 1, DateTime.Now); } } try { ByVisibleElement(driver.FindElement(By.XPath("//*[@id='historybody']/tr[11]/td[1]"))); gc.CreatePdf(orderNumber, parcelno, "Tax Payment History Details1", driver, "CA", "Santa Clara"); } catch { } try { driver.FindElement(By.XPath("//*[@id='closebutton']")).Click(); Thread.Sleep(2000); } catch { } //Current Tax Details try { tax_type = driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div[1]/div[1]/span")).Text; try { IWebElement CurrentBill = driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div/div[1]/div/a")); string CurrentTaxBill = CurrentBill.GetAttribute("href"); gc.downloadfile(CurrentTaxBill, orderNumber, parcelno, "Current Tax Bill", "CA", "Santa Clara"); } catch { } if (tax_type == "Annual Tax Bill" || tax_type == "Supplemental Tax Bill") { for (int i = 0; i < 3; i++) { for (int j = 2; j < 11; j++) { Installment += driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div/div[3]/div[" + (i + 2) + "]/div[ " + j + " ]")).Text + "~"; } Installment = tax_type + "~" + Installment.Remove(Installment.Length - 1, 1); i++; gc.CreatePdf(orderNumber, parcelno, "Current Tax Details", driver, "CA", "Santa Clara"); gc.insert_date(orderNumber, parcelno, 540, Installment, 1, DateTime.Now); Installment = ""; } } } catch { } try { tax_type_Supp = driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div[2]/div[1]/span")).Text; try { IWebElement SupplementalBill = driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div[2]/div[1]/div/a")); string SupplementalTaxBill = SupplementalBill.GetAttribute("href"); gc.downloadfile(SupplementalTaxBill, orderNumber, parcelno, "Supplemental Tax Bill", "CA", "Santa Clara"); } catch { } if (tax_type_Supp == "Supplemental Tax Bill") { InstallmentSupplemnt = ""; for (int k = 0; k < 3; k++) { for (int l = 2; l < 11; l++) { InstallmentSupplemnt += driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div[2]/div[3]/div[" + (k + 2) + "]/div[" + l + "]")).Text + "~"; } InstallmentSupplemnt = tax_type_Supp + "~" + InstallmentSupplemnt.Remove(InstallmentSupplemnt.Length - 1, 1); k++; gc.CreatePdf(orderNumber, parcelno, "Supplemental Tax Details", driver, "CA", "Santa Clara"); gc.insert_date(orderNumber, parcelno, 545, InstallmentSupplemnt, 1, DateTime.Now); InstallmentSupplemnt = ""; } } if (tax_type_Supp == "Supplemental Tax Bill") { InstallmentSupplemnt1 = ""; for (int m = 0; m < 3; m++) { for (int n = 2; n < 11; n++) { try { InstallmentSupplemnt1 += driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div[3]/div[3]/div[" + (m + 2) + "]/div[" + n + "]")).Text + "~"; } catch { } } InstallmentSupplemnt1 = tax_type_Supp + "~" + InstallmentSupplemnt1.Remove(InstallmentSupplemnt1.Length - 1, 1); m++; try { ByVisibleElement(driver.FindElement(By.XPath("//*[@id='select_invoiceslist']/div[3]/div[3]/div[1]/div[2]"))); gc.CreatePdf(orderNumber, parcelno, "Supplemental Tax Details1", driver, "CA", "Santa Clara"); Thread.Sleep(2000); } catch { } gc.insert_date(orderNumber, parcelno, 546, InstallmentSupplemnt1, 1, DateTime.Now); InstallmentSupplemnt1 = ""; } } } catch { } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "CA", "Santa Clara", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "CA", "Santa Clara"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw; } } }
public string FTP_AnneArundelMD(string streetno, string direction, string streetname, string streettype, string unitnumber, string ownernm, string parcelNumber, string searchType, string orderNumber, string directParcel) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "", Addresshrf = ""; // driver = new ChromeDriver(); // driver = new PhantomJSDriver(); using (driver = new PhantomJSDriver()) { StartTime = DateTime.Now.ToString("HH:mm:ss"); try { if (searchType == "titleflex") { string Address = ""; if (direction != "") { Address = streetno + " " + direction + " " + streetname + " " + streettype + " " + "UNIT " + unitnumber; } else { Address = streetno + " " + streetname + " " + streettype + " " + unitnumber; } gc.TitleFlexSearch(orderNumber, "", ownernm, Address, "MD", "Anne Arundel"); if (HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes") { driver.Quit(); return("MultiParcel"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString().Replace("-", ""); if (parcelNumber == "") { HttpContext.Current.Session["Zero_AnneArundelMD"] = "Zero"; driver.Quit(); return("No Data Found"); } searchType = "parcel"; } driver.Navigate().GoToUrl("https://sdat.dat.maryland.gov/RealProperty/Pages/default.aspx"); IWebElement countyDropDown = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchType_ddlCounty")); var selectCounty = new SelectElement(countyDropDown); selectCounty.SelectByText("ANNE ARUNDEL COUNTY"); Thread.Sleep(2000); if (searchType == "address") { IWebElement inputType = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchType_ddlSearchType")); var selectInputType = new SelectElement(inputType); selectInputType.SelectByText("STREET ADDRESS"); gc.CreatePdf_WOP(orderNumber, "Address Search", driver, "MD", "Anne Arundel"); IWebElement element = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StartNavigationTemplateContainerID_btnContinue")); element.Click(); Thread.Sleep(5000); driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtStreenNumber")).SendKeys(streetno); driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtStreetName")).SendKeys(streetname); gc.CreatePdf_WOP(orderNumber, "Address After", driver, "MD", "Anne Arundel"); driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StepNavigationTemplateContainerID_btnStepNextButton")).Click(); Thread.Sleep(2000); try { int Max = 0; IWebElement Addresstable = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchResult_gv_SearchResult")); IList <IWebElement> Addresrow = Addresstable.FindElements(By.TagName("tr")); IList <IWebElement> AddressTD; gc.CreatePdf_WOP(orderNumber, "Address After", driver, "MD", "Anne Arundel"); foreach (IWebElement AddressT in Addresrow) { AddressTD = AddressT.FindElements(By.TagName("td")); if (AddressTD.Count != 0) { string parcelno = AddressTD[1].Text; string OwnerName = AddressTD[0].Text; string Address = AddressTD[2].Text;//1618 string Addressresult = Address + "~" + OwnerName; gc.insert_date(orderNumber, parcelno, 1618, Addressresult, 1, DateTime.Now); Max++; } } if (Max > 1 && Max < 26) { HttpContext.Current.Session["multiparcel_AnneArundelMD"] = "Yes"; driver.Quit(); return("MultiParcel"); } if (Max > 25) { HttpContext.Current.Session["multiParcel_AnneArundelMD_Multicount"] = "Maximum"; driver.Quit(); return("MultiParcel"); } } catch { } try { string Error = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_lblErr")).Text; if (Error.Contains("There are no records")) { HttpContext.Current.Session["Zero_AnneArundelMD"] = "Zero"; driver.Quit(); return("No Data Found"); } } catch { } } if (searchType == "parcel") { IWebElement inputType = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchType_ddlSearchType")); var selectInputType = new SelectElement(inputType); selectInputType.SelectByText("PROPERTY ACCOUNT IDENTIFIER"); IWebElement element = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StartNavigationTemplateContainerID_btnContinue")); element.Click(); Thread.Sleep(5000); string parcelsplit1 = parcelNumber.Substring(0, 1).Replace("-", ""); string Parcelsplit2 = parcelNumber.Substring(1, 4).Replace("-", ""); string Parcelsplit3 = parcelNumber.Substring(5).Replace("-", ""); driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtDistrict")).SendKeys("0" + parcelsplit1); driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtSubDiv")).SendKeys(Parcelsplit2); driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtAccountIdentifier")).SendKeys(Parcelsplit3); driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StepNavigationTemplateContainerID_btnStepNextButton")).Click(); Thread.Sleep(2000); } try { //No Data Found string nodata = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_lblErr")).Text; if (nodata.Contains("no records")) { HttpContext.Current.Session["Zero_AnneArundelMD"] = "Zero"; driver.Quit(); return("No Data Found"); } } catch { } string Palcel = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblDetailsStreetHeader_0")).Text.Trim(); string District = gc.Between(Palcel, "District - ", "Subdivision"); string Subdivision = gc.Between(Palcel, "Subdivision -", "Account Number -"); string Account = GlobalClass.After(Palcel, "Account Number -"); parcel_number = District.Trim().Substring(1) + Subdivision.Trim() + Account.Trim(); string Ownername1 = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblOwnerName_0")).Text; string Ownername2 = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblOwnerName2_0")).Text; string ownername = Ownername1 + " " + Ownername2; string propertyaddress = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblPremisesAddress_0")).Text; string Legal = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblLegalDescription_0")).Text; try { Yearbuild = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label18_0")).Text; } catch { } string Use = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblUse_0")).Text; string principal = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblPrinResidence_0")).Text; string Map = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label5_0")).Text; string grid = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label6_0")).Text; string Parcell = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label7_0")).Text; string sub_district = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label8_0")).Text; string subdivision = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label9_0")).Text; string section = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label10_0")).Text; string Block = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label11_0")).Text; string Lot = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label12_0")).Text; string Assessmentyear = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label13_0")).Text; string Homestatus = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblHomeStatus_0")).Text; string HomeownersTaxCreditStatus = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblHTC_Status_0")).Text; string Homeownertaxdate = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblHTC_StatusDate_0")).Text; string Propertyresult = ownername + "~" + propertyaddress + "~" + Yearbuild + "~" + Use + "~" + principal + "~" + Map + "~" + grid + "~" + Parcell + "~" + sub_district + "~" + subdivision + "~" + section + "~" + Block + "~" + Lot + "~" + Assessmentyear + "~" + Homestatus + "~" + HomeownersTaxCreditStatus + "~" + Homeownertaxdate + "~" + Legal; gc.insert_date(orderNumber, parcel_number, 1561, Propertyresult, 1, DateTime.Now); gc.CreatePdf(orderNumber, parcel_number, "Assessment Detail", driver, "MD", "Anne Arundel"); AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //Tax Information driver.Navigate().GoToUrl("https://aacounty.munisselfservice.com/citizens/RealEstate/Default.aspx?mode=new"); Thread.Sleep(3000); driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_Control_ParcelIdSearchFieldLayout_ctl01_ParcelIDTextBox")).SendKeys(parcel_number); gc.CreatePdf(orderNumber, parcel_number, "Tax_info", driver, "MD", "Anne Arundel"); driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_Control_FormLayoutItem7_ctl01_Button1")).SendKeys(Keys.Enter); Thread.Sleep(3000); gc.CreatePdf(orderNumber, parcel_number, "Tax view Bill", driver, "MD", "Anne Arundel"); try { } catch { } List <string> ParcelSearch = new List <string>(); List <string> viewlien = new List <string>(); try { int viewline = 0; int currentyear = DateTime.Now.Year; int currentyear1 = DateTime.Now.Year - 1; int currentyear2 = DateTime.Now.Year - 2; int month = DateTime.Now.Month; if (month > 9) { currentyear++; } IWebElement ParcelTB = driver.FindElement(By.XPath(" //*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillsGridView' ]/tbody")); IList <IWebElement> ParcelTR = ParcelTB.FindElements(By.TagName("tr")); IList <IWebElement> parcelid; IList <IWebElement> parcelth; foreach (IWebElement parcel in ParcelTR) { parcelth = parcel.FindElements(By.TagName("th")); parcelid = parcel.FindElements(By.TagName("td")); try { if ((parcelid[4].Text.Contains(Convert.ToString(currentyear)) || parcelid[4].Text.Contains(Convert.ToString(currentyear1)) || parcelid[4].Text.Contains(Convert.ToString(currentyear2))) && parcelid[6].Text.Contains("View Bill") && parcelid.Count != 0) { IWebElement ParcelBill_link = parcelid[6].FindElement(By.TagName("a")); string Parcelurl = ParcelBill_link.GetAttribute("id"); ParcelSearch.Add(Parcelurl); } if (parcelid[7].Text.Contains("View Lien") && viewline == 0) { IWebElement ParcelBill_link = parcelid[7].FindElement(By.TagName("a")); string Parcelurl = ParcelBill_link.GetAttribute("id"); viewlien.Add(Parcelurl); viewline++; } } catch { } } } catch { } string currwindow = driver.Url; int i = 0; foreach (string Taxclick in ParcelSearch) { driver.Navigate().GoToUrl(currwindow); Thread.Sleep(3000); driver.FindElement(By.Id(Taxclick)).Click(); Thread.Sleep(2000); try { //Good Through Details string Bill_Flag = ""; try { Bill_Flag = driver.FindElement(By.XPath("//*[@id='innerContent']/p[2]")).Text; } catch { } try { IWebElement Intresttable = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillDetailsUpdatePanel']/table/tbody")); IList <IWebElement> Intrestrow1 = Intresttable.FindElements(By.TagName("tr")); IList <IWebElement> IntrestTD; foreach (IWebElement Inrest in Intrestrow1) { IntrestTD = Inrest.FindElements(By.TagName("td")); if (Inrest.Text.Contains("TOTAL")) { Bill_Flag = IntrestTD[3].Text.Trim(); } } } catch { } IWebElement good_date = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox']")); Good_through_date = good_date.GetAttribute("value"); if (Good_through_date.Contains("Select A Date")) { Good_through_date = "-"; } else { if (Bill_Flag == "Parcel is in tax sale" || Bill_Flag.Trim() != "$0.00") { DateTime G_Date = Convert.ToDateTime(Good_through_date); string dateChecking = DateTime.Now.ToString("MM") + "/15/" + DateTime.Now.ToString("yyyy"); if (G_Date < Convert.ToDateTime(dateChecking)) { //end of the month Good_through_date = new DateTime(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(Convert.ToInt16(DateTime.Now.ToString("MM"))), DateTime.DaysInMonth(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(DateTime.Now.ToString("MM")))).ToString("MM/dd/yyyy"); } else if (G_Date > Convert.ToDateTime(dateChecking)) { // nextEndOfMonth if ((Convert.ToInt16(Convert.ToInt16(DateTime.Now.ToString("MM"))) < 12)) { Good_through_date = new DateTime(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(Convert.ToInt16(DateTime.Now.ToString("MM")) + 1), DateTime.DaysInMonth(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(DateTime.Now.ToString("MM")) + 1)).ToString("MM/dd/yyyy"); IWebElement Inextmonth = driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox")); Inextmonth.Click(); } else { int nxtYr = Convert.ToInt16(DateTime.Now.ToString("yyyy")) + 1; Good_through_date = new DateTime(nxtYr, 1, DateTime.DaysInMonth(Convert.ToInt16(DateTime.Now.ToString("yyyy")), 1)).ToString("dd/MM/yyyy"); } } driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox")).Clear(); string[] daysplit = Good_through_date.Split('/'); Thread.Sleep(5000); driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox")).SendKeys(Good_through_date); Thread.Sleep(2000); //driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox")).Click(); //*[@id="ui-datepicker-div"]/div/a[2] //driver.FindElement(By.XPath("//*[@id='ui-datepicker-div']/div/a[2]")).Click(); IWebElement Iday = driver.FindElement(By.XPath("//*[@id='ui-datepicker-div']/table/tbody")); IList <IWebElement> IdayRow = Iday.FindElements(By.TagName("a")); foreach (IWebElement day in IdayRow) { if (day.Text != "" && day.Text == daysplit[1]) { day.SendKeys(Keys.Enter); } } //driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox")).Click(); Thread.Sleep(10000); } } } catch { } //Thread.Sleep(8000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "ViewBill" + i, driver, "MD", "Anne Arundel"); Bill_tax_Year = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillYearRow']/td")).Text; Bill_tax = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillNumberRow']/td")).Text; Bill_Owner = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_OwnerRow']/td")).Text; IWebElement TaxInfoTB = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillDetailsUpdatePanel']/table/tbody")); IList <IWebElement> TaxInfoTR = TaxInfoTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxInfoTD; foreach (IWebElement TaxInfo in TaxInfoTR) { TaxInfoTD = TaxInfo.FindElements(By.TagName("td")); if (TaxInfoTD.Count != 0 && TaxInfoTD.Count == 7 && !TaxInfo.Text.Contains("Installment")) { TaxBill_Installment = TaxInfoTD[0].Text; TaxBill_PayBy = TaxInfoTD[1].Text; TaxBill_Amount = TaxInfoTD[2].Text; TaxBill_Credits = TaxInfoTD[3].Text; TaxBill_Balance = TaxInfoTD[4].Text; TaxBill_Interest = TaxInfoTD[5].Text; TaxBill_Due = TaxInfoTD[6].Text; TaxInfo_Details = Bill_tax_Year + "~" + Bill_tax + "~" + Bill_Owner + "~" + TaxBill_Installment + "~" + TaxBill_PayBy + "~" + TaxBill_Amount + "~" + TaxBill_Credits + "~" + TaxBill_Balance + "~" + TaxBill_Interest + "~" + TaxBill_Due + "~" + Good_through_date; gc.insert_date(orderNumber, parcel_number, 1563, TaxInfo_Details, 1, DateTime.Now); } if (TaxInfoTD.Count == 6) { TaxBill_Installment1 = TaxInfoTD[0].Text; TaxBill_PayBy1 = ""; TaxBill_Amount1 = TaxInfoTD[1].Text; TaxBill_Credits1 = TaxInfoTD[2].Text; TaxBill_Balance1 = TaxInfoTD[3].Text; TaxBill_Interest1 = TaxInfoTD[4].Text; TaxBill_Due1 = TaxInfoTD[5].Text; TaxInfo_Details = Bill_tax_Year + "~" + Bill_tax + "~" + Bill_Owner + "~" + TaxBill_Installment1 + "~" + TaxBill_PayBy1 + "~" + TaxBill_Amount1 + "~" + TaxBill_Credits1 + "~" + TaxBill_Balance1 + "~" + TaxBill_Interest1 + "~" + TaxBill_Due1 + "~" + Good_through_date; gc.insert_date(orderNumber, parcel_number, 1563, TaxInfo_Details, 1, DateTime.Now); } } //Tax Pay/Adjust try { driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_ViewPaymentsLinkButton")).Click(); Thread.Sleep(4000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Tax PayAdjust" + i, driver, "MD", "Anne Arundel"); IWebElement TaxPayTB = driver.FindElement(By.XPath("//*[@id='innerContent']/table[2]/tbody")); IList <IWebElement> TaxPayTR = TaxPayTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxPayTD; foreach (IWebElement TaxPay in TaxPayTR) { TaxPayTD = TaxPay.FindElements(By.TagName("td")); if (TaxPayTD.Count != 0 && !TaxPay.Text.Contains("Activity")) { TaxPay_Activity = TaxPayTD[0].Text; TaxPay_Posted = TaxPayTD[1].Text; TaxPay_Reference = TaxPayTD[2].Text; TaxPay_Amount = TaxPayTD[3].Text; TaxPay_Details = Bill_tax_Year + "~" + TaxPay_Activity + "~" + TaxPay_Posted + "~" + TaxPay_Reference + "~" + TaxPay_Amount; gc.insert_date(orderNumber, parcel_number, 1564, TaxPay_Details, 1, DateTime.Now); } } } catch { } //Tax Charges driver.FindElement(By.LinkText("Charges")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Tax Charge" + i, driver, "MD", "Anne Arundel"); IWebElement TaxChargeTB = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_TaxChargesTable']")); IList <IWebElement> TaxChargeTR = TaxChargeTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxChargeTD; IList <IWebElement> TaxChargeTH; foreach (IWebElement TaxCharge in TaxChargeTR) { TaxChargeTD = TaxCharge.FindElements(By.TagName("td")); TaxChargeTH = TaxCharge.FindElements(By.TagName("th")); if (TaxChargeTD.Count != 0 && TaxChargeTD.Count == 3 && !TaxCharge.Text.Contains("Taxable Value") && TaxChargeTH.Count == 1) { TaxCharge_Entity = TaxChargeTH[0].Text; TaxCharge_taxable = TaxChargeTD[0].Text; TaxCharge_taxRate = TaxChargeTD[1].Text; TaxCharge_Amount = TaxChargeTD[2].Text; TaxCharge_Details = Bill_tax_Year + "~" + TaxCharge_Entity + "~" + TaxCharge_taxable + "~" + TaxCharge_taxRate + "~" + TaxCharge_Amount; gc.insert_date(orderNumber, parcel_number, 1565, TaxCharge_Details, 1, DateTime.Now); } if (TaxChargeTD.Count == 1 && TaxChargeTH.Count == 1) { TaxCharge_Entity1 = TaxChargeTH[0].Text; TaxCharge_taxable1 = ""; TaxCharge_taxRate1 = ""; TaxCharge_Amount1 = TaxChargeTD[0].Text; TaxCharge_Details1 = Bill_tax_Year + "~" + TaxCharge_Entity1 + "~" + "" + "~" + "" + "~" + TaxCharge_Amount1; gc.insert_date(orderNumber, parcel_number, 1565, TaxCharge_Details1, 1, DateTime.Now); } } try { TaxCharge_Entity2 = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_TotalTaxTable']/tbody/tr/th")).Text; TaxCharge_Amount2 = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_TotalTaxTable']/tbody/tr/td")).Text; } catch { } TaxCharge_Details2 = Bill_tax_Year + "~" + TaxCharge_Entity2 + "~" + "" + "~" + "" + "~" + TaxCharge_Amount2; gc.insert_date(orderNumber, parcel_number, 1565, TaxCharge_Details2, 1, DateTime.Now); //property Detail driver.FindElement(By.LinkText("Property Detail")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "property Detail" + i, driver, "MD", "Anne Arundel"); //Owner Information driver.FindElement(By.LinkText("Owner Information")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Owner Information" + i, driver, "MD", "Anne Arundel"); //assessment driver.FindElement(By.LinkText("Assessment")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Assessment" + i, driver, "MD", "Anne Arundel"); IWebElement assessmenttable = driver.FindElement(By.XPath("//*[@id='molContentMainDiv']/table[2]/tbody")); IList <IWebElement> assessmentrow = assessmenttable.FindElements(By.TagName("tr")); IList <IWebElement> assessmentidtr; IList <IWebElement> assessmentidth; foreach (IWebElement assessment in assessmentrow) { assessmentidtr = assessment.FindElements(By.TagName("td")); assessmentidth = assessment.FindElements(By.TagName("th")); if (assessmentidtr.Count != 0) { string assessmentresult = Bill_tax_Year + "~" + assessmentidth[0].Text + "~" + assessmentidtr[0].Text; gc.insert_date(orderNumber, parcel_number, 1562, assessmentresult, 1, DateTime.Now); } } //Assessment History driver.FindElement(By.LinkText("Assessment History")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Assessment History" + i, driver, "MD", "Anne Arundel"); //Tax rate driver.FindElement(By.LinkText("Tax Rates")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Tax Rates" + i, driver, "MD", "Anne Arundel"); //All bills try { driver.FindElement(By.LinkText("All Bills")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Tax Uitility Bill" + i, driver, "MD", "Anne Arundel"); if (i == 0) { IWebElement TaxHistoryTable = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillsRepeater_ctl00_BillsGrid']/tbody")); IList <IWebElement> TaxHistoryTR = TaxHistoryTable.FindElements(By.TagName("tr")); IList <IWebElement> TaxHistoryTD; foreach (IWebElement TaxHistory in TaxHistoryTR) { TaxHistoryTD = TaxHistory.FindElements(By.TagName("td")); if (!TaxHistory.Text.Contains("Year")) { Bill = TaxHistoryTD[0].Text; tax_Type = TaxHistoryTD[1].Text; Year = TaxHistoryTD[2].Text; Tax_Owner = TaxHistoryTD[3].Text; Tax_paid = TaxHistoryTD[4].Text; TaxHistory_Info = Bill + "~" + tax_Type + "~" + Year + "~" + Tax_Owner + "~" + Tax_paid; gc.insert_date(orderNumber, parcel_number, 1566, TaxHistory_Info, 1, DateTime.Now); } } } } catch { } try { if (i == 0) { IWebElement Utility = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillsRepeater_ctl01_BillsGrid']/tbody")); IList <IWebElement> UtilityTR = Utility.FindElements(By.TagName("tr")); for (int j = 0; j < UtilityTR.Count; j++) { int check = j % 12; if (check == 0 && j >= 12) { try { IJavaScriptExecutor js = (IJavaScriptExecutor)driver; js.ExecuteScript("arguments[0].scrollIntoView();", UtilityTR[j]); gc.CreatePdf_Chrome(orderNumber, parcel_number, "Tax Uitility Bill " + j, driver, "MD", "Anne Arundel"); } catch { } } } } } catch { } i++; } if (viewlien.Count != 0) { List <string> Viewbillline = new List <string>(); foreach (string Line in viewlien) { driver.Navigate().GoToUrl(currwindow); Thread.Sleep(3000); driver.FindElement(By.Id(Line)).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "line view detail", driver, "MD", "Anne Arundel"); IWebElement LineFoundTable = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillsGrid']/tbody")); IList <IWebElement> Linefoundrow = LineFoundTable.FindElements(By.TagName("tr")); IList <IWebElement> linefoundid; foreach (IWebElement Linefound in Linefoundrow) { linefoundid = Linefound.FindElements(By.TagName("td")); //if (linefoundid.Count != 0) //{ // string Linefoundresult = linefoundid[1].Text + "~" + linefoundid[2].Text + "~" + linefoundid[3].Text + "~" + linefoundid[4].Text; // gc.insert_date(orderNumber, parcel_number, 1456, Linefoundresult, 1, DateTime.Now); //} if (Linefound.Text.Contains("View Bill")) { IWebElement Viewbill = linefoundid[5].FindElement(By.TagName("a")); string Viewbillid = Viewbill.GetAttribute("id"); Viewbillline.Add(Viewbillid); } } } int Linevi = 0; foreach (string viewlinelink in Viewbillline) { driver.FindElement(By.Id(viewlinelink)).Click(); Thread.Sleep(2000); string linebillyear = "", linebill = "", lineownername = ""; gc.CreatePdf_Chrome(orderNumber, parcel_number, "line Bill detail" + Linevi, driver, "MD", "Anne Arundel"); linebillyear = driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_FiscalYearLabel")).Text; linebill = driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillNumberLabel")).Text; lineownername = driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_OwnerLabel")).Text; IWebElement TaxInfoTB = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillDetailsUpdatePanel']/table/tbody")); IList <IWebElement> TaxInfoTR = TaxInfoTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxInfoTD; foreach (IWebElement TaxInfo in TaxInfoTR) { TaxInfoTD = TaxInfo.FindElements(By.TagName("td")); if (TaxInfoTD.Count != 0 && TaxInfoTD.Count == 6 && !TaxInfo.Text.Contains("Installment")) { TaxBill_Installment = TaxInfoTD[0].Text; TaxBill_PayBy = TaxInfoTD[1].Text; TaxBill_Amount = TaxInfoTD[2].Text; TaxBill_Credits = TaxInfoTD[3].Text; TaxBill_Balance = TaxInfoTD[4].Text; TaxBill_Interest = TaxInfoTD[5].Text; TaxInfo_Details = linebillyear + "~" + linebill + "~" + lineownername + "~" + TaxBill_Installment + "~" + TaxBill_PayBy + "~" + TaxBill_Amount + "~" + TaxBill_Credits + "~" + TaxBill_Balance + "~" + TaxBill_Interest; gc.insert_date(orderNumber, parcel_number, 1567, TaxInfo_Details, 1, DateTime.Now); } if (TaxInfoTD.Count == 5) { TaxBill_Installment1 = TaxInfoTD[0].Text; TaxBill_PayBy1 = ""; TaxBill_Amount1 = TaxInfoTD[1].Text; TaxBill_Credits1 = TaxInfoTD[2].Text; TaxBill_Balance1 = TaxInfoTD[3].Text; TaxBill_Interest1 = TaxInfoTD[4].Text; TaxInfo_Details = linebillyear + "~" + linebill + "~" + lineownername + "~" + TaxBill_Installment1 + "~" + TaxBill_PayBy1 + "~" + TaxBill_Amount1 + "~" + TaxBill_Credits1 + "~" + TaxBill_Balance1 + "~" + TaxBill_Interest1; gc.insert_date(orderNumber, parcel_number, 1567, TaxInfo_Details, 1, DateTime.Now); } } driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_PaymentsAdjustmentsLinkButton")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, parcel_number, "line Payment detail" + Linevi, driver, "MD", "Anne Arundel"); IWebElement assessmenttable1 = driver.FindElement(By.XPath("//*[@id='innerContent']/table[2]/tbody")); IList <IWebElement> assessmentrow1 = assessmenttable1.FindElements(By.TagName("tr")); IList <IWebElement> assessmentidtr1; IList <IWebElement> assessmentidth; foreach (IWebElement assessment1 in assessmentrow1) { assessmentidtr1 = assessment1.FindElements(By.TagName("td")); assessmentidth = assessment1.FindElements(By.TagName("th")); if (assessmentidtr1.Count != 0) { string assessmentresult1 = linebillyear + "~" + assessmentidtr1[0].Text + "~" + assessmentidtr1[1].Text + "~" + assessmentidtr1[2].Text + "~" + assessmentidtr1[3].Text; gc.insert_date(orderNumber, parcel_number, 1568, assessmentresult1, 1, DateTime.Now); } } driver.FindElement(By.XPath("//*[@id='innerContent']/ul/li[2]/a")).Click(); Thread.Sleep(2000); Linevi++; } } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "MD", "Anne Arundel", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "MD", "Anne Arundel"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw ex; } } }
public string FTP_CAContracosta(string houseno, string sname, string stype, string city, string parcelNumber, string searchType, string orderNumber, string ownername, string directParcel) { GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; // driver = new ChromeDriver(); //driver = new PhantomJSDriver() using (driver = new PhantomJSDriver()) { try { StartTime = DateTime.Now.ToString("HH:mm:ss"); string taddress = ""; if (searchType == "titleflex") { if (directParcel != null) { taddress = houseno + " " + directParcel + " " + sname; } else { taddress = houseno + " " + directParcel + " " + sname; } gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, taddress, "CA", "Contra Costa"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_CAContraCosta"] = "Zero"; driver.Quit(); return("No Data Found"); } searchType = "parcel"; parcelNumber = GlobalClass.global_parcelNo.Replace("-", ""); parcelNumber = parcelNumber.Substring(0, 9); } if (searchType == "address") { driver.Navigate().GoToUrl("https://taxcolp.cccounty.us/taxpaymentrev3/lookup/"); Thread.Sleep(4000); var SelectAddress = driver.FindElement(By.Id("searchtypeselect")); Thread.Sleep(4000); var SelectAddressTax = new SelectElement(SelectAddress); SelectAddressTax.SelectByText("Property Address"); if (directParcel == null || directParcel == "") { address = houseno + " " + sname; } else { if (directParcel != null) { address = houseno + " " + directParcel + " " + sname; } else { address = houseno + " " + directParcel + " " + sname; } } driver.FindElement(By.Id("searchfield")).SendKeys(address); //var SelectAddressSuffix = driver.FindElement(By.Id("streetsuffixselect")); //var SelectAddressSuffixTax = new SelectElement(SelectAddressSuffix); //SelectAddressSuffixTax.SelectByText(stype); var SelectAddressCity = driver.FindElement(By.Id("cityselect")); var SelectAddressCityTax = new SelectElement(SelectAddressCity); SelectAddressCityTax.SelectByText(city.ToUpper().ToString().Trim()); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "CA", "Contra Costa"); driver.FindElement(By.XPath("/html/body/div/div[3]/div[2]/form/div/div/div[6]/input")).SendKeys(Keys.Enter); Thread.Sleep(8000); //MultiParcel try { IWebElement MultiTable = driver.FindElement(By.XPath("//*[@id='address-picker']/table/tbody")); IList <IWebElement> MultiTR = MultiTable.FindElements(By.TagName("tr")); IList <IWebElement> MultiTD; int maxCheck = 0; gc.CreatePdf_WOP(orderNumber, "MultiAddress", driver, "CA", "Contra Costa"); foreach (IWebElement Multi in MultiTR) { if (maxCheck <= 25) { MultiTD = Multi.FindElements(By.TagName("td")); if (MultiTD.Count != 0) { Property_Address = MultiTD[0].Text; parcelNumber = MultiTD[1].Text; Multiparcel = Property_Address.Replace("\r\n", ""); gc.insert_date(orderNumber, parcelNumber, 411, Multiparcel, 1, DateTime.Now); } maxCheck++; } } HttpContext.Current.Session["multiParcel_CAContraCosta"] = "Yes"; if (MultiTR.Count > 25) { HttpContext.Current.Session["multiParcel_CAContraCosta_Multicount"] = "Maximum"; } driver.Quit(); return("MultiParcel"); } catch { } } if (searchType == "parcel") { driver.Navigate().GoToUrl("https://taxcolp.cccounty.us/taxpaymentrev3/lookup/"); Thread.Sleep(4000); var SelectParcel = driver.FindElement(By.Id("searchtypeselect")); var SelectParcelTax = new SelectElement(SelectParcel); SelectParcelTax.SelectByText("Parcel Number"); driver.FindElement(By.Id("searchfield")).Click(); parcel = parcelNumber.Replace("-", ""); parcel1 = parcel.Substring(0, 3); parcel2 = parcel.Substring(3, 3); parcel3 = parcel.Substring(6, 3); ParcelId = parcel1 + parcel2 + parcel3; Thread.Sleep(8000); driver.FindElement(By.Id("searchfield")).Clear(); driver.FindElement(By.Id("searchfield")).Click(); driver.FindElement(By.Id("searchfield")).SendKeys(ParcelId); gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "CA", "Contra Costa"); driver.FindElement(By.XPath("/html/body/div/div[3]/div[2]/form/div/div/div[6]/input")).SendKeys(Keys.Enter); Thread.Sleep(8000); } try { IWebElement Inodata = driver.FindElement(By.Id("error")); if (Inodata.Text.Contains("Address Not Found") || Inodata.Text.Contains("APN not found")) { HttpContext.Current.Session["Nodata_CAContraCosta"] = "Zero"; driver.Quit(); return("No Data Found"); } } catch { } //Property Details driver.FindElement(By.XPath("//*[@id='results']/div[1]/div[1]/a")).SendKeys(Keys.Enter); Thread.Sleep(6000); Situs_Address = driver.FindElement(By.XPath("//*[@id='results']/div[1]/h3")).Text; Situs_Address = WebDriverTest.After(Situs_Address, "Address (Situs): ").Trim(); outparcelno = driver.FindElement(By.XPath("//*[@id='hide-details']/div[1]/h3")).Text; outparcelno = GlobalClass.After(outparcelno, "Parcel Number (APN): ").Trim(); // outparcelno = gc.Between(outparcelno, "Parcel Number (APN): ", "SIGN UP HERE FOR SECURED").Trim(); gc.CreatePdf(orderNumber, outparcelno, "Property Details", driver, "CA", "Contra Costa"); Property_Deatail = Situs_Address; gc.insert_date(orderNumber, outparcelno, 320, Property_Deatail, 1, DateTime.Now); //Assement details driver.FindElement(By.LinkText("ASSESSMENT INFORMATION")).Click(); Thread.Sleep(4000); gc.CreatePdf(orderNumber, outparcelno, "Assement Details", driver, "CA", "Contra Costa"); IWebElement AssementTB = driver.FindElement(By.XPath("//*[@id='current-assessment-information']/table/tbody")); IList <IWebElement> AssementTR = AssementTB.FindElements(By.TagName("tr")); IList <IWebElement> AssementTD; foreach (IWebElement Assement in AssementTR) { AssementTD = Assement.FindElements(By.TagName("td")); if (AssementTD.Count != 0) { if (Assement.Text.Contains("Assessment Year")) { Assessment_Year = AssementTD[1].Text; } else { Land = AssementTD[2].Text + "~" + Land; } } } Land = Assessment_Year + "~" + Land.Replace("~-", ""); gc.insert_date(orderNumber, outparcelno, 365, Land, 1, DateTime.Now); AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //CurrentTax details driver.FindElement(By.LinkText("CURRENT TAXES")).Click(); Thread.Sleep(4000); gc.CreatePdf(orderNumber, outparcelno, "CurretntTax Details", driver, "CA", "Contra Costa"); List <string> urlListSecured = new List <string>(); List <string> urlListSupplemental = new List <string>(); IWebElement CurrentTaxTB = driver.FindElement(By.XPath("//*[@id='results']/div[2]/table/tbody")); IList <IWebElement> CurrentTaxTR = CurrentTaxTB.FindElements(By.TagName("tr")); IList <IWebElement> CurrentTaxTD; IList <IWebElement> CurrentTaxA; foreach (IWebElement CurrentTax in CurrentTaxTR) { CurrentTaxTD = CurrentTax.FindElements(By.TagName("td")); CurrentTaxA = CurrentTax.FindElements(By.TagName("a")); if (CurrentTaxTD.Count != 0) { Bill_Type = CurrentTaxTD[0].Text; Bill_SaleId = CurrentTaxTD[1].Text.Replace(" - View Bill", "").Trim(); Install_No = CurrentTaxTD[2].Text; Date_Due = CurrentTaxTD[3].Text; Amount = CurrentTaxTD[4].Text; try { Pay = CurrentTaxTD[5].Text; } catch { Pay = "PAY"; } Currenttax_Details = Bill_Type + "~" + Bill_SaleId + "~" + Install_No + "~" + Date_Due + "~" + Amount + "~" + Pay + "~" + "-"; gc.insert_date(orderNumber, outparcelno, 366, Currenttax_Details, 1, DateTime.Now); } if (CurrentTaxA.Count != 0) { if (Bill_Type == "SECURED") { urlListSecured.Add(CurrentTaxA[0].GetAttribute("href")); } else if (Bill_Type == "SUPPLEMENTAL") { urlListSupplemental.Add(CurrentTaxA[0].GetAttribute("href")); } } } try { TotalAmountSelected_ToPay = driver.FindElement(By.XPath("//*[@id='summary']/div[2]/div[3]/h3")).Text; Totaltax_Details = "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + TotalAmountSelected_ToPay; gc.insert_date(orderNumber, outparcelno, 366, Totaltax_Details, 1, DateTime.Now); } catch { } //Download Tax Bills try { int i = 0; String Parent_Window1 = driver.CurrentWindowHandle; foreach (string item in urlListSecured) { gc.downloadfileHeader(item, orderNumber, outparcelno, "Secured_Bill" + i, "CA", "Contra Costa", driver); i++; } int k = 0; foreach (string item in urlListSupplemental) { gc.downloadfileHeader(item, orderNumber, outparcelno, "Supplemental_Bill" + k, "CA", "Contra Costa", driver); k++; } System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; driver.SwitchTo().Window(driver.WindowHandles.Last()); Thread.Sleep(4000); driver.SwitchTo().Window(Parent_Window1); Thread.Sleep(2000); } catch { } //TaxHistory Details driver.FindElement(By.LinkText("TAX HISTORY")).Click(); Thread.Sleep(4000); gc.CreatePdf(orderNumber, outparcelno, "TaxHistory Details", driver, "CA", "Contra Costa"); IWebElement TaxHistoryTB = driver.FindElement(By.XPath("//*[@id='prioryear-results']/div[2]/table/tbody")); IList <IWebElement> TaxHistoryTR = TaxHistoryTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxHistoryTD; foreach (IWebElement TaxHistory in TaxHistoryTR) { TaxHistoryTD = TaxHistory.FindElements(By.TagName("td")); if (TaxHistoryTD.Count != 0) { TaxBill_Type = TaxHistoryTD[0].Text; Tax_Year = TaxHistoryTD[1].Text.Replace("View Bill", "\r\n").Trim(); Instal_No = TaxHistoryTD[2].Text; AdValorem_tax = TaxHistoryTD[3].Text; Special_Assessments = TaxHistoryTD[4].Text; Delinquent_PenaltyCost = TaxHistoryTD[5].Text; TaxAmount = TaxHistoryTD[6].Text; Bill_Status = TaxHistoryTD[7].Text; TaxBillAmount_Details = TaxBill_Type + "~" + Tax_Year + "~" + Instal_No + "~" + AdValorem_tax + "~" + Special_Assessments + "~" + Delinquent_PenaltyCost + "~" + TaxAmount + "~" + Bill_Status; gc.insert_date(orderNumber, outparcelno, 367, TaxBillAmount_Details, 1, DateTime.Now); } } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "CA", "Contra Costa", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); //megrge pdf files gc.mergpdf(orderNumber, "CA", "Contra Costa"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw ex; } } }
public string FTP_MDWashignton(string houseno, string sname, string direction, string account, string parcelNumber, string ownername, string searchType, string orderNumber, string directParcel) { string Parcel_ID = "", owner = "", Accnumber = "", PropertyAddress = "", Multi = "", Pa1 = "", Pa2 = "", Sub = "", Pa = "", Land = "", Building = "", Total_Assessed_Value = "", Assessment_details = ""; string Parcel = "", Map = "", Grid = "", Subdivision = "", Block = "", Lot = "", value = "", Mail_Address = "", property_details = "", tax_Parcelid = "", TaxBill_Installment = "", TaxBill_PayBy = "", TaxBill_Amount = "", TaxBill_Credits = "", TaxBill_Balance = "", TaxBill_Interest = "", TaxBill_Due = "-", TaxInfo_Details = "-"; string Account_id_number = "", Owner_name = "", Address = "", Legal_Description = "", Year_Built = "", use = "", Principal_Residence = "", Sections = ""; string Sub_District = "", Assessment_Year = "", Homestead_Application_Status = "", Homeowners_Tax_Credit_Application_Status = "", Homeowners_Tax_Credit_Application_Date = ""; string Bill = "", tax_Type = "", Year = "", Tax_Owner = "", Tax_paid = "", TaxHistory_Info = "", Bill_tax_Year = "", Bill_tax = "", Bill_Owner = "", TaxPay_Activity = "", TaxPay_Posted = "", TaxPay_Reference = "", TaxPay_Amount = "", TaxPay_Details = ""; string TaxBill_Installment1 = "", TaxBill_PayBy1 = "", TaxBill_Amount1 = "", TaxBill_Credits1 = "", TaxBill_Balance1 = "", TaxBill_Interest1 = "", TaxBill_Due1 = "", TaxInfo_Details1 = "", TaxInfo_Details2 = ""; string TaxCharge_Entity = "", TaxCharge_taxable = "", TaxCharge_taxRate = "", TaxCharge_Amount = "", TaxCharge_Details = "", TaxCharge_Entity1 = "", TaxCharge_taxable1 = "", TaxCharge_taxRate1 = "", TaxCharge_Amount1 = "", TaxCharge_Details1 = "", TaxCharge_Entity2 = "", TaxCharge_Amount2 = "", TaxCharge_Details2 = "", Good_through_date = ""; GlobalClass.global_orderNo = orderNumber; HttpContext.Current.Session["orderNo"] = orderNumber; GlobalClass.global_parcelNo = parcelNumber; string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = ""; var driverService = PhantomJSDriverService.CreateDefaultService(); driverService.HideCommandPromptWindow = true; using (driver = new PhantomJSDriver()) { //driver = new ChromeDriver(); try { StartTime = DateTime.Now.ToString("HH:mm:ss"); if (searchType == "titleflex") { string titleaddress = houseno + " " + sname + " " + direction + " " + directParcel; gc.TitleFlexSearch(orderNumber, parcelNumber, ownername, titleaddress.Trim(), "MD", "Washington"); if ((HttpContext.Current.Session["TitleFlex_Search"] != null && HttpContext.Current.Session["TitleFlex_Search"].ToString() == "Yes")) { driver.Quit(); return("MultiParcel"); } else if (HttpContext.Current.Session["titleparcel"].ToString() == "") { HttpContext.Current.Session["Nodata_MDWashington"] = "Yes"; driver.Quit(); return("No Data Found"); } parcelNumber = HttpContext.Current.Session["titleparcel"].ToString(); searchType = "parcel"; } if (searchType == "address") { driver.Navigate().GoToUrl("https://sdat.dat.maryland.gov/RealProperty/Pages/default.aspx"); Thread.Sleep(2000); var SerachCategory = driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchType_ddlCounty']")); var selectElement1 = new SelectElement(SerachCategory); selectElement1.SelectByText("WASHINGTON COUNTY"); var SerachCategoryM = driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchType_ddlSearchType']")); var selectElementM1 = new SelectElement(SerachCategoryM); selectElementM1.SelectByText("STREET ADDRESS"); Thread.Sleep(3000); gc.CreatePdf_WOP(orderNumber, "Address search", driver, "MD", "Washington"); driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StartNavigationTemplateContainerID_btnContinue']")).SendKeys(Keys.Enter); Thread.Sleep(3000); driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtStreenNumber']")).SendKeys(houseno); driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtStreetName']")).SendKeys(sname); driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StepNavigationTemplateContainerID_btnStepNextButton']")).SendKeys(Keys.Enter); Thread.Sleep(3000); gc.CreatePdf_WOP(orderNumber, "Address search Result", driver, "MD", "Washington"); try { IWebElement MultiAddressTable = driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchResult_gv_SearchResult']/tbody")); IList <IWebElement> MultiAddressRow = MultiAddressTable.FindElements(By.TagName("tr")); IList <IWebElement> MultiAddressTD; int maxCheck = 0; gc.CreatePdf_WOP(orderNumber, "MultiAddress", driver, "MD", "Washington"); foreach (IWebElement row1 in MultiAddressRow) { if (maxCheck <= 25) { MultiAddressTD = row1.FindElements(By.TagName("td")); if (MultiAddressTD.Count != 0) { owner = MultiAddressTD[0].Text; Accnumber = MultiAddressTD[1].Text; PropertyAddress = MultiAddressTD[2].Text; Multi = owner + "~" + PropertyAddress; gc.insert_date(orderNumber, Accnumber, 1343, Multi, 1, DateTime.Now); } } } HttpContext.Current.Session["MDWashignton"] = "Yes"; if (MultiAddressRow.Count > 25) { HttpContext.Current.Session["multiParcel_MDWashignton_Maximum"] = "Maximum"; } driver.Quit(); return("MultiParcel"); } catch { } } if (searchType == "parcel") { driver.Navigate().GoToUrl("https://sdat.dat.maryland.gov/RealProperty/Pages/default.aspx"); Thread.Sleep(2000); var SerachCategory = driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchType_ddlCounty']")); var selectElement1 = new SelectElement(SerachCategory); selectElement1.SelectByText("WASHINGTON COUNTY"); var SerachCategoryM = driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucSearchType_ddlSearchType']")); var selectElementM1 = new SelectElement(SerachCategoryM); selectElementM1.SelectByText("PROPERTY ACCOUNT IDENTIFIER"); Thread.Sleep(3000); driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StartNavigationTemplateContainerID_btnContinue']")).SendKeys(Keys.Enter); Thread.Sleep(3000); Pa = parcelNumber.Replace("-", ""); if (Pa.Count() == 8) { Pa1 = Pa.Substring(0, 2); Pa2 = Pa.Substring(2, 6); } else { Pa1 = Pa.Substring(0, 2); Pa2 = Pa.Substring(3, 6); Sub = Pa.Substring(2, 1); } driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtDistrict']")).SendKeys(Pa1); driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucEnterData_txtAccountIdentifier']")).SendKeys(Pa2); gc.CreatePdf(orderNumber, parcelNumber, "Parcel Search", driver, "MD", "Washington"); driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_StepNavigationTemplateContainerID_btnStepNextButton']")).SendKeys(Keys.Enter); Thread.Sleep(3000); } try { IWebElement INodata = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_lblErr")); if (INodata.Text.Contains("no records that match your criteria")) { HttpContext.Current.Session["Nodata_MDWashington"] = "Yes"; driver.Quit(); return("No Data Found"); } } catch { } //property details Account_id_number = driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblDetailsStreetHeader_0']")).Text.Replace("Folio:", ""); Account_id_number = GlobalClass.After(Account_id_number, "Account Number").Replace("-", "").Trim(); value = driver.FindElement(By.XPath("//*[@id='MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblDetailsStreetHeader_0']")).Text.Replace("Folio:", ""); value = gc.Between(value, "District -", "Account Number -").Replace(" ", ""); Parcel_ID = value + Account_id_number; gc.CreatePdf(orderNumber, Parcel_ID, "Property and Assessment details", driver, "MD", "Washington"); string Owner_name1 = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblOwnerName_0")).Text.Trim(); string Ownarname = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblOwnerName2_0")).Text.Trim(); Owner_name = Owner_name1 + " " + Ownarname; Address = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblPremisesAddress_0")).Text.Trim(); Address = Address.Replace("\r\n", " "); Mail_Address = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblMailingAddress_0")).Text.Trim(); Mail_Address = Mail_Address.Replace("\r\n", " "); Legal_Description = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblLegalDescription_0")).Text.Trim(); Year_Built = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label18_0")).Text.Trim(); use = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblUse_0")).Text.Trim(); Principal_Residence = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblPrinResidence_0")).Text.Trim(); Map = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label5_0")).Text.Trim(); Grid = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label6_0")).Text.Trim(); Parcel = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label7_0")).Text.Trim(); Sub_District = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label8_0")).Text.Trim(); Subdivision = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label9_0")).Text.Trim(); Sections = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label10_0")).Text.Trim(); Block = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label11_0")).Text.Trim(); Lot = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label12_0")).Text.Trim(); Assessment_Year = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label13_0")).Text.Trim(); Homestead_Application_Status = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblHomeStatus_0")).Text.Trim(); Homeowners_Tax_Credit_Application_Status = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblHTC_Status_0")).Text.Trim(); Homeowners_Tax_Credit_Application_Date = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblHTC_StatusDate_0")).Text.Trim(); string Town = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_Label15_0")).Text; property_details = Owner_name + "~" + Address + "~" + Mail_Address + "~" + Legal_Description + "~" + Town + "~" + Year_Built + "~" + use + "~" + Principal_Residence + "~" + Map + "~" + Grid + "~" + Parcel + "~" + Sub_District + "~" + Subdivision + "~" + Sections + "~" + Block + "~" + Lot + "~" + Assessment_Year + "~" + Homestead_Application_Status + "~" + Homeowners_Tax_Credit_Application_Status + "~" + Homeowners_Tax_Credit_Application_Date; gc.insert_date(orderNumber, Parcel_ID, 1344, property_details, 1, DateTime.Now); //Assessment Details Table: Land = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblBaseLand_0")).Text.Trim(); Building = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblBaseImprove_0")).Text.Trim(); Total_Assessed_Value = driver.FindElement(By.Id("MainContent_MainContent_cphMainContentArea_ucSearchType_wzrdRealPropertySearch_ucDetailsSearch_dlstDetaisSearch_lblBaseTotal_0")).Text.Trim(); Assessment_details = Land + "~" + Building + "~" + Total_Assessed_Value; gc.insert_date(orderNumber, Parcel_ID, 1345, Assessment_details, 1, DateTime.Now); AssessmentTime = DateTime.Now.ToString("HH:mm:ss"); //Tax Information driver.Navigate().GoToUrl("https://payments.washco-md.net/MSS/citizens/RealEstate/Default.aspx?mode=new"); Thread.Sleep(3000); tax_Parcelid = Parcel_ID.Replace("-", ""); driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_Control_ParcelIdSearchFieldLayout_ctl01_ParcelIDTextBox")).SendKeys(tax_Parcelid); gc.CreatePdf(orderNumber, tax_Parcelid, "Tax_info", driver, "MD", "Washington"); driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_Control_FormLayoutItem7_ctl01_Button1")).SendKeys(Keys.Enter); Thread.Sleep(3000); gc.CreatePdf(orderNumber, tax_Parcelid, "Tax view Bill", driver, "MD", "Washington"); try { } catch { } List <string> ParcelSearch = new List <string>(); List <string> viewlien = new List <string>(); try { int viewline = 0; int currentyear = DateTime.Now.Year; int currentyear1 = DateTime.Now.Year - 1; int currentyear2 = DateTime.Now.Year - 2; int month = DateTime.Now.Month; if (month > 9) { currentyear++; } IWebElement ParcelTB = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillsGridView']/tbody")); IList <IWebElement> ParcelTR = ParcelTB.FindElements(By.TagName("tr")); IList <IWebElement> parcelid; IList <IWebElement> parcelth; foreach (IWebElement parcel in ParcelTR) { parcelth = parcel.FindElements(By.TagName("th")); parcelid = parcel.FindElements(By.TagName("td")); try { if ((parcelid[4].Text.Contains(Convert.ToString(currentyear)) || parcelid[4].Text.Contains(Convert.ToString(currentyear1)) || parcelid[4].Text.Contains(Convert.ToString(currentyear2))) && parcelid[6].Text.Contains("View Bill") && parcelid.Count != 0) { IWebElement ParcelBill_link = parcelid[6].FindElement(By.TagName("a")); string Parcelurl = ParcelBill_link.GetAttribute("id"); ParcelSearch.Add(Parcelurl); } if (parcelid[7].Text.Contains("View Lien") && viewline == 0) { IWebElement ParcelBill_link = parcelid[7].FindElement(By.TagName("a")); string Parcelurl = ParcelBill_link.GetAttribute("id"); viewlien.Add(Parcelurl); viewline++; } } catch { } } } catch { } string currwindow = driver.Url; int i = 0; foreach (string Taxclick in ParcelSearch) { driver.Navigate().GoToUrl(currwindow); Thread.Sleep(3000); driver.FindElement(By.Id(Taxclick)).Click(); Thread.Sleep(2000); try { //Good Through Details string Bill_Flag = ""; try { Bill_Flag = driver.FindElement(By.XPath("//*[@id='innerContent']/p[2]")).Text; } catch { } try { IWebElement Intresttable = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillDetailsUpdatePanel']/table/tbody")); IList <IWebElement> Intrestrow1 = Intresttable.FindElements(By.TagName("tr")); IList <IWebElement> IntrestTD; foreach (IWebElement Inrest in Intrestrow1) { IntrestTD = Inrest.FindElements(By.TagName("td")); if (Inrest.Text.Contains("TOTAL")) { Bill_Flag = IntrestTD[3].Text.Trim(); } } } catch { } IWebElement good_date = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox']")); Good_through_date = good_date.GetAttribute("value"); if (Good_through_date.Contains("Select A Date")) { Good_through_date = "-"; } else { if (Bill_Flag == "Parcel is in tax sale" || Bill_Flag.Trim() != "$0.00") { DateTime G_Date = Convert.ToDateTime(Good_through_date); string dateChecking = DateTime.Now.ToString("MM") + "/15/" + DateTime.Now.ToString("yyyy"); if (G_Date < Convert.ToDateTime(dateChecking)) { //end of the month Good_through_date = new DateTime(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(Convert.ToInt16(DateTime.Now.ToString("MM"))), DateTime.DaysInMonth(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(DateTime.Now.ToString("MM")))).ToString("MM/dd/yyyy"); } else if (G_Date > Convert.ToDateTime(dateChecking)) { // nextEndOfMonth if ((Convert.ToInt16(Convert.ToInt16(DateTime.Now.ToString("MM"))) < 12)) { Good_through_date = new DateTime(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(Convert.ToInt16(DateTime.Now.ToString("MM")) + 1), DateTime.DaysInMonth(Convert.ToInt16(DateTime.Now.ToString("yyyy")), Convert.ToInt16(DateTime.Now.ToString("MM")) + 1)).ToString("MM/dd/yyyy"); IWebElement Inextmonth = driver.FindElement(By.XPath("//*[@id='ui-datepicker-div']/div/a[2]")); Inextmonth.Click(); } else { int nxtYr = Convert.ToInt16(DateTime.Now.ToString("yyyy")) + 1; Good_through_date = new DateTime(nxtYr, 1, DateTime.DaysInMonth(Convert.ToInt16(DateTime.Now.ToString("yyyy")), 1)).ToString("dd/MM/yyyy"); } } driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox")).Clear(); string[] daysplit = Good_through_date.Split('/'); Thread.Sleep(5000); //*[@id="ui-datepicker-div"]/div/a[2] //driver.FindElement(By.XPath("//*[@id='ui-datepicker-div']/div/a[2]")).Click(); IWebElement Iday = driver.FindElement(By.XPath("//*[@id='ui-datepicker-div']/table/tbody")); IList <IWebElement> IdayRow = Iday.FindElements(By.TagName("a")); foreach (IWebElement day in IdayRow) { if (day.Text != "" && day.Text == daysplit[1]) { day.SendKeys(Keys.Enter); } } // driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_AsOfDateTextBox")).Click(); Thread.Sleep(5000); } } } catch { } gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "ViewBill" + i, driver, "MD", "Washington"); Bill_tax_Year = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillYearRow']/td")).Text; Bill_tax = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillNumberRow']/td")).Text; Bill_Owner = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_OwnerRow']/td")).Text; IWebElement TaxInfoTB = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_BillDetailsUpdatePanel']/table/tbody")); IList <IWebElement> TaxInfoTR = TaxInfoTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxInfoTD; foreach (IWebElement TaxInfo in TaxInfoTR) { TaxInfoTD = TaxInfo.FindElements(By.TagName("td")); if (TaxInfoTD.Count != 0 && TaxInfoTD.Count == 7 && !TaxInfo.Text.Contains("Installment")) { TaxBill_Installment = TaxInfoTD[0].Text; TaxBill_PayBy = TaxInfoTD[1].Text; TaxBill_Amount = TaxInfoTD[2].Text; TaxBill_Credits = TaxInfoTD[3].Text; TaxBill_Balance = TaxInfoTD[4].Text; TaxBill_Interest = TaxInfoTD[5].Text; TaxBill_Due = TaxInfoTD[6].Text; TaxInfo_Details = Bill_tax_Year + "~" + Bill_tax + "~" + Bill_Owner + "~" + TaxBill_Installment + "~" + TaxBill_PayBy + "~" + TaxBill_Amount + "~" + TaxBill_Credits + "~" + TaxBill_Balance + "~" + TaxBill_Interest + "~" + TaxBill_Due + "~" + Good_through_date; gc.insert_date(orderNumber, tax_Parcelid, 1347, TaxInfo_Details, 1, DateTime.Now); } if (TaxInfoTD.Count == 6) { TaxBill_Installment1 = TaxInfoTD[0].Text; TaxBill_PayBy1 = ""; TaxBill_Amount1 = TaxInfoTD[1].Text; TaxBill_Credits1 = TaxInfoTD[2].Text; TaxBill_Balance1 = TaxInfoTD[3].Text; TaxBill_Interest1 = TaxInfoTD[4].Text; TaxBill_Due1 = TaxInfoTD[5].Text; TaxInfo_Details = Bill_tax_Year + "~" + Bill_tax + "~" + Bill_Owner + "~" + TaxBill_Installment1 + "~" + TaxBill_PayBy1 + "~" + TaxBill_Amount1 + "~" + TaxBill_Credits1 + "~" + TaxBill_Balance1 + "~" + TaxBill_Interest1 + "~" + TaxBill_Due1 + "~" + Good_through_date; gc.insert_date(orderNumber, tax_Parcelid, 1347, TaxInfo_Details, 1, DateTime.Now); } } //Tax Pay/Adjust try { driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_ViewBill1_ViewPaymentsLinkButton")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "Tax PayAdjust" + i, driver, "MD", "Washington"); IWebElement TaxPayTB = driver.FindElement(By.XPath("//*[@id='innerContent']/table[2]/tbody")); IList <IWebElement> TaxPayTR = TaxPayTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxPayTD; foreach (IWebElement TaxPay in TaxPayTR) { TaxPayTD = TaxPay.FindElements(By.TagName("td")); if (TaxPayTD.Count != 0 && !TaxPay.Text.Contains("Activity")) { TaxPay_Activity = TaxPayTD[0].Text; TaxPay_Posted = TaxPayTD[1].Text; TaxPay_Reference = TaxPayTD[2].Text; TaxPay_Amount = TaxPayTD[3].Text; TaxPay_Details = Bill_tax_Year + "~" + TaxPay_Activity + "~" + TaxPay_Posted + "~" + TaxPay_Reference + "~" + TaxPay_Amount; gc.insert_date(orderNumber, tax_Parcelid, 1348, TaxPay_Details, 1, DateTime.Now); } } } catch { } //Tax Charges driver.FindElement(By.LinkText("Charges")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "Tax Charge" + i, driver, "MD", "Washington"); IWebElement TaxChargeTB = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_TaxChargesTable']")); IList <IWebElement> TaxChargeTR = TaxChargeTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxChargeTD; IList <IWebElement> TaxChargeTH; foreach (IWebElement TaxCharge in TaxChargeTR) { TaxChargeTD = TaxCharge.FindElements(By.TagName("td")); TaxChargeTH = TaxCharge.FindElements(By.TagName("th")); if (TaxChargeTD.Count != 0 && TaxChargeTD.Count == 3 && !TaxCharge.Text.Contains("Taxable Value") && TaxChargeTH.Count == 1) { TaxCharge_Entity = TaxChargeTH[0].Text; TaxCharge_taxable = TaxChargeTD[0].Text; TaxCharge_taxRate = TaxChargeTD[1].Text; TaxCharge_Amount = TaxChargeTD[2].Text; TaxCharge_Details = Bill_tax_Year + "~" + TaxCharge_Entity + "~" + TaxCharge_taxable + "~" + TaxCharge_taxRate + "~" + TaxCharge_Amount; gc.insert_date(orderNumber, tax_Parcelid, 1349, TaxCharge_Details, 1, DateTime.Now); } if (TaxChargeTD.Count == 1 && TaxChargeTH.Count == 1) { TaxCharge_Entity1 = TaxChargeTH[0].Text; TaxCharge_taxable1 = ""; TaxCharge_taxRate1 = ""; TaxCharge_Amount1 = TaxChargeTD[0].Text; TaxCharge_Details1 = Bill_tax_Year + "~" + TaxCharge_Entity1 + "~" + "" + "~" + "" + "~" + TaxCharge_Amount1; gc.insert_date(orderNumber, tax_Parcelid, 1349, TaxCharge_Details1, 1, DateTime.Now); } } TaxCharge_Entity2 = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_TotalTaxTable']/tbody/tr/th")).Text; TaxCharge_Amount2 = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_TotalTaxTable']/tbody/tr/td")).Text; TaxCharge_Details2 = Bill_tax_Year + "~" + TaxCharge_Entity2 + "~" + "" + "~" + "" + "~" + TaxCharge_Amount2; gc.insert_date(orderNumber, tax_Parcelid, 1349, TaxCharge_Details2, 1, DateTime.Now); //property Detail driver.FindElement(By.LinkText("Property Detail")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "property Detail" + i, driver, "MD", "Washington"); //Owner Information driver.FindElement(By.LinkText("Owner Information")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "Owner Information" + i, driver, "MD", "Washington"); //assessment driver.FindElement(By.LinkText("Assessment")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "Assessment" + i, driver, "MD", "Washington"); IWebElement assessmenttable = driver.FindElement(By.XPath("//*[@id='innerContent']/table[2]/tbody")); IList <IWebElement> assessmentrow = assessmenttable.FindElements(By.TagName("tr")); IList <IWebElement> assessmentidtr; IList <IWebElement> assessmentidth; foreach (IWebElement assessment in assessmentrow) { assessmentidtr = assessment.FindElements(By.TagName("td")); assessmentidth = assessment.FindElements(By.TagName("th")); if (assessmentidtr.Count != 0) { string assessmentresult = Bill_tax_Year + "~" + assessmentidth[0].Text + "~" + assessmentidtr[0].Text; gc.insert_date(orderNumber, tax_Parcelid, 1474, assessmentresult, 1, DateTime.Now); } } //Assessment History driver.FindElement(By.LinkText("Assessment History")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "Assessment History" + i, driver, "MD", "Washington"); //Tax rate driver.FindElement(By.LinkText("Tax Rates")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "Tax Rates" + i, driver, "MD", "Washington"); //All bills try { driver.FindElement(By.LinkText("All Bills")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "Tax Uitility Bill" + i, driver, "MD", "Washington"); if (i == 0) { IWebElement TaxHistoryTable = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillsRepeater_ctl00_BillsGrid']/tbody")); IList <IWebElement> TaxHistoryTR = TaxHistoryTable.FindElements(By.TagName("tr")); IList <IWebElement> TaxHistoryTD; foreach (IWebElement TaxHistory in TaxHistoryTR) { TaxHistoryTD = TaxHistory.FindElements(By.TagName("td")); if (!TaxHistory.Text.Contains("Year")) { Bill = TaxHistoryTD[0].Text; tax_Type = TaxHistoryTD[1].Text; Year = TaxHistoryTD[2].Text; Tax_Owner = TaxHistoryTD[3].Text; Tax_paid = TaxHistoryTD[4].Text; TaxHistory_Info = Bill + "~" + tax_Type + "~" + Year + "~" + Tax_Owner + "~" + Tax_paid; gc.insert_date(orderNumber, tax_Parcelid, 1346, TaxHistory_Info, 1, DateTime.Now); } } } } catch { } i++; } if (viewlien.Count != 0) { List <string> Viewbillline = new List <string>(); foreach (string Line in viewlien) { driver.Navigate().GoToUrl(currwindow); Thread.Sleep(3000); driver.FindElement(By.Id(Line)).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "line view detail", driver, "MD", "Washington"); IWebElement LineFoundTable = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillsGrid']/tbody")); IList <IWebElement> Linefoundrow = LineFoundTable.FindElements(By.TagName("tr")); IList <IWebElement> linefoundid; foreach (IWebElement Linefound in Linefoundrow) { linefoundid = Linefound.FindElements(By.TagName("td")); //if (linefoundid.Count != 0) //{ // string Linefoundresult = linefoundid[1].Text + "~" + linefoundid[2].Text + "~" + linefoundid[3].Text + "~" + linefoundid[4].Text; // gc.insert_date(orderNumber, tax_Parcelid, 1456, Linefoundresult, 1, DateTime.Now); //} if (Linefound.Text.Contains("View Bill")) { IWebElement Viewbill = linefoundid[5].FindElement(By.TagName("a")); string Viewbillid = Viewbill.GetAttribute("id"); Viewbillline.Add(Viewbillid); } } } int Linevi = 0; foreach (string viewlinelink in Viewbillline) { driver.FindElement(By.Id(viewlinelink)).Click(); Thread.Sleep(2000); string linebillyear = "", linebill = "", lineownername = ""; gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "line Bill detail" + Linevi, driver, "MD", "Washington"); linebillyear = driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_FiscalYearLabel")).Text; linebill = driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillNumberLabel")).Text; lineownername = driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_OwnerLabel")).Text; IWebElement TaxInfoTB = driver.FindElement(By.XPath("//*[@id='ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_BillDetailsUpdatePanel']/table/tbody")); IList <IWebElement> TaxInfoTR = TaxInfoTB.FindElements(By.TagName("tr")); IList <IWebElement> TaxInfoTD; foreach (IWebElement TaxInfo in TaxInfoTR) { TaxInfoTD = TaxInfo.FindElements(By.TagName("td")); if (TaxInfoTD.Count != 0 && TaxInfoTD.Count == 6 && !TaxInfo.Text.Contains("Installment")) { TaxBill_Installment = TaxInfoTD[0].Text; TaxBill_PayBy = TaxInfoTD[1].Text; TaxBill_Amount = TaxInfoTD[2].Text; TaxBill_Credits = TaxInfoTD[3].Text; TaxBill_Balance = TaxInfoTD[4].Text; TaxBill_Interest = TaxInfoTD[5].Text; TaxInfo_Details = linebillyear + "~" + linebill + "~" + lineownername + "~" + TaxBill_Installment + "~" + TaxBill_PayBy + "~" + TaxBill_Amount + "~" + TaxBill_Credits + "~" + TaxBill_Balance + "~" + TaxBill_Interest; gc.insert_date(orderNumber, tax_Parcelid, 1455, TaxInfo_Details, 1, DateTime.Now); } if (TaxInfoTD.Count == 5) { TaxBill_Installment1 = TaxInfoTD[0].Text; TaxBill_PayBy1 = ""; TaxBill_Amount1 = TaxInfoTD[1].Text; TaxBill_Credits1 = TaxInfoTD[2].Text; TaxBill_Balance1 = TaxInfoTD[3].Text; TaxBill_Interest1 = TaxInfoTD[4].Text; TaxInfo_Details = linebillyear + "~" + linebill + "~" + lineownername + "~" + TaxBill_Installment1 + "~" + TaxBill_PayBy1 + "~" + TaxBill_Amount1 + "~" + TaxBill_Credits1 + "~" + TaxBill_Balance1 + "~" + TaxBill_Interest1; gc.insert_date(orderNumber, tax_Parcelid, 1455, TaxInfo_Details, 1, DateTime.Now); } } driver.FindElement(By.Id("ctl00_ctl00_PrimaryPlaceHolder_ContentPlaceHolderMain_PaymentsAdjustmentsLinkButton")).Click(); Thread.Sleep(2000); gc.CreatePdf_Chrome(orderNumber, tax_Parcelid, "line Payment detail" + Linevi, driver, "MD", "Washington"); IWebElement assessmenttable1 = driver.FindElement(By.XPath("//*[@id='innerContent']/table[2]/tbody")); IList <IWebElement> assessmentrow1 = assessmenttable1.FindElements(By.TagName("tr")); IList <IWebElement> assessmentidtr1; IList <IWebElement> assessmentidth; foreach (IWebElement assessment1 in assessmentrow1) { assessmentidtr1 = assessment1.FindElements(By.TagName("td")); assessmentidth = assessment1.FindElements(By.TagName("th")); if (assessmentidtr1.Count != 0) { string assessmentresult1 = linebillyear + "~" + assessmentidtr1[0].Text + "~" + assessmentidtr1[1].Text + "~" + assessmentidtr1[2].Text + "~" + assessmentidtr1[3].Text; gc.insert_date(orderNumber, tax_Parcelid, 1477, assessmentresult1, 1, DateTime.Now); } } driver.FindElement(By.XPath("//*[@id='innerContent']/ul/li[2]/a")).Click(); Thread.Sleep(2000); Linevi++; } } TaxTime = DateTime.Now.ToString("HH:mm:ss"); LastEndTime = DateTime.Now.ToString("HH:mm:ss"); gc.insert_TakenTime(orderNumber, "MD", "Washington", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime); driver.Quit(); gc.mergpdf(orderNumber, "MD", "Washington"); return("Data Inserted Successfully"); } catch (Exception ex) { driver.Quit(); GlobalClass.LogError(ex, orderNumber); throw ex; } } }