private void ProcessSelectElement(SelectElement SelectElement, string ParentType, WithCtesAndXmlNamespaces Cte)
        {
            string ElemType = FragmentTypeParser.GetFragmentType(SelectElement);
            switch (ElemType)
            {
                case "SelectStarExpression":
                    _smells.SendFeedBack(5, SelectElement);
                    break;
                case "SelectScalarExpression":

                    var ScalarExpression = (SelectScalarExpression)SelectElement;
                    string ExpressionType = FragmentTypeParser.GetFragmentType(ScalarExpression.Expression);
                    switch (ExpressionType)
                    {
                        case "ScalarSubquery":
                            var SubQuery = (ScalarSubquery)ScalarExpression.Expression;
                            _smells.ProcessQueryExpression(SubQuery.QueryExpression, ParentType, false, Cte);
                            break;
                        case "ColumnReferenceExpression":
                            var Expression = (ColumnReferenceExpression)ScalarExpression.Expression;
                            break;
                        case "FunctionCall":
                            _smells.FunctionProcessor.ProcessFunctionCall((FunctionCall)ScalarExpression.Expression);
                            break;
                        case "IntegerLiteral":
                            break;
                        case "ConvertCall":
                            break;
                    }
                    break;
                case "SelectSetVariable":
                    _smells.SelectSetProcessor.ProcessSelectSetVariable((SelectSetVariable)SelectElement);
                    break;
            }
        }
 public void Accept(SelectElement node)
 {
     if (this.ParentElement != null)
     {
         this.ParentElement.Accept(node);
     }
     else
     {
         this.ParentElement = node;
     }
 }
 public void Action_SelectOptionByIndex(int index)
 {
     SelectElement selectedElementObj = new SelectElement(_selectedElementItem.refElement);
     if (selectedElementObj != null)
     {
         if (index >= 0)
         {
             selectedElementObj.SelectByIndex(index);
         }
     }
 }
        public string FTP_FLPalmBeach(string address, string ownername, string parcelNumber, string searchType, string orderNumber, 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;
            string[] stringSeparators1 = new string[] { "\r\n" };
            using (driver = new PhantomJSDriver())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");
                    if (searchType == "titleflex")
                    {
                        // string titleaddress = houseno + " " + housedir + " " + sname + " " + sttype + " " + unitno;
                        gc.TitleFlexSearch(orderNumber, "", "", address, "FL", "Palm Beach");
                        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_FLPalmBeach"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("http://www.pbcgov.com/PAPA/index.htm");
                        Thread.Sleep(4000);

                        IWebElement iframeElement = driver.FindElement(By.Id("master-search"));
                        Thread.Sleep(6000);
                        driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.Id("txtSearch")).SendKeys(address);
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "FL", "Palm Beach");

                        driver.FindElement(By.XPath("//*[@id='form2']/div[3]/div[1]/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        //MultiParcel
                        try
                        {
                            IWebElement         MultiTable = driver.FindElement(By.Id("gvSrchResults"));
                            IList <IWebElement> MultiTR    = MultiTable.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiTD;

                            int maxCheck = 0;

                            gc.CreatePdf_WOP(orderNumber, "MultiAddresssearch", driver, "FL", "Palm Beach");
                            foreach (IWebElement Multi in MultiTR)
                            {
                                MultiTD = Multi.FindElements(By.TagName("td"));
                                if (MultiTD.Count != 0 && !Multi.Text.Contains("Owner Name"))
                                {
                                    OwnerName    = MultiTD[0].Text;
                                    Location     = MultiTD[1].Text;
                                    Municipality = MultiTD[2].Text;
                                    parcelNumber = MultiTD[3].Text;

                                    Multidata = OwnerName + "~" + Location + "~" + Municipality;
                                    gc.insert_date(orderNumber, parcelNumber, 330, Multidata, 1, DateTime.Now);
                                }
                                maxCheck++;
                            }


                            if (maxCheck <= 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLPalmBeach"] = "Yes";
                                GlobalClass.multiParcel_FLPalmBeach = "Yes";
                                driver.Quit();
                                return("MultiParcel");
                            }
                            if (MultiTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLPalmBeach_Multicount"] = "Maximum";
                                GlobalClass.multiParcel_FLPalmBeach_Multicount = "Maximum";
                                driver.Quit();
                                return("Maximum");
                            }
                        }
                        catch
                        { }
                    }
                    else if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("http://www.pbcgov.com/PAPA/index.htm");
                        Thread.Sleep(2000);

                        IWebElement iframeElement = driver.FindElement(By.Id("master-search"));
                        Thread.Sleep(6000);
                        driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.Id("txtSearch")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "ParcelSearch", driver, "FL", "Palm Beach");

                        driver.FindElement(By.XPath("//*[@id='form2']/div[3]/div[1]/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);
                    }
                    else if (searchType == "ownername")
                    {
                        driver.Navigate().GoToUrl("http://www.pbcgov.com/PAPA/index.htm");
                        Thread.Sleep(2000);

                        IWebElement iframeElement = driver.FindElement(By.Id("master-search"));
                        Thread.Sleep(6000);
                        driver.SwitchTo().Frame(iframeElement);

                        driver.FindElement(By.Id("txtSearch")).SendKeys(ownername);
                        gc.CreatePdf(orderNumber, parcelNumber, "OwnerSearch", driver, "FL", "Palm Beach");

                        driver.FindElement(By.XPath("//*[@id='form2']/div[3]/div[1]/div/button")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        //MultiParcel
                        try
                        {
                            IWebElement         MultiTable = driver.FindElement(By.Id("gvSrchResults"));
                            IList <IWebElement> MultiTR    = MultiTable.FindElements(By.TagName("tr"));
                            IList <IWebElement> MultiTD;

                            int maxCheck = 0;

                            gc.CreatePdf_WOP(orderNumber, "MultiOwnersearch", driver, "FL", "Palm Beach");
                            foreach (IWebElement Multi in MultiTR)
                            {
                                if (maxCheck <= 25)
                                {
                                    MultiTD = Multi.FindElements(By.TagName("td"));
                                    if (MultiTD.Count != 0 && !Multi.Text.Contains("Owner Name"))
                                    {
                                        OwnerName    = MultiTD[0].Text;
                                        Location     = MultiTD[1].Text;
                                        Municipaliti = MultiTD[2].Text;
                                        parcelNumber = MultiTD[3].Text;

                                        Multidata = OwnerName + "~" + Location + "~" + Municipaliti;
                                        gc.insert_date(orderNumber, parcelNumber, 330, Multidata, 1, DateTime.Now);
                                    }
                                    maxCheck++;
                                }
                            }
                            HttpContext.Current.Session["multiParcel_FLPalmBeach"] = "Yes";
                            if (MultiTR.Count > 25)
                            {
                                HttpContext.Current.Session["multiParcel_FLPalmBeach_Multicount"] = "Maximum";
                                return("Maximum");
                            }
                            driver.Quit();
                            return("MultiParcel");
                        }
                        catch
                        { }
                    }

                    try
                    {
                        string Nodata = driver.FindElement(By.Id("MainContent_lblMsg")).Text;
                        if (Nodata == "No Results matched your search criteria. Please modify your search and try again.")
                        {
                            HttpContext.Current.Session["Nodata_FLPalmBeach"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch
                    { }

                    //Scraped Data
                    Location_Address = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[2]/td[2]")).Text;
                    Municipality     = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[3]/td[2]")).Text;
                    ParcelNo         = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[4]/td[2]")).Text;
                    gc.CreatePdf(orderNumber, ParcelNo, "Property Result", driver, "FL", "Palm Beach");
                    try
                    {
                        SubDivision       = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[5]/td[2]")).Text;
                        Legal_Description = driver.FindElement(By.XPath("//*[@id='tdDetail']/table/tbody/tr[8]/td[2]")).Text;

                        IWebElement         Acrestable = driver.FindElement(By.XPath("//*[@id='propertyInformationDiv']/fieldset/table[1]/tbody/tr[2]/td[1]/table[2]/tbody"));
                        IList <IWebElement> AcresTR    = Acrestable.FindElements(By.TagName("tr"));
                        IList <IWebElement> AcresTD;

                        foreach (IWebElement Acre in AcresTR)
                        {
                            AcresTD = Acre.FindElements(By.TagName("td"));
                            if (AcresTD.Count != 0 && Acre.Text.Contains("Acres"))
                            {
                                Acres = AcresTD[1].Text;
                            }
                        }

                        IWebElement         Yeartable = driver.FindElement(By.XPath("//*[@id='propertyInformationDiv']/fieldset/table[1]/tbody/tr[2]/td[2]/table/tbody"));
                        IList <IWebElement> YearTR    = Yeartable.FindElements(By.TagName("tr"));
                        IList <IWebElement> YearTD;

                        foreach (IWebElement Year in YearTR)
                        {
                            YearTD = Year.FindElements(By.TagName("td"));
                            if (YearTD.Count != 0 && Year.Text.Contains("Year Built"))
                            {
                                Year_Built = YearTD[2].Text;
                            }
                        }

                        IWebElement         OwnerTable = driver.FindElement(By.XPath("//*[@id='ownerInformationDiv']/fieldset/table/tbody/tr[2]/td[1]/table/tbody"));
                        IList <IWebElement> OwnerTR    = OwnerTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> OwnerTD;

                        foreach (IWebElement Owner in OwnerTR)
                        {
                            OwnerTD = Owner.FindElements(By.TagName("td"));
                            if (OwnerTD.Count != 0 && !Owner.Text.Contains("Owner(s)"))
                            {
                                Owner_Name += OwnerTD[0].Text + " ";
                            }
                        }
                        string Mailaddress1     = driver.FindElement(By.Id("MainContent_lblAddrLine3")).Text;
                        string Mailing_Address2 = driver.FindElement(By.XPath("//*[@id='ownerInformationDiv']/fieldset/table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td")).Text;
                        Mailing_Address = Mailing_Address2 + " " + Mailaddress1;
                    }
                    catch
                    { }
                    Property_Details = Location_Address + "~" + Municipality + "~" + SubDivision + "~" + Legal_Description + "~" + Acres + "~" + Year_Built + "~" + Owner_Name + "~" + Mailing_Address;
                    gc.insert_date(orderNumber, ParcelNo, 338, Property_Details, 1, DateTime.Now);

                    //Appraisals Details
                    try
                    {
                        IWebElement         AppraisalsTable = driver.FindElement(By.XPath("//*[@id='tblApprsal']/tbody"));
                        IList <IWebElement> AppraisalsTR    = AppraisalsTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> AppraisalsTD;

                        List <string> Tax_Year          = new List <string>();
                        List <string> Improvement_Value = new List <string>();
                        List <string> Land_Value        = new List <string>();
                        List <string> TotalMarket_Value = new List <string>();

                        int i = 1;
                        foreach (IWebElement Appraisals in AppraisalsTR)
                        {
                            AppraisalsTD = Appraisals.FindElements(By.TagName("td"));
                            if (!Appraisals.Text.Contains("Show 5 year"))
                            {
                                if (i == 1)
                                {
                                    Tax_Year.Add(AppraisalsTD[1].Text);
                                    Tax_Year.Add(AppraisalsTD[2].Text);
                                    Tax_Year.Add(AppraisalsTD[3].Text);
                                    Tax_Year.Add(AppraisalsTD[4].Text);
                                    Tax_Year.Add(AppraisalsTD[5].Text);
                                }
                                else if (i == 2)
                                {
                                    Improvement_Value.Add(AppraisalsTD[1].Text);
                                    Improvement_Value.Add(AppraisalsTD[2].Text);
                                    Improvement_Value.Add(AppraisalsTD[3].Text);
                                    Improvement_Value.Add(AppraisalsTD[4].Text);
                                    Improvement_Value.Add(AppraisalsTD[5].Text);
                                }
                                else if (i == 3)
                                {
                                    Land_Value.Add(AppraisalsTD[1].Text);
                                    Land_Value.Add(AppraisalsTD[2].Text);
                                    Land_Value.Add(AppraisalsTD[3].Text);
                                    Land_Value.Add(AppraisalsTD[4].Text);
                                    Land_Value.Add(AppraisalsTD[5].Text);
                                }
                                else if (i == 4)
                                {
                                    TotalMarket_Value.Add(AppraisalsTD[1].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[2].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[3].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[4].Text);
                                    TotalMarket_Value.Add(AppraisalsTD[5].Text);
                                }
                                i++;
                            }
                        }
                        Appraisals_details1 = Tax_Year[0] + "~" + Improvement_Value[0] + "~" + Land_Value[0] + "~" + TotalMarket_Value[0];
                        Appraisals_details2 = Tax_Year[1] + "~" + Improvement_Value[1] + "~" + Land_Value[1] + "~" + TotalMarket_Value[1];
                        Appraisals_details3 = Tax_Year[2] + "~" + Improvement_Value[2] + "~" + Land_Value[2] + "~" + TotalMarket_Value[2];
                        Appraisals_details4 = Tax_Year[3] + "~" + Improvement_Value[3] + "~" + Land_Value[3] + "~" + TotalMarket_Value[3];
                        Appraisals_details5 = Tax_Year[4] + "~" + Improvement_Value[4] + "~" + Land_Value[4] + "~" + TotalMarket_Value[4];
                        //gc.CreatePdf(orderNumber, ParcelNo, "Appraisls Details", driver, "FL", "Palm Beach");
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details1, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details2, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details3, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details4, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 342, Appraisals_details5, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //Assessed Details
                    try
                    {
                        IWebElement         AssessedTable = driver.FindElement(By.XPath("//*[@id='tblAssVal']/tbody"));
                        IList <IWebElement> AssessedTR    = AssessedTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> AssessedTD;

                        List <string> Tax_Year         = new List <string>();
                        List <string> Assessed_Value   = new List <string>();
                        List <string> Exemption_Amount = new List <string>();
                        List <string> Taxable_Value    = new List <string>();

                        int j = 1;
                        foreach (IWebElement Assessed in AssessedTR)
                        {
                            AssessedTD = Assessed.FindElements(By.TagName("td"));
                            if (!Assessed.Text.Contains("Show 5 year"))
                            {
                                if (j == 1)
                                {
                                    Tax_Year.Add(AssessedTD[1].Text);
                                    Tax_Year.Add(AssessedTD[2].Text);
                                    Tax_Year.Add(AssessedTD[3].Text);
                                    Tax_Year.Add(AssessedTD[4].Text);
                                    Tax_Year.Add(AssessedTD[5].Text);
                                }
                                else if (j == 2)
                                {
                                    Assessed_Value.Add(AssessedTD[1].Text);
                                    Assessed_Value.Add(AssessedTD[2].Text);
                                    Assessed_Value.Add(AssessedTD[3].Text);
                                    Assessed_Value.Add(AssessedTD[4].Text);
                                    Assessed_Value.Add(AssessedTD[5].Text);
                                }
                                else if (j == 3)
                                {
                                    Exemption_Amount.Add(AssessedTD[1].Text);
                                    Exemption_Amount.Add(AssessedTD[2].Text);
                                    Exemption_Amount.Add(AssessedTD[3].Text);
                                    Exemption_Amount.Add(AssessedTD[4].Text);
                                    Exemption_Amount.Add(AssessedTD[5].Text);
                                }
                                else if (j == 4)
                                {
                                    Taxable_Value.Add(AssessedTD[1].Text);
                                    Taxable_Value.Add(AssessedTD[2].Text);
                                    Taxable_Value.Add(AssessedTD[3].Text);
                                    Taxable_Value.Add(AssessedTD[4].Text);
                                    Taxable_Value.Add(AssessedTD[5].Text);
                                }
                                j++;
                            }
                        }
                        Assessed_details1 = Tax_Year[0] + "~" + Assessed_Value[0] + "~" + Exemption_Amount[0] + "~" + Taxable_Value[0];
                        Assessed_details2 = Tax_Year[1] + "~" + Assessed_Value[1] + "~" + Exemption_Amount[1] + "~" + Taxable_Value[1];
                        Assessed_details3 = Tax_Year[2] + "~" + Assessed_Value[2] + "~" + Exemption_Amount[2] + "~" + Taxable_Value[2];
                        Assessed_details4 = Tax_Year[3] + "~" + Assessed_Value[3] + "~" + Exemption_Amount[3] + "~" + Taxable_Value[3];
                        Assessed_details5 = Tax_Year[4] + "~" + Assessed_Value[4] + "~" + Exemption_Amount[4] + "~" + Taxable_Value[4];
                        //gc.CreatePdf(orderNumber, ParcelNo, "Assessed Details", driver, "FL", "Palm Beach");
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details1, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details2, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details3, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details4, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 348, Assessed_details5, 1, DateTime.Now);
                    }
                    catch
                    { }
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");

                    //TaxesValue Details
                    try
                    {
                        IWebElement         TaxesValueTable = driver.FindElement(By.XPath("//*[@id='tblTaxes']/tbody"));
                        IList <IWebElement> TaxesValueTR    = TaxesValueTable.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxesValueTD;

                        List <string> Tax_Year      = new List <string>();
                        List <string> Ad_Valorem    = new List <string>();
                        List <string> NonAd_Valorem = new List <string>();
                        List <string> Total_tax     = new List <string>();

                        int k = 1;
                        foreach (IWebElement TaxesValue in TaxesValueTR)
                        {
                            TaxesValueTD = TaxesValue.FindElements(By.TagName("td"));
                            if (!TaxesValue.Text.Contains("Show 5 year"))
                            {
                                if (k == 1)
                                {
                                    Tax_Year.Add(TaxesValueTD[1].Text);
                                    Tax_Year.Add(TaxesValueTD[2].Text);
                                    Tax_Year.Add(TaxesValueTD[3].Text);
                                    Tax_Year.Add(TaxesValueTD[4].Text);
                                    Tax_Year.Add(TaxesValueTD[5].Text);
                                }
                                else if (k == 2)
                                {
                                    Ad_Valorem.Add(TaxesValueTD[1].Text);
                                    Ad_Valorem.Add(TaxesValueTD[2].Text);
                                    Ad_Valorem.Add(TaxesValueTD[3].Text);
                                    Ad_Valorem.Add(TaxesValueTD[4].Text);
                                    Ad_Valorem.Add(TaxesValueTD[5].Text);
                                }
                                else if (k == 3)
                                {
                                    NonAd_Valorem.Add(TaxesValueTD[1].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[2].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[3].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[4].Text);
                                    NonAd_Valorem.Add(TaxesValueTD[5].Text);
                                }
                                else if (k == 4)
                                {
                                    Total_tax.Add(TaxesValueTD[1].Text);
                                    Total_tax.Add(TaxesValueTD[2].Text);
                                    Total_tax.Add(TaxesValueTD[3].Text);
                                    Total_tax.Add(TaxesValueTD[4].Text);
                                    Total_tax.Add(TaxesValueTD[5].Text);
                                }
                                k++;
                            }
                        }
                        TaxesValue_details1 = Tax_Year[0] + "~" + Ad_Valorem[0] + "~" + NonAd_Valorem[0] + "~" + Total_tax[0];
                        TaxesValue_details2 = Tax_Year[1] + "~" + Ad_Valorem[1] + "~" + NonAd_Valorem[1] + "~" + Total_tax[1];
                        TaxesValue_details3 = Tax_Year[2] + "~" + Ad_Valorem[2] + "~" + NonAd_Valorem[2] + "~" + Total_tax[2];
                        TaxesValue_details4 = Tax_Year[3] + "~" + Ad_Valorem[3] + "~" + NonAd_Valorem[3] + "~" + Total_tax[3];
                        TaxesValue_details5 = Tax_Year[4] + "~" + Ad_Valorem[4] + "~" + NonAd_Valorem[4] + "~" + Total_tax[4];
                        //gc.CreatePdf(orderNumber, ParcelNo, "TaxValues Details", driver, "FL", "Palm Beach");
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details1, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details2, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details3, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details4, 1, DateTime.Now);
                        gc.insert_date(orderNumber, ParcelNo, 349, TaxesValue_details5, 1, DateTime.Now);
                    }
                    catch
                    { }

                    //Tax Information Details
                    driver.Navigate().GoToUrl("https://pbctax.manatron.com/Tabs/PropertyTax.aspx");
                    Thread.Sleep(2000);

                    var SelectParcel    = driver.FindElement(By.Id("selSearchBy"));
                    var SelectParcelTax = new SelectElement(SelectParcel);
                    SelectParcelTax.SelectByText("Property Control Number");

                    driver.FindElement(By.Id("fldInput")).SendKeys(ParcelNo);
                    driver.FindElement(By.Id("btnsearch")).SendKeys(Keys.Enter);
                    Thread.Sleep(2000);

                    gc.CreatePdf(orderNumber, ParcelNo, "ParcelTax Details", driver, "FL", "Palm Beach");
                    driver.FindElement(By.XPath("//*[@id='grm-search']/tbody/tr[2]/td[6]/a")).Click();
                    Thread.Sleep(2000);
                    gc.CreatePdf(orderNumber, ParcelNo, "Tax Summary Details", driver, "FL", "Palm Beach");

                    Real_Property    = driver.FindElement(By.XPath("//*[@id='lxT506']/table/tbody/tr[2]/td[2]")).Text;
                    property_Address = driver.FindElement(By.XPath("//*[@id='lxT506']/table/tbody/tr[3]/td/table/tbody/tr[1]/td[2]")).Text;
                    property_Address = WebDriverTest.After(property_Address, "Property Address:").Trim();
                    string[] linesName = property_Address.Split(stringSeparators1, StringSplitOptions.None);
                    OwnerOf_record = driver.FindElement(By.XPath("//*[@id='lxT506']/table/tbody/tr[3]/td/table/tbody/tr[2]/td[1]")).Text;
                    OwnerOf_record = WebDriverTest.After(OwnerOf_record, "Owner of Record").Trim();
                    string[] linesName1 = OwnerOf_record.Split(stringSeparators1, StringSplitOptions.None);
                    driver.Navigate().GoToUrl("https://www.pbctax.com/content/help");
                    Thread.Sleep(2000);
                    Tax_Authority = driver.FindElement(By.XPath("//*[@id='content-area']/div/div/div/div[1]/p")).Text.Replace("Mailing Address", "").Trim();
                    gc.CreatePdf(orderNumber, ParcelNo, "Tax Authority", driver, "FL", "Palm Beach");
                    driver.Navigate().Back();
                    Thread.Sleep(2000);
                    TaxBill_Details = Real_Property + "~" + property_Address + "~" + OwnerOf_record + "~" + Tax_Authority;
                    gc.insert_date(orderNumber, ParcelNo, 357, TaxBill_Details, 1, DateTime.Now);

                    //Tax Payment History Details
                    List <string> billinfo = new List <string>();
                    try
                    {
                        IWebElement         TaxPaymentTB = driver.FindElement(By.XPath("//*[@id='508']/table/tbody"));
                        IList <IWebElement> TaxPaymentTR = TaxPaymentTB.FindElements(By.TagName("tr"));
                        IList <IWebElement> TaxPaymentTD;
                        int a = 0;
                        //gc.CreatePdf(orderNumber, ParcelNo, "Tax Payment Details", driver, "FL", "Palm Beach");
                        foreach (IWebElement TaxPayment in TaxPaymentTR)
                        {
                            TaxPaymentTD = TaxPayment.FindElements(By.TagName("td"));
                            if (TaxPaymentTD.Count != 0)
                            {
                                if (a < 3)
                                {
                                    if (TaxPaymentTD.Count != 0 && !TaxPayment.Text.Contains("Bill Year"))
                                    {
                                        IWebElement value1  = TaxPaymentTD[0].FindElement(By.TagName("a"));
                                        string      addview = value1.GetAttribute("href");
                                        billinfo.Add(addview);
                                    }
                                    a++;
                                }
                                Bill_Year         = TaxPaymentTD[0].Text;
                                Bill_Type         = TaxPaymentTD[1].Text;
                                Bill_Number       = TaxPaymentTD[2].Text;
                                Gross_Tax         = TaxPaymentTD[3].Text;
                                Penalty_Fees      = TaxPaymentTD[4].Text;
                                Interest          = TaxPaymentTD[5].Text;
                                Discount          = TaxPaymentTD[6].Text;
                                Amount_Due        = TaxPaymentTD[7].Text;
                                TaxpaymentDetails = Bill_Year + "~" + Bill_Type + "~" + Bill_Number + "~" + Gross_Tax + "~" + Penalty_Fees + "~" + Interest + "~" + Discount + "~" + Amount_Due;
                                gc.insert_date(orderNumber, ParcelNo, 359, TaxpaymentDetails, 1, DateTime.Now);
                            }
                        }
                    }
                    catch
                    { }
                    //Tax Bill
                    int s = 0;
                    foreach (string taxinfoclick in billinfo)
                    {
                        try
                        {
                            driver.Navigate().GoToUrl(taxinfoclick);
                            Thread.Sleep(2000);
                            gc.CreatePdf(orderNumber, ParcelNo, "TaxBill_priorYear" + s, driver, "FL", "Palm Beach");
                            Billtaxyear = driver.FindElement(By.XPath("//*[@id='lxT538']/h1")).Text.Replace("Bill Detail", "").Trim();
                            //Tax And Assement Details//
                            IWebElement         TaxAssementTB = driver.FindElement(By.XPath("//*[@id='dnn_ContentPane']/div[4]"));
                            IList <IWebElement> TaxAssementTR = TaxAssementTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxAssementTD;
                            int taxrowcount = TaxAssementTR.Count;
                            int b           = 1; /*string pathid = "";*/
                            foreach (IWebElement TaxAssement in TaxAssementTR)
                            {
                                TaxAssementTD = TaxAssement.FindElements(By.TagName("td"));
                                if (TaxAssement.Text.Contains("Ad Valorem"))
                                {
                                    Tax_Type = "Ad Valorem";
                                }
                                if (TaxAssement.Text.Contains("Non Ad Valorem"))
                                {
                                    Tax_Type = "Non Ad Valorem";
                                }

                                if (TaxAssementTD.Count != 0 && !TaxAssement.Text.Contains("Ad Valorem") && TaxAssement.Text != "" && TaxAssementTD.Count != 1 && !TaxAssement.Text.Contains("Non Ad Valorem"))
                                {
                                    if (TaxAssementTD.Count == 4 && !TaxAssement.Text.Contains("Total Tax"))
                                    {
                                        Description         = "Sub Total";
                                        TaxGross_Tax        = TaxAssementTD[0].Text;
                                        Credit              = TaxAssementTD[1].Text;
                                        Net_Tax             = TaxAssementTD[2].Text;
                                        Savings             = TaxAssementTD[3].Text;
                                        TaxAssement_Details = Billtaxyear + "~" + Tax_Type + "~" + Description + "~" + TaxGross_Tax + "~" + Credit + "~" + Net_Tax + "~" + Savings;
                                        gc.insert_date(orderNumber, ParcelNo, 363, TaxAssement_Details, 1, DateTime.Now);
                                    }
                                    else
                                    {
                                        if (b % 2 == 0 && b != taxrowcount)
                                        {
                                            try
                                            {
                                                //pathid = driver.FindElement(By.XPath("//*[@id='lxT512']/table/tbody/tr["+ b +"]/td[1]")).GetAttribute("tb");
                                                driver.FindElement(By.XPath("//*[@id='lxT512']/table/tbody/tr[" + b + "]/td[1]/a")).SendKeys(Keys.Enter);
                                                Thread.Sleep(2000);
                                                //gc.CreatePdf(orderNumber, ParcelNo, "Ad Valorem and Non Ad Valorem" + b, driver, "FL", "Palm Beach");
                                            }
                                            catch
                                            {
                                            }
                                            Description         = TaxAssementTD[0].Text;
                                            TaxGross_Tax        = TaxAssementTD[1].Text;
                                            Credit              = TaxAssementTD[2].Text;
                                            Net_Tax             = TaxAssementTD[3].Text;
                                            Savings             = TaxAssementTD[4].Text;
                                            TaxAssement_Details = Billtaxyear + "~" + Tax_Type + "~" + Description + "~" + TaxGross_Tax + "~" + Credit + "~" + Net_Tax + "~" + Savings;
                                            gc.insert_date(orderNumber, ParcelNo, 363, TaxAssement_Details, 1, DateTime.Now);
                                            Description = ""; TaxGross_Tax = ""; Credit = ""; Net_Tax = ""; Savings = "";
                                        }
                                    }
                                    if (TaxAssement.Text.Contains("Total Tax") && !TaxAssement.Text.Contains("Sub Total"))
                                    {
                                        Description         = "Total Tax";
                                        TaxGross_Tax        = TaxAssementTD[0].Text;
                                        Credit              = TaxAssementTD[1].Text;
                                        Net_Tax             = TaxAssementTD[2].Text;
                                        Savings             = TaxAssementTD[3].Text;
                                        TaxAssement_Details = Billtaxyear + "~" + Tax_Type + "~" + Description + "~" + TaxGross_Tax + "~" + Credit + "~" + Net_Tax + "~" + Savings;
                                        gc.insert_date(orderNumber, ParcelNo, 363, TaxAssement_Details, 1, DateTime.Now);
                                    }
                                }
                                b++;
                            }
                        }
                        catch { }
                        gc.CreatePdf(orderNumber, ParcelNo, "Ad Valorem and Non Ad Valorem" + Billtaxyear, driver, "FL", "Palm Beach");
                        //Tax Installment Details

                        try
                        {
                            IWebElement         TaxInstallmentTB = driver.FindElement(By.XPath("//*[@id='dnn_ContentPane']/div[5]"));
                            IList <IWebElement> TaxInstallmentTR = TaxInstallmentTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> TaxInstallmentTD;

                            foreach (IWebElement TaxInstallment in TaxInstallmentTR)
                            {
                                TaxInstallmentTD = TaxInstallment.FindElements(By.TagName("td"));

                                if (TaxInstallmentTD.Count != 0 && !TaxInstallment.Text.Contains("Period"))
                                {
                                    if (TaxInstallmentTD[0].Text.Trim() == "Total Due:")
                                    {
                                        Period     = "";
                                        BillNumber = "";
                                        Due_Date   = "";
                                        BillYear   = TaxInstallmentTD[0].Text;
                                        Tax        = TaxInstallmentTD[1].Text;
                                        Discount1  = TaxInstallmentTD[2].Text;
                                        Penality   = TaxInstallmentTD[3].Text;
                                        Interest1  = TaxInstallmentTD[4].Text;
                                        Total_Due  = TaxInstallmentTD[5].Text;
                                    }
                                    else
                                    {
                                        Period     = TaxInstallmentTD[0].Text;
                                        BillNumber = TaxInstallmentTD[1].Text;
                                        Due_Date   = TaxInstallmentTD[2].Text;
                                        BillYear   = TaxInstallmentTD[3].Text;
                                        Tax        = TaxInstallmentTD[4].Text;
                                        Discount1  = TaxInstallmentTD[5].Text;
                                        Penality   = TaxInstallmentTD[6].Text;
                                        Interest1  = TaxInstallmentTD[7].Text;
                                        Total_Due  = TaxInstallmentTD[8].Text;
                                    }

                                    TaxInstallmentDetails = Period + "~" + BillNumber + "~" + Due_Date + "~" + BillYear + "~" + Tax + "~" + Discount1 + "~" + Penality + "~" + Interest1 + "~" + Total_Due;
                                    gc.insert_date(orderNumber, ParcelNo, 361, TaxInstallmentDetails, 1, DateTime.Now);
                                }
                            }
                        }
                        catch
                        { }
                        //Tax Payment details
                        try
                        {
                            IWebElement         PaymentTB = driver.FindElement(By.XPath("//*[@id='dnn_ContentPane']/div[7]"));
                            IList <IWebElement> PaymentTR = PaymentTB.FindElements(By.TagName("tr"));
                            IList <IWebElement> PaymentTD;

                            foreach (IWebElement Payment in PaymentTR)
                            {
                                PaymentTD = Payment.FindElements(By.TagName("td"));

                                if (PaymentTD.Count != 0 && !Payment.Text.Contains("Bill Year"))
                                {
                                    Payment_BillYear   = PaymentTD[0].Text;
                                    Payment_BillNumber = PaymentTD[1].Text;
                                    Receipt_Number     = PaymentTD[2].Text;
                                    Amount_Paid        = PaymentTD[3].Text;
                                    Last_Paid          = PaymentTD[4].Text;
                                    Paid_By            = PaymentTD[5].Text;

                                    Payment_Details = Payment_BillYear + "~" + Payment_BillNumber + "~" + Receipt_Number + "~" + Amount_Paid + "~" + Last_Paid + "~" + Paid_By;
                                    gc.insert_date(orderNumber, ParcelNo, 362, Payment_Details, 1, DateTime.Now);
                                }
                            }
                        }
                        catch
                        { }
                        //Tax Bill Dowload
                        try
                        {
                            IWebElement         taxinfotable = driver.FindElement(By.XPath("//*[@id='lxT538']/p"));
                            IList <IWebElement> viwetaxbill  = taxinfotable.FindElements(By.TagName("a"));
                            foreach (IWebElement taxyearelement in viwetaxbill)
                            {
                                if (taxyearelement.Text.Contains("Print Tax Bill"))
                                {
                                    string viewhref = taxyearelement.GetAttribute("href");
                                    gc.downloadfile(viewhref, orderNumber, ParcelNo, "ViewTaxBill.pdf" + s, "FL", "Palm Beach");
                                }
                            }
                            s++;
                        }
                        catch { }
                    }
                    TaxTime     = DateTime.Now.ToString("HH:mm:ss");
                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "FL", "Palm Beach", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    //megrge pdf files
                    gc.mergpdf(orderNumber, "FL", "Palm Beach");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
Beispiel #5
0
		void addOption(SelectElement sel, string key, string value)
		{
			OptionElement op = (OptionElement)Document.CreateElement("OPTION");
			op.Text = value;
			op.Value = key;
			try
			{
				sel.Add(op, null);
			}
			catch
			{
				sel.Add(op);
			}
		}
Beispiel #6
0
		int getValueInt(SelectElement sel)
		{
			return sel.SelectedIndex == -1 ? 0 : int.ParseInvariant(((OptionElement)sel.Options[sel.SelectedIndex]).Value);
		}
        public void SelectDropDownByText(String locator, String targetText)
        {
            this.WaitForElementPresent(locator, 20);
            Assert.IsTrue(isElementPresent(locator));
            IWebElement dropDownListBox = driver.FindElement(ByLocator(locator));
            SelectElement clickThis = new SelectElement(dropDownListBox);
            clickThis.SelectByText(targetText);

        }
Beispiel #8
0
        // Set up the ActiveSync domain
        // Depending on which version of Exchange is desired, different fields will be filled in
        /*
        public void SetUpGenericExchangeDomain(ISelenium selenium, string exchangeVersion, string connectorUsername, string connectorHostName, string remoteUrl, string remoteUsername, string password, int sleepTime)
        // Set up the ActiveSync domain
        // Depending on which version of Exchange is desired, different fields will be filled in
        {

            // Click Domains ----------------------------
            selenium.Click("link=Domains");
            selenium.WaitForPageToLoad("30000");

            // Click ActiveSync Domain ----------------------------
            selenium.Click("link=Microsoft ActiveSync");
            selenium.WaitForPageToLoad("30000");

            // if the domain is already set to the specified Exchange version
            if (selenium.GetSelectedLabel("id=ctl00_MainContent_ddlExchangeVersion") == exchangeVersion)

            // do nothing
            // MDM is already set to the desired Exchange version
            { }
            else
            {

                // set the domain to be the specified Exchange version
                selenium.Select("id=ctl00_MainContent_ddlExchangeVersion", "label=" + exchangeVersion);
                Thread.Sleep(sleepTime);

                if ((exchangeVersion == "2007") || (exchangeVersion == "Mixed"))
                {
                    // configure Exchange 2007 Remote PowerShell Configuration
                    selenium.Type("id=ctl00_MainContent_txtConnectorUsername", connectorUsername);
                    selenium.Type("id=ctl00_MainContent_txtConnectorPassword", password);
                    selenium.Type("id=ctl00_MainContent_txtConnectorHostName", connectorHostName);
                }

                if ((exchangeVersion == "2010") || (exchangeVersion == "Mixed"))
                {
                    // configure Exchange 2010 Remote PowerShell Configuration
                    selenium.Type("id=ctl00_MainContent_txtRemoteUrl", remoteUrl);
                    selenium.Type("id=ctl00_MainContent_txtRemoteUsername", remoteUsername);
                    selenium.Type("id=ctl00_MainContent_txtRemotePassword", password);
                }
            }

            // save the domain
            selenium.Click("id=ctl00_MainContent_lnkSave");
            selenium.WaitForPageToLoad("30000");
        }
        */
        public void SetUpGenericExchangeDomain(IWebDriver driver, string exchangeVersion, string connectorUsername, string connectorHostName, string remoteUrl, string remoteUsername, string password, int sleepTime)
        {
            // Click Domains ----------------------------
            driver.FindElement(By.XPath("//a[img[@alt=\"Configuration/Administration\"]]"));
            driver.FindElement(By.XPath("//a[img[@alt=\"Configuration/Administration\"]]")).Click();
            driver.FindElement(By.LinkText("Domains")).Click();

            // Click ActiveSync Domain ----------------------------
            WaitForElement(driver, By.XPath("//a[.='Microsoft ActiveSync']"));
            driver.FindElement(By.LinkText("Microsoft ActiveSync")).Click();
            WaitForElement(driver, By.Id("ctl00_MainContent_ddlExchangeVersion"));

            // if the domain is already set to the specified Exchange version
            if (driver.FindElement(By.XPath("//select[@id='ctl00_MainContent_ddlExchangeVersion']/option[@selected='selected']")).Text == exchangeVersion)

            // do nothing
            // MDM is already set to the desired Exchange version
            { }
            else
            {

                // set the domain to be the specified Exchange version
                SelectElement select = new SelectElement(driver.FindElement(By.Id("ctl00_MainContent_ddlExchangeVersion")));
                select.SelectByText(exchangeVersion);
                Thread.Sleep(sleepTime);

                if ((exchangeVersion == "2007") || (exchangeVersion == "Mixed"))
                {
                    // configure Exchange 2007 Remote PowerShell Configuration
                    driver.FindElement(By.Id("ctl00_MainContent_txtConnectorUsername")).Clear();
                    driver.FindElement(By.Id("ctl00_MainContent_txtConnectorUsername")).SendKeys(connectorUsername);
                    driver.FindElement(By.Id("ctl00_MainContent_txtConnectorPassword")).Clear();
                    driver.FindElement(By.Id("ctl00_MainContent_txtConnectorPassword")).SendKeys(password);
                    driver.FindElement(By.Id("ctl00_MainContent_txtConnectorHostName")).Clear();
                    driver.FindElement(By.Id("ctl00_MainContent_txtConnectorHostName")).SendKeys(connectorHostName);
                }

                if ((exchangeVersion == "2010") || (exchangeVersion == "Mixed"))
                {
                    // configure Exchange 2010 Remote PowerShell Configuration
                    driver.FindElement(By.Id("ctl00_MainContent_txtRemoteUrl")).Clear();
                    driver.FindElement(By.Id("ctl00_MainContent_txtRemoteUrl")).SendKeys(remoteUrl);
                    driver.FindElement(By.Id("ctl00_MainContent_txtRemoteUsername")).Clear();
                    driver.FindElement(By.Id("ctl00_MainContent_txtRemoteUsername")).SendKeys(remoteUsername);
                    driver.FindElement(By.Id("ctl00_MainContent_txtRemotePassword")).Clear();
                    driver.FindElement(By.Id("ctl00_MainContent_txtRemotePassword")).SendKeys(password);
                }
            }

            // save the domain
            driver.FindElement(By.Id("ctl00_MainContent_lnkSave")).Click();
            //Thread.Sleep(sleepTime);
            //try
            //{
            //    driver.SwitchTo().Alert().Accept();
            //}
            //catch (Exception e)
            //{
            //    // no alert
            //}
        }
Beispiel #9
0
		void addOption(string value, string text, SelectElement parent)
		{
			OptionElement oe = (OptionElement)Document.CreateElement("OPTION");
			oe.Value = value;
			oe.Text = text;
			try
			{
				parent.Add(oe, null);
			}
			catch
			{
				parent.Add(oe);
			}

		}
Beispiel #10
0
		int getK(SelectElement sel)
		{
			try
			{
				string value = ((OptionElement)sel.Options[sel.SelectedIndex]).Value;
				value = value.Substr(5, value.Length - 5);
				return int.ParseInvariant(value);
			}
			catch
			{
				return 0;
			}
		}
Beispiel #11
0
        /// <summary>
        /// BMW,Benz,Honda
        /// </summary>
        /// <param name="option"></param>
        public void selectDropDown(string option)
        {
            SelectElement el = new SelectElement(ddwn);

            el.SelectByValue(option.ToLower());
        }
Beispiel #12
0
        public IWebDriver WebdriverWait_TillElementReady(IWebDriver driver, IWebElement Element)
        {
            Thread.Sleep(2000);
            int MinWatiTime = 500; int Loopcount = 10;

            switch (Element.TagName)
            {
            case "select":

lb:
                try
                {
                    SelectElement Select = new SelectElement(Element);
                    String        str    = Select.SelectedOption.Text;
                    for (int i = 0; i < Loopcount; i++)
                    {
                        if (Select.SelectedOption.Text == null)
                        {
                            Thread.Sleep(MinWatiTime);
                        }
                    }
                    return(driver);
                }

                catch
                {
                    Thread.Sleep(MinWatiTime);
                    goto lb;
                }


            case "input":
                try {
                    for (int i = 0; i < Loopcount; i++)
                    {
                        if (!Element.Displayed || !Element.Enabled)
                        {
                            Thread.Sleep(MinWatiTime);
                        }
                    }
                    return(driver);
                }
                catch
                {
                    return(driver);
                }

            case "div":
                try
                {
                    for (int i = 0; i < Loopcount; i++)
                    {
                        if (!Element.Displayed || !Element.Enabled)
                        {
                            Thread.Sleep(MinWatiTime);
                        }
                    }
                    return(driver);
                }
                catch
                {
                    return(driver);
                }

            case "button":
                try
                {
                    for (int i = 0; i < Loopcount; i++)
                    {
                        if (!Element.Enabled)
                        {
                            Thread.Sleep(MinWatiTime);
                        }
                    }
                    return(driver);
                }
                catch
                {
                    return(driver);
                }

            case "mat-table":
                try
                {
                    for (int i = 0; i < Loopcount; i++)
                    {
                        if (!Element.Displayed)
                        {
                            Thread.Sleep(MinWatiTime);
                        }
                    }
                    return(driver);
                }
                catch
                {
                    return(driver);
                }

            default:
                return(driver);
            }
        }
Beispiel #13
0
        static void Main(string[] args)
        {
            IWebDriver driver = new ChromeDriver();

            driver.Manage().Window.Maximize();

            driver.Navigate().GoToUrl("https://hamilton.shnsf.com");

            // Item name
            IWebElement itemNameElement = driver.FindElement(By.XPath("//div//*[@class=\"results-box standard-search-results\"]//*[@class=\"item-description result-box-item-details\"]//*[@class=\"item-name\"]"));

            // Date
            IWebElement dateElement = driver.FindElement(By.XPath("//div//*[@class=\"results-box standard-search-results\"]//*[@class=\"item-description result-box-item-details\"]//*[@class=\"item-start-date\"]//*[@class=\"start-date\"]"));

            // for the Buy button element
            IWebElement buyElement = driver.FindElement(By.XPath("//div//*[@class=\"results-box standard-search-results\"]//*[contains(@class, \"item-link result-box-item-details last-column limited\")]//*[@class=\"btn btn-primary\"]"));

            buyElement.Click();

            #region PRICE TABLE

            IWebElement         priceListElement = driver.FindElement(By.XPath("//div//*[@id=\"pricing_list\"]//*[@class=\"legend-ul\"]"));
            IList <IWebElement> liElements       = priceListElement.FindElements(By.XPath("//*[@class=\"legend-li\"]//*[@class=\"price-zone-option\"]"));

            foreach (var li in liElements)
            {
                Debug.WriteLine($"Seat Name: {li.FindElement(By.ClassName("zone-label")).Text}; " +
                                $"Color: {li.FindElement(By.ClassName("price-zone-color")).GetAttribute("style")}" +
                                $"Price: {li.FindElement(By.ClassName("price-zone-price")).Text}");

                //System.Diagnostics.Debug.WriteLine(li.Text);

                //System.Diagnostics.Debug.WriteLine(li.FindElements(By.ClassName("price-zone-color"))[0].GetAttribute("style"));

                //System.Diagnostics.Debug.WriteLine(li.FindElement(By.XPath("//*[@class=\"price-zone-info\"]//*[@class=\"zone-label\"]")).Text);
                //System.Diagnostics.Debug.WriteLine(li.FindElement(By.XPath("//*[@class=\"price-zone-info\"]//*[@class=\"item-box-detail-data price-zone-price\"]")).GetAttribute("style"));
                //System.Diagnostics.Debug.WriteLine(li.FindElement(By.XPath("//*[@class=\"price-zone-info\"]//*[@class=\"item-box-detail-data price-zone-price\"]")).Text);
            }


            #endregion

            #region SECTION

            // TEXT
            IWebElement sectionTextElement = driver.FindElement(By.XPath("//div//*[@id=\"mapControlsAndLegend\"]//*[@id=\"screen_flip_section\"]//*[@class=\"item-box-item\"]//label//select//option"));

            // VALUE
            IWebElement sectionValueElement = driver.FindElement(By.XPath("//div//*[@id=\"mapControlsAndLegend\"]//*[@id=\"screen_flip_section\"]//*[@class=\"item-box-item\"]//label//select//option"));

            // LINK
            IWebElement sectionLinkElement = driver.FindElement(By.XPath("//div//*[@id=\"mapControlsAndLegend\"]//*[@id=\"screen_flip_section\"]//*[@class=\"item-box-item\"]//label//select"));

            // DROPDOWN BOX
            SelectElement select = new SelectElement(sectionLinkElement);

            #endregion

            #region SEATS

            // ID
            IList <IWebElement> seatIdElement = driver.FindElements(By.XPath("//div//*[@id=\"seatGroup\"]//*[contains(@style, \"fill\")]")).ToList();

            foreach (var seatGroup in seatIdElement)
            {
                System.Diagnostics.Debug.WriteLine(seatGroup.GetAttribute("style"));
                System.Diagnostics.Debug.WriteLine(seatGroup.GetAttribute("id"));

                var seats = seatGroup.FindElements(By.TagName("circle"));
                foreach (var seat in seats)
                {
                    Debug.WriteLine($"Seat: {seat.GetAttribute("data-tsdesc")}; Status: {seat.GetAttribute("data-status")}; Stroke: {seat.GetAttribute("stroke")}");
                }
            }

            #endregion


            driver.Close();
        }
Beispiel #14
0
        // select product Quantity
        internal void SelectQuantity_DeltaOrder(IWebDriver driver)
        {
            SelectElement quantity = new SelectElement(driver.FindElement(arrgdetailpageObject.ArrgQuantity));

            quantity.SelectByValue("4");
        }
Beispiel #15
0
		bool setValue(SelectElement sel, string value)
		{
			for (int i = 0; i < sel.Options.Length; i++)
			{
				OptionElement op = (OptionElement)sel.Options[i];
				if (op.Value.ToLowerCase() == value.ToLowerCase())
				{
					op.Selected = true;
					return true;
				}
			}
			return false;
		}
Beispiel #16
0
		void unSelect(SelectElement sel)
		{
			for (int i = 0; i < sel.Options.Length; i++)
			{
				OptionElement op = (OptionElement)sel.Options[i];
				op.Selected = false;
			}
		}
Beispiel #17
0
		string getText(SelectElement sel)
		{
			return ((OptionElement)sel.Options[sel.SelectedIndex]).Text;
		}
        public string FTP_DouglasNV(string houseno, string Direction, string sname, string stype, string account, string parcelNumber, string ownername, string searchType, string orderNumber, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;

            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";
            string lastName = "", firstName = "", Pinnumber = "", PropertyAdd = "", Strownername = "", Pin = "", address = "";

            var driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            using (driver = new PhantomJSDriver())
            {
                //  using (driver = new ChromeDriver())

                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");

                    driver.Navigate().GoToUrl("http://assessor-search.douglasnv.us:1401/cgi-bin/asw100");
                    Thread.Sleep(4000);

                    if (searchType == "titleflex")
                    {
                        if (Direction != "")
                        {
                            address = houseno + " " + Direction + " " + sname + " " + stype + " " + account;
                            address = address.Trim();
                        }
                        if (Direction == "")
                        {
                            address = houseno + " " + sname + " " + stype + " " + account;
                            address = address.Trim();
                        }
                        string titleaddress = address;
                        gc.TitleFlexSearch(orderNumber, "", "", titleaddress, "NV", "Douglas");
                        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["Zero_DouglasNV"] = "Zero";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        if (Direction != "" && stype != "")
                        {
                            address = houseno + " " + Direction + " " + sname + " " + stype + " " + account;
                        }
                        if (Direction != "" && stype == "")
                        {
                            address = houseno + " " + Direction + " " + sname + " " + account;
                        }
                        if (Direction == "" && stype != "")
                        {
                            address = houseno + " " + sname + " " + stype + " " + account;
                        }
                        if (Direction == "" && stype == "")
                        {
                            address = houseno + " " + sname + " " + account;
                        }

                        driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr/td/table/tbody/tr[7]/td[4]/div/input")).SendKeys(address.Trim());
                        gc.CreatePdf_WOP(orderNumber, "Address search", driver, "NV", "Douglas");
                        driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr/td/table/tbody/tr[10]/td[5]/div/input")).SendKeys(Keys.Enter);
                        Thread.Sleep(4000);
                        gc.CreatePdf_WOP(orderNumber, "Address Search result", driver, "NV", "Douglas");

                        try
                        {
                            int    Max = 0;
                            string strowner = "", strAddress = "", strCity = "";
                            string Record = "";


                            IWebElement multiaddress = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr[3]/td/table/tbody"));

                            IList <IWebElement> multiRow = multiaddress.FindElements(By.TagName("tr"));
                            IList <IWebElement> multiTD;
                            foreach (IWebElement multi in multiRow)
                            {
                                multiTD = multi.FindElements(By.TagName("td"));
                                if (multi.Text.Contains(address.ToUpper()) && multiTD.Count != 0 && multi.Text.Trim() != "" && !multi.Text.Contains("Search Results") && !multi.Text.Contains("Property Location"))
                                {
                                    Strownername = multiTD[1].Text;

                                    parcelNumber = multiTD[0].Text.Trim();
                                    PropertyAdd  = multiTD[2].Text + " " + multiTD[3].Text;

                                    string multidetails = Strownername + "~" + PropertyAdd;
                                    gc.insert_date(orderNumber, parcelNumber, 1757, multidetails, 1, DateTime.Now);
                                    Max++;
                                }
                                if (multiTD.Count != 0 && multiRow.Count > 25 && Max >= 25)
                                {
                                    HttpContext.Current.Session["multiparcel_DouglasNV_Maximum"] = "Maximum";
                                    driver.Quit();
                                    return("Maximum");
                                }
                            }
                            if (Max > 1 && Max < 25)
                            {
                                HttpContext.Current.Session["multiparcel_DouglasNV"] = "Yes";
                                driver.Quit();
                                return("MultiParcel");
                            }
                            if (Max == 1)
                            {
                                IWebElement multiaddress1 = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr[3]/td/table/tbody"));

                                IList <IWebElement> multiRow1 = multiaddress1.FindElements(By.TagName("tr"));
                                IList <IWebElement> multiTD1;
                                foreach (IWebElement multi in multiRow1)
                                {
                                    multiTD1 = multi.FindElements(By.TagName("td"));
                                    if (multi.Text.Contains(address.ToUpper()) && multiTD1.Count != 0 && multi.Text.Trim() != "" && !multi.Text.Contains("Search Results") && !multi.Text.Contains("Property Location"))
                                    {
                                        Strownername = multiTD1[1].Text;
                                        parcelNumber = multiTD1[0].Text.Trim();
                                        PropertyAdd  = multiTD1[2].Text + " " + multiTD1[3].Text;

                                        string nparcel = parcelNumber.Replace("-", "");
                                        string url     = "http://assessor-search.douglasnv.us:1401/cgi-bin/asw101?Parcel=" + nparcel + "&aori=a";
                                        driver.Navigate().GoToUrl(url);
                                        Thread.Sleep(4000);
                                        break;
                                    }
                                }
                            }
                            if (Max == 0)
                            {
                                HttpContext.Current.Session["Zero_DouglasNV"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }


                    else if (searchType == "parcel")
                    {
                        parcelNumber = parcelNumber.Replace("-", "");
                        driver.FindElement(By.XPath("//*[@id='asw100parcels']/input[1]")).SendKeys(parcelNumber);
                        Thread.Sleep(3000);
                        gc.CreatePdf(orderNumber, parcelNumber, "Parcel search", driver, "NV", "Douglas");
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr/td/table/tbody/tr[10]/td[5]/div/input")).SendKeys(Keys.Enter);
                            Thread.Sleep(3000);
                            gc.CreatePdf(orderNumber, parcelNumber, "Parcel search Result", driver, "NV", "Douglas");
                        }
                        catch { }
                        try
                        {
                            driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr[3]/td/table/tbody/tr[3]/td[1]/div/a")).Click();
                            Thread.Sleep(4000);
                        }
                        catch { }
                        try
                        {
                            int    Max = 0;
                            string strowner = "", strAddress = "", strCity = "";
                            string Record = "";


                            IWebElement multiaddress = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr[3]/td/table/tbody"));

                            IList <IWebElement> multiRow = multiaddress.FindElements(By.TagName("tr"));
                            IList <IWebElement> multiTD;
                            foreach (IWebElement multi in multiRow)
                            {
                                multiTD = multi.FindElements(By.TagName("td"));
                                if (multi.Text.Contains(address.ToUpper()) && multiTD.Count != 0 && multi.Text.Trim() != "" && !multi.Text.Contains("Search Results") && !multi.Text.Contains("Property Location") && multi.Text.Contains("No results found"))
                                {
                                    HttpContext.Current.Session["Zero_DouglasNV"] = "Zero";
                                    driver.Quit();
                                    return("No Data Found");
                                }
                            }
                        }
                        catch { }
                    }

                    if (searchType == "ownername")
                    {
                        driver.FindElement(By.XPath("//*[@id='asw100name']/input")).SendKeys(ownername);
                        Thread.Sleep(3000);

                        gc.CreatePdf_WOP(orderNumber, "OwnerName search", driver, "NV", "Douglas");
                        driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr/td/table/tbody/tr[10]/td[5]/div/input")).Click();
                        Thread.Sleep(4000);

                        try
                        {
                            int    Max = 0;
                            string strowner = "", strAddress = "", strCity = "";
                            string Record = "";


                            IWebElement multiaddress = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr[3]/td/table/tbody"));

                            IList <IWebElement> multiRow = multiaddress.FindElements(By.TagName("tr"));
                            IList <IWebElement> multiTD;
                            foreach (IWebElement multi in multiRow)
                            {
                                multiTD = multi.FindElements(By.TagName("td"));
                                if (multi.Text.Contains(address.ToUpper()) && multiTD.Count != 0 && multi.Text.Trim() != "" && !multi.Text.Contains("Search Results") && !multi.Text.Contains("Property Location"))
                                {
                                    Strownername = multiTD[1].Text;

                                    parcelNumber = multiTD[0].Text.Trim();
                                    PropertyAdd  = multiTD[2].Text + " " + multiTD[3].Text;

                                    string multidetails = Strownername + "~" + PropertyAdd;
                                    gc.insert_date(orderNumber, parcelNumber, 1757, multidetails, 1, DateTime.Now);
                                    Max++;
                                }
                                if (multiTD.Count != 0 && multiRow.Count > 25 && Max >= 25)
                                {
                                    HttpContext.Current.Session["multiparcel_DouglasNV_Maximum"] = "Maximum";
                                    driver.Quit();
                                    return("Maximum");
                                }
                            }
                            if (Max > 1 && Max < 25)
                            {
                                HttpContext.Current.Session["multiparcel_DouglasNV"] = "Yes";
                                driver.Quit();
                                return("MultiParcel");
                            }
                            if (Max == 1)
                            {
                                IWebElement multiaddress1 = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table/tbody/tr[3]/td/table/tbody"));

                                IList <IWebElement> multiRow1 = multiaddress1.FindElements(By.TagName("tr"));
                                IList <IWebElement> multiTD1;
                                foreach (IWebElement multi in multiRow1)
                                {
                                    multiTD1 = multi.FindElements(By.TagName("td"));
                                    if (multi.Text.Contains(address.ToUpper()) && multiTD1.Count != 0 && multi.Text.Trim() != "" && !multi.Text.Contains("Search Results") && !multi.Text.Contains("Property Location"))
                                    {
                                        Strownername = multiTD1[1].Text;
                                        parcelNumber = multiTD1[0].Text.Trim();
                                        PropertyAdd  = multiTD1[2].Text + " " + multiTD1[3].Text;

                                        string nparcel = parcelNumber.Replace("-", "");
                                        string url     = "http://assessor-search.douglasnv.us:1401/cgi-bin/asw101?Parcel=" + nparcel + "&aori=a";
                                        driver.Navigate().GoToUrl(url);
                                        Thread.Sleep(4000);
                                        break;
                                    }
                                }
                            }
                            if (Max == 0)
                            {
                                HttpContext.Current.Session["Zero_DouglasNV"] = "Zero";
                                driver.Quit();
                                return("No Data Found");
                            }
                        }
                        catch { }
                    }


                    //property details

                    string MailingAddress = "", Town = "", District = "", AssessedOwnerName = "";
                    string LegalOwnerName = "", PropertyAddress = "", Acres = "", YearBuilt = "";


                    parcelNumber = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[1]/td/div")).Text.Replace("Parcel Detail for Parcel #", "").Trim();

                    PropertyAddress = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[3]/td[1]/table/tbody/tr[2]/td[2]/div")).Text;
                    Town            = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[3]/td[1]/table/tbody/tr[3]/td[2]/div")).Text;
                    District        = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[3]/td[1]/table/tbody/tr[4]/td[2]/div")).Text;

                    AssessedOwnerName = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[3]/td[2]/table/tbody/tr[2]/td[2]/div")).Text;
                    LegalOwnerName    = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[3]/td[2]/table/tbody/tr[4]/td[2]/div")).Text;
                    MailingAddress    = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[3]/td[2]/table/tbody/tr[3]/td[2]/div")).Text;
                    try
                    {
                        YearBuilt = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[4]/td[2]/table/tbody/tr[9]/td[2]/div")).Text;
                    }
                    catch { }
                    //try
                    //{
                    //    if (YearBuilt == "")
                    //    {
                    //        YearBuilt = driver.FindElement(By.XPath("/html/body/table[15]/tbody/tr[2]/td[1]/p")).Text;
                    //    }
                    //}
                    //catch { }
                    string propertydetails = PropertyAddress + "~" + Town + "~" + District + "~" + AssessedOwnerName + "~" + MailingAddress + "~" + LegalOwnerName + "~" + YearBuilt;
                    gc.insert_date(orderNumber, parcelNumber, 1765, propertydetails, 1, DateTime.Now);

                    gc.CreatePdf(orderNumber, parcelNumber, "Property Details", driver, "NV", "Douglas");

                    // Assessment Details - (Assessed Valuation)

                    try
                    {
                        string              Assyear = "", Assyear1 = "", Assyear2 = "", Assesstype = "";
                        IWebElement         Assessmentdetails   = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[5]/td[1]/table/tbody"));
                        IList <IWebElement> TRAssessmentdetails = Assessmentdetails.FindElements(By.TagName("tr"));
                        IList <IWebElement> THAssessmentdetails = Assessmentdetails.FindElements(By.TagName("th"));
                        IList <IWebElement> TDAssessmentdetails;
                        foreach (IWebElement row in TRAssessmentdetails)
                        {
                            TDAssessmentdetails = row.FindElements(By.TagName("td"));
                            if (!row.Text.Contains("Assessed Valuation") && row.Text.Trim() != "")
                            {
                                if (TDAssessmentdetails.Count != 0 && !row.Text.Contains("Increased (New) Values"))
                                {
                                    Assesstype += TDAssessmentdetails[0].Text.Replace("Values", "Year") + "~";
                                    Assyear    += TDAssessmentdetails[1].Text + "~";
                                    Assyear1   += TDAssessmentdetails[2].Text + "~";
                                    Assyear2   += TDAssessmentdetails[3].Text + "~";
                                }
                                if (TDAssessmentdetails.Count != 0 && row.Text.Contains("Increased (New) Values"))
                                {
                                    break;
                                }
                            }
                        }

                        DBconnection dbconn = new DBconnection();
                        dbconn.ExecuteQuery("update data_field_master set Data_Fields_Text='" + Assesstype.Remove(Assesstype.Length - 1, 1) + "' where Id = '" + 1766 + "'");
                        gc.insert_date(orderNumber, parcelNumber, 1766, Assyear.Remove(Assyear.Length - 1, 1), 1, DateTime.Now);
                        gc.insert_date(orderNumber, parcelNumber, 1766, Assyear1.Remove(Assyear1.Length - 1, 1), 1, DateTime.Now);
                        gc.insert_date(orderNumber, parcelNumber, 1766, Assyear2.Remove(Assyear2.Length - 1, 1), 1, DateTime.Now);
                    }
                    catch { }

                    // Assessment details - (Taxable Valuation)

                    try
                    {
                        string              taxyear = "", taxyear1 = "", taxyear2 = "", valuetype = "";
                        IWebElement         Assessmentdetails   = driver.FindElement(By.XPath("//*[@id='body']/form[2]/table[2]/tbody/tr[5]/td[2]/table/tbody"));
                        IList <IWebElement> TRAssessmentdetails = Assessmentdetails.FindElements(By.TagName("tr"));
                        IList <IWebElement> THAssessmentdetails = Assessmentdetails.FindElements(By.TagName("th"));
                        IList <IWebElement> TDAssessmentdetails;
                        foreach (IWebElement row in TRAssessmentdetails)
                        {
                            TDAssessmentdetails = row.FindElements(By.TagName("td"));
                            if (!row.Text.Contains("Taxable Valuation") && row.Text.Trim() != "")
                            {
                                if (TDAssessmentdetails.Count != 0 && !row.Text.Contains("Increased (New) Values"))
                                {
                                    valuetype += TDAssessmentdetails[0].Text.Replace("Values", "Year") + "~";
                                    taxyear   += TDAssessmentdetails[1].Text + "~";
                                    taxyear1  += TDAssessmentdetails[2].Text + "~";
                                    taxyear2  += TDAssessmentdetails[3].Text + "~";
                                }
                                if (TDAssessmentdetails.Count != 0 && row.Text.Contains("Increased (New) Values"))
                                {
                                    break;
                                }
                            }
                        }

                        DBconnection dbconn = new DBconnection();
                        dbconn.ExecuteQuery("update data_field_master set Data_Fields_Text='" + valuetype.Remove(valuetype.Length - 1, 1) + "' where Id = '" + 1767 + "'");
                        gc.insert_date(orderNumber, parcelNumber, 1767, taxyear.Remove(taxyear.Length - 1, 1), 1, DateTime.Now);
                        gc.insert_date(orderNumber, parcelNumber, 1767, taxyear1.Remove(taxyear1.Length - 1, 1), 1, DateTime.Now);
                        gc.insert_date(orderNumber, parcelNumber, 1767, taxyear2.Remove(taxyear2.Length - 1, 1), 1, DateTime.Now);
                    }
                    catch { }


                    // Tax Information Details
                    string taxAuth = "", taxauth1 = "", taxauth2 = "", taxauth3 = "";
                    try
                    {
                        driver.Navigate().GoToUrl("https://cltr.douglasnv.us/");
                        Thread.Sleep(5000);
                        taxauth1 = driver.FindElement(By.XPath("//*[@id='text-16']/div/h4")).Text;
                        taxauth2 = driver.FindElement(By.XPath("//*[@id='text-16']/div/div/p[1]")).Text.Replace("MINDEN:", "").Trim();
                        taxauth3 = driver.FindElement(By.XPath("//*[@id='text-16']/div/div/p[3]")).Text.Replace("Treasurer:", "").Replace("(map)", "").Trim();
                        taxAuth  = taxauth1 + " " + taxauth2 + " " + taxauth3;
                        gc.CreatePdf(orderNumber, parcelNumber, "Taxing Authority", driver, "NV", "Douglas");
                    }
                    catch { }

                    driver.Navigate().GoToUrl("https://cltr.douglasnv.us/online-payments/property-taxes/");
                    Thread.Sleep(5000);
                    var Select1         = driver.FindElement(By.XPath("//*[@id='filterBy']"));
                    var selectElement11 = new SelectElement(Select1);
                    selectElement11.SelectByText("Parcel Number");

                    driver.FindElement(By.XPath("//*[@id='searchFor']")).SendKeys(parcelNumber);
                    gc.CreatePdf(orderNumber, parcelNumber, "Tax Search", driver, "NV", "Douglas");

                    driver.FindElement(By.Id("buttonSearch")).Click();
                    Thread.Sleep(4000);
                    gc.CreatePdf(orderNumber, parcelNumber, "Tax Search Result", driver, "NV", "Douglas");

                    driver.FindElement(By.XPath("//*[@id='content']/div/div[2]/div/table/tbody/tr/td[4]/input")).Click();
                    Thread.Sleep(4000);

                    gc.CreatePdf(orderNumber, parcelNumber, "Current Tax Details", driver, "NV", "Douglas");
                    string strownerName = "", PropAddress = "", Taxyear = "", AccountBalance = "";

                    strownerName   = driver.FindElement(By.XPath("//*[@id='content']/div/div[3]/div[2]/strong")).Text;
                    PropAddress    = driver.FindElement(By.XPath("//*[@id='content']/div/div[4]/div[2]/strong")).Text;
                    Taxyear        = driver.FindElement(By.XPath("//*[@id='content']/div/div[2]/div/h4")).Text.Replace("Tax Summary for", "").Trim();
                    AccountBalance = driver.FindElement(By.XPath("//*[@id='content']/div/div[3]/div[3]/strong")).Text;

                    try
                    {
                        string TaxInfodetails = strownerName + "~" + PropAddress + "~" + Taxyear + "~" + AccountBalance + "~" + taxAuth;
                        gc.insert_date(orderNumber, parcelNumber, 1770, TaxInfodetails, 1, DateTime.Now);
                    }
                    catch { }

                    // Current tax Year Details
                    try
                    {
                        IWebElement         CurrentTax   = driver.FindElement(By.XPath("//*[@id='content']/div"));
                        IList <IWebElement> TRCurrentTax = CurrentTax.FindElements(By.TagName("div"));
                        IList <IWebElement> THCurrentTax = CurrentTax.FindElements(By.TagName("div"));
                        IList <IWebElement> TDCurrentTax;
                        foreach (IWebElement row in TRCurrentTax)
                        {
                            TDCurrentTax = row.FindElements(By.TagName("div"));
                            if (TDCurrentTax.Count != 0 && !row.Text.Contains("Disposition") && row.Text.Trim() != "" && TDCurrentTax.Count == 6)
                            {
                                string CurrentTaxdetails = TDCurrentTax[0].Text + "~" + TDCurrentTax[1].Text + "~" + TDCurrentTax[2].Text + "~" + TDCurrentTax[3].Text + "~" + TDCurrentTax[4].Text;
                                gc.insert_date(orderNumber, parcelNumber, 1771, CurrentTaxdetails, 1, DateTime.Now);
                            }
                            if (row.Text.Contains("Penalty") && row.Text.Trim() != "" && TDCurrentTax.Count == 3)
                            {
                                string CurrentTaxdetails = "" + "~" + TDCurrentTax[0].Text + "~" + TDCurrentTax[1].Text + "~" + "" + "~" + "";
                                gc.insert_date(orderNumber, parcelNumber, 1771, CurrentTaxdetails, 1, DateTime.Now);
                            }
                        }
                    }
                    catch { }

                    try
                    {
                        driver.FindElement(By.Id("buttonHistory")).Click();
                        Thread.Sleep(6000);
                        gc.CreatePdf(orderNumber, parcelNumber, "Payment History", driver, "NV", "Douglas");
                    }
                    catch { }

                    // Tax Payment History Details
                    try
                    {
                        IWebElement         TaxPayment   = driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[2]/div/div/table/tbody"));
                        IList <IWebElement> TRTaxPayment = TaxPayment.FindElements(By.TagName("tr"));
                        IList <IWebElement> THTaxPayment = TaxPayment.FindElements(By.TagName("th"));
                        IList <IWebElement> TDTaxPayment;
                        foreach (IWebElement row in TRTaxPayment)
                        {
                            TDTaxPayment = row.FindElements(By.TagName("td"));
                            if (TDTaxPayment.Count != 0 && !row.Text.Contains("PENALTY") && row.Text.Trim() != "")
                            {
                                string TaxPaymentdetails = TDTaxPayment[0].Text + "~" + TDTaxPayment[1].Text + "~" + TDTaxPayment[2].Text + "~" + TDTaxPayment[3].Text;
                                gc.insert_date(orderNumber, parcelNumber, 1772, TaxPaymentdetails, 1, DateTime.Now);
                            }
                        }
                    }
                    catch { }


                    try
                    {
                        driver.FindElement(By.XPath("/html/body/div[2]/div/div/div[3]/button")).Click();
                        Thread.Sleep(4000);
                    }
                    catch { }

                    // AMG Details
                    try
                    {
                        driver.Navigate().GoToUrl("https://amgnv.com/parcelsearch_non_pop1.asp");
                        Thread.Sleep(5000);
                        string strparcel = parcelNumber.Replace("-", "");
                        driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/p/table[2]/tbody/tr/td/table/tbody/tr[2]/td[1]/form/center/b/input")).SendKeys(strparcel);
                        gc.CreatePdf(orderNumber, parcelNumber, "AMG Details Search", driver, "NV", "Douglas");
                        driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/p/table[2]/tbody/tr/td/table/tbody/tr[2]/td[1]/form/center/b/font/font/input")).Click();
                        Thread.Sleep(3000);
                        gc.CreatePdf(orderNumber, parcelNumber, "AMG Details Search Result", driver, "NV", "Douglas");
                    }
                    catch { }
                    string AmgBigdata = "";
                    try
                    {
                        AmgBigdata = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/p/table[2]/tbody/tr/td/b/font")).Text;
                    }
                    catch { }
                    if (!AmgBigdata.Contains("No Records were found in the database"))
                    {
                        try
                        {
                            driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/p/font[1]/table/tbody/tr[2]/td[4]/div/font/a")).Click();
                            Thread.Sleep(4000);
                            gc.CreatePdf(orderNumber, parcelNumber, "AMG Details Info", driver, "NV", "Douglas");
                        }
                        catch { }

                        string District_AMG_ID = "", OwnerName = "", status = "", Unbilled_Principal = "", ProAdd = "", LegalDesc = "", OriginalAssess = "";
                        string PayOff = "", MailingDate = "", DueDate = "", FinalPayment = "", Checks_payable = "";

                        District_AMG_ID    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[3]/tbody/tr[3]/td[2]/center/font")).Text;
                        OwnerName          = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[3]/tbody/tr[3]/td[3]/font")).Text;
                        status             = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[3]/tbody/tr[3]/td[4]")).Text;
                        Unbilled_Principal = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[3]/tbody/tr[3]/td[5]/div/font")).Text;
                        ProAdd             = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[4]/tbody/tr[2]/td[1]/font")).Text;
                        LegalDesc          = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[4]/tbody/tr[3]/td/font")).Text.Trim();
                        OriginalAssess     = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[4]/tbody/tr[2]/td[2]/center/font")).Text;
                        PayOff             = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[4]/tbody/tr[2]/td[3]/center/font/a")).Text;
                        MailingDate        = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[8]/tbody/tr[1]/td[1]/font")).Text.Replace("Mailing Date:", "").Trim();
                        DueDate            = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[8]/tbody/tr[2]/td[1]/font")).Text.Replace("Due Dates:", "").Trim();
                        FinalPayment       = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[8]/tbody/tr[3]/td/font")).Text.Replace(":", "").Trim();

                        Checks_payable = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[8]/tbody/tr[2]/td[2]/table/tbody/tr/td[2]/font")).Text.Trim();

                        string AMGdetails = District_AMG_ID + "~" + OwnerName + "~" + status + "~" + Unbilled_Principal + "~" + ProAdd + "~" + LegalDesc + "~" + OriginalAssess + "~" + PayOff + "~" + MailingDate + "~" + DueDate + "~" + FinalPayment + "~" + Checks_payable;
                        gc.insert_date(orderNumber, parcelNumber, 1773, AMGdetails, 1, DateTime.Now);

                        // AMG Due Details


                        try
                        {
                            IWebElement         AMGDueDetails   = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[6]/tbody"));
                            IList <IWebElement> TRAMGDueDetails = AMGDueDetails.FindElements(By.TagName("tr"));
                            IList <IWebElement> THAMGDueDetails = AMGDueDetails.FindElements(By.TagName("th"));
                            IList <IWebElement> TDAMGDueDetails;
                            foreach (IWebElement row in TRAMGDueDetails)
                            {
                                TDAMGDueDetails = row.FindElements(By.TagName("td"));
                                if (TDAMGDueDetails.Count != 0 && !row.Text.Contains("Total Due") && row.Text.Trim() != "" && TDAMGDueDetails.Count == 6)
                                {
                                    string AMGDuedetails = TDAMGDueDetails[0].Text + "~" + TDAMGDueDetails[1].Text + "~" + TDAMGDueDetails[2].Text + "~" + TDAMGDueDetails[3].Text + "~" + TDAMGDueDetails[4].Text + "~" + TDAMGDueDetails[5].Text;
                                    gc.insert_date(orderNumber, parcelNumber, 1774, AMGDuedetails, 1, DateTime.Now);
                                }
                            }
                        }
                        catch { }
                    }


                    TaxTime = DateTime.Now.ToString("HH:mm:ss");

                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                    gc.insert_TakenTime(orderNumber, "NV", "Douglas", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);

                    driver.Quit();
                    gc.mergpdf(orderNumber, "NV", "Douglas");
                    return("Data Inserted Successfully");
                }

                catch (Exception ex)
                {
                    driver.Quit();
                    throw ex;
                }
            }
        }
Beispiel #19
0
        private void button1_Click(object sender, EventArgs e)
        {
            var smsPvaService = new SMSPVA();

            var userInfo = smsPvaService.GetUserInfo();

            var countriesOrderByPriceDesc = smsPvaService.GetChepeastCountrySMSReceive();

            var lowestPriceCountries = countriesOrderByPriceDesc.Where(x => x.price <= Convert.ToDecimal(0.20)).ToList();


            while (userInfo.balance >= lowestPriceCountries.Last().price)
            {
                var r = new Random();
                var y = r.Next(0, lowestPriceCountries.Count);
                var lowestPriceRandomCountry = lowestPriceCountries.ElementAt(y);

                var lowestPriceCountry = lowestPriceRandomCountry;

                ChromeDriver driver  = null;
                Process      process = null;

                try
                {
                    var _profileGenerator = new ProfilerGenerator();
                    var pessoa            = _profileGenerator.Generate();



                    MongoConnection _mongoConnection = new MongoConnection();


                    ProcessStartInfo info = new ProcessStartInfo()
                    {
                        CreateNoWindow = true,
                        FileName       = @"C:\Users\Peterson Andrade\source\repos\InstaAccCreator_netframework\bin\x64\Debug\InstaAccCreator_netframework.exe",
                        Arguments      = pessoa.Proxy.username + ":" + pessoa.Proxy.password + "@" + pessoa.Proxy.proxy_address + ":" + pessoa.Proxy.ports.http.ToString()
                    };
                    process = Process.Start(info);



                    CountryCodes countryCodes = new CountryCodes();

                    var countryCodeDetails = countryCodes.AllCountries.Where(x => x.isoCode2digits == lowestPriceCountry.country).First();

                    var numberObject = smsPvaService.GetNumber(lowestPriceCountry.country);

                    numberObject.number = "+" + countryCodeDetails.countryCode + numberObject.number;


                    //var getSms = smsPvaService.GetSms(lowestPriceCountry.country, numberObject.id);
                    pessoa.Number = numberObject;


                    var options = new ChromeOptions();
                    //options.BinaryLocation = @"C:\Users\Peterson Andrade\source\repos\InstaAccCreator_netframework\bin\x64\Debug\InstaAccCreator_netframework.exe";
                    //options.AddArgument("url=data:,");
                    //options.AddArgument("no-sandbox");
                    //options.AddArgument("--headless");
                    //options
                    options.DebuggerAddress = "localhost:8081";


                    //var driverService = ChromeDriverService.CreateDefaultService();
                    //driverService.HideCommandPromptWindow = true;
                    options.PageLoadStrategy = PageLoadStrategy.Normal;

                    var driverService = ChromeDriverService.CreateDefaultService();
                    driverService.HideCommandPromptWindow = true;


                    driver = new ChromeDriver(driverService, options);
                    driver.Navigate().GoToUrl("https://instagram.com");
                    //driver.Navigate().GoToUrl("http://google.com");
                    //AppDomain.CurrentDomain.ProcessExit += new EventHandler((x, y) =>
                    //{
                    //    driver.Close();
                    //    process.Kill();
                    //});


                    var search_Locator = By.TagName("a");
                    var wait           = new WebDriverWait(driver, new System.TimeSpan(0, 1, 0));
                    wait.Until(ExpectedConditions.ElementIsVisible(search_Locator));
                    //System.Threading.Thread.Sleep(10000);
                    bool IsVisibleSignUpLink = false;
                    do
                    {
                        var elements = driver.FindElements(search_Locator);//.Where(x => x.GetAttribute("href") == "//");

                        foreach (var element in elements)
                        {
                            var elementHreftext = (element.GetProperty("href"));
                            if (elementHreftext.Contains("accounts/emailsignup"))
                            {
                                //MessageBox.Show("Found!");
                                IsVisibleSignUpLink = true;
                                element.Click();
                            }
                            this.richTextBox1.AppendText(elementHreftext + "\n");
                        }
                    } while (!IsVisibleSignUpLink);


                    var email_Locator = By.Name("emailOrPhone");
                    wait.Until(ExpectedConditions.ElementIsVisible(email_Locator));
                    var emailElement = driver.FindElement(email_Locator);
                    emailElement.Click();
                    //emailElement.SendKeys("+5521987655678");
                    emailElement.SendKeys(numberObject.number);



                    //emailElement.FindElement(By.ClassName("coreSpriteInputAccepted"));
                    //emailElement.FindElement(By.ClassName("coreSpriteInputError"));
                    //emailElement.FindElement(By.ClassName("coreSpriteInputRefresh"));



                    var fullName_Locator = By.Name("fullName");
                    wait.Until(ExpectedConditions.ElementIsVisible(fullName_Locator));
                    var fullNameElement = driver.FindElement(fullName_Locator);
                    fullNameElement.Click();
                    fullNameElement.SendKeys(pessoa.Nome);


                    var userName_Locator = By.Name("username");
                    wait.Until(ExpectedConditions.ElementIsVisible(userName_Locator));
                    var userNameElement = driver.FindElement(userName_Locator);
                    userNameElement.Click();
                    userNameElement.SendKeys(pessoa.UserName);


                    var password_Locator = By.Name("password");
                    wait.Until(ExpectedConditions.ElementIsVisible(password_Locator));
                    var passwordElement = driver.FindElement(password_Locator);
                    passwordElement.Click();
                    passwordElement.SendKeys(pessoa.Senha);


                    userNameElement = driver.FindElement(userName_Locator);
                    IWebElement userNameDivElement = userNameElement.FindElement(By.XPath("..")).FindElement(By.XPath(".."));

                    try
                    {
                        var acceptedLocator = By.ClassName("coreSpriteInputAccepted");
                        wait.Until(ExpectedConditions.ElementIsVisible(acceptedLocator));
                        var userNameInputAcceptedElement = userNameDivElement.FindElement(acceptedLocator);
                        if (!userNameInputAcceptedElement.Displayed)
                        {
                        }
                    }
                    catch (Exception ex)
                    {
                        try
                        {
                            var errorLocator = By.ClassName("coreSpriteInputError");
                            wait.Until(ExpectedConditions.ElementIsVisible(errorLocator));
                            var userNameInputErrorElement = userNameDivElement.FindElement(errorLocator);
                            if (userNameInputErrorElement.Displayed)
                            {
                                var refreshLocator = By.ClassName("coreSpriteInputRefresh");
                                wait.Until(ExpectedConditions.ElementIsVisible(refreshLocator));
                                var userNameInputRefreshElement = userNameDivElement.FindElement(By.ClassName("coreSpriteInputRefresh"));
                                userNameInputRefreshElement.Click();
                                passwordElement.Click();

                                userNameElement = driver.FindElement(userName_Locator);
                                pessoa.UserName = userNameElement.GetProperty("value");
                            }
                        }
                        catch (Exception exc)
                        {
                        }
                    }



                    var signUpButton_Locator = By.TagName("button");
                    wait.Until(ExpectedConditions.ElementIsVisible(signUpButton_Locator));
                    var elementsBtn = driver.FindElements(signUpButton_Locator);//.Where(x => x.GetAttribute("href") == "//");


                    foreach (var element in elementsBtn)
                    {
                        var elementHreftext = (element.GetProperty("type"));
                        if (elementHreftext.Contains("submit"))
                        {
                            //new Actions(driver).MoveToElement(element).Perform();
                            //MessageBox.Show("Found!");
                            element.Click();
                        }
                    }

                    //Verificar a presença do Sprite de Aniversário
                    var birthDayClass = By.ClassName("glyphsSpriteBirthday_cake");
                    wait.Until(ExpectedConditions.ElementIsVisible(birthDayClass));

                    var selectElementLocator = By.TagName("select");
                    wait.Until(ExpectedConditions.ElementIsVisible(selectElementLocator));
                    var selectElement = driver.FindElements(selectElementLocator);//.Where(x => x.GetAttribute("href") == "//");

                    //MessageBox.Show("Quantidade de Selects = " + selectElement.Count.ToString());

                    //select 0 = mês
                    //select 1 = dia
                    //select 2 = ano
                    //select 3 = idioma

                    var selectMes = new SelectElement(selectElement[0]);
                    selectMes.SelectByValue(pessoa.DataNascimento.Month.ToString());

                    var selectDia = new SelectElement(selectElement[1]);
                    selectDia.SelectByValue(pessoa.DataNascimento.Day.ToString());

                    var selectAno = new SelectElement(selectElement[2]);
                    selectAno.SelectByValue(pessoa.DataNascimento.Year.ToString());



                    var buttonLocator = By.TagName("Button");
                    wait.Until(ExpectedConditions.ElementIsVisible(buttonLocator));
                    var buttonElement = driver.FindElements(buttonLocator);

                    //foreach (var element in buttonElement)
                    //{
                    //    this.richTextBox1.AppendText("button Type=:" + element.GetProperty("type"));
                    //    this.richTextBox1.AppendText(element.Text + "\n");

                    //}

                    buttonElement[1].Click();

                    //Verificar a presença do Sprite de Confirmação
                    var phoneSpriteConfirmationClass = By.ClassName("glyphsSpritePhone_confirm");
                    wait.Until(ExpectedConditions.ElementIsVisible(phoneSpriteConfirmationClass));


                    //TryGet SMS
                    var getSms = smsPvaService.GetSms(lowestPriceCountry.country, numberObject.id);

                    int i = 0;

                    Stopwatch stopwatch = new Stopwatch();
                    stopwatch.Start();
                    while (getSms.sms == null)
                    {
                        getSms = smsPvaService.GetSms(lowestPriceCountry.country, numberObject.id);
                        System.Threading.Thread.Sleep(20000);
                        i += 20000;

                        if (stopwatch.ElapsedMilliseconds >= TimeSpan.FromMinutes(10).TotalMilliseconds)
                        {
                            //TODO: ban Number
                            var retornoBan = smsPvaService.BanNumber(numberObject.id);
                            break;
                        }
                    }


                    //Confirmation Code Input
                    var confirmCodeInputLocator = By.Name("confirmationCode");
                    wait.Until(ExpectedConditions.ElementIsVisible(confirmCodeInputLocator));
                    var confirmationCodeInputElement = driver.FindElement(confirmCodeInputLocator);
                    //confirmationCodeInputElement.SendKeys("9829384");
                    confirmationCodeInputElement.SendKeys(getSms.sms);

                    //Click The Button
                    //Wich button ?
                    buttonLocator = By.TagName("Button");
                    wait.Until(ExpectedConditions.ElementIsVisible(buttonLocator));
                    buttonElement = driver.FindElements(buttonLocator);

                    buttonElement[0].Click();
                    //0-button text: Confirm
                    //1-button text: Change Number
                    //2-button text: Request New Code

                    //Esperar aparecer o SearchBar
                    var searchBarIconClass = By.ClassName("coreSpriteSearchIcon");
                    wait.Until(ExpectedConditions.ElementIsVisible(searchBarIconClass));

                    //foreach (var element in buttonElement)
                    //{
                    //    //this.richTextBox1.AppendText("button Type=:" + element.GetProperty("type"));
                    //    this.richTextBox1.AppendText("button text::" + element.Text);
                    //    this.richTextBox1.AppendText(element.Text + "\n");

                    //}



                    richTextBox1.ScrollToCaret();

                    //0 - Why Do we need birthday
                    //1 - next
                    //2 - back


                    //foreach (var element in selectElement)
                    //{
                    //    var select = new SelectElement(element);


                    //    var elementHreftext = (element.GetProperty("title"));
                    //    this.richTextBox1.AppendText(elementHreftext + "\n");

                    //    foreach (var option in select.Options)
                    //    {
                    //        var valuefromOption = option.GetProperty("value");

                    //        this.richTextBox1.AppendText(valuefromOption + "\n");

                    //    }
                    //    //  selectElelemt.Options.ToList().ForEach(x => {
                    //    //      x.GetProperty("value")
                    //    //var elementHreftext = (element.GetProperty("type"));
                    //    //  if (elementHreftext.Contains("submit"))

                    //}

                    _mongoConnection.Pessoas.InsertOne(pessoa);
                }
                catch (Exception ex)
                {
                }
                finally
                {
                    try
                    {
                        if (driver != null)
                        {
                            driver.Close();
                        }

                        if (process != null)
                        {
                            process.Kill();
                        }
                    }
                    catch (Exception exc)
                    {
                    }
                    finally
                    {
                        userInfo = smsPvaService.GetUserInfo();
                    }
                }
            }
        }
        public string FTP_NVWashoe(string address, string ownername, string parcelNumber, string searchType, string orderNumber, string directParcel)
        {
            GlobalClass.global_orderNo             = orderNumber;
            HttpContext.Current.Session["orderNo"] = orderNumber;
            GlobalClass.global_parcelNo            = parcelNumber;
            //GlobalClass.global_county = county;
            string outparcelno = "", siteaddr = "", owner1 = "", legal_desc = "", year_built = "", tax_authority = "", sub_div = "", T_legal_desc;
            string valued_year = "", tax_year = "", assess_land = "", ass_improve = "", ass_total = "", tax_value = "", exem = "", pathid = "";
            var    driverService = PhantomJSDriverService.CreateDefaultService();

            driverService.HideCommandPromptWindow = true;
            string StartTime = "", AssessmentTime = "", TaxTime = "", CitytaxTime = "", LastEndTime = "";

            using (driver = new PhantomJSDriver())
            {
                try
                {
                    StartTime = DateTime.Now.ToString("HH:mm:ss");

                    if (searchType == "titleflex")
                    {
                        gc.TitleFlexSearch(orderNumber, parcelNumber, "", address, "NV", "Washoe");

                        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_NVWashoe"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                        parcelNumber = HttpContext.Current.Session["titleparcel"].ToString();
                        searchType   = "parcel";
                    }

                    if (searchType == "address")
                    {
                        driver.Navigate().GoToUrl("https://www.washoecounty.us/assessor/cama/index.php");
                        driver.FindElement(By.Id("street_address")).SendKeys(address);

                        gc.CreatePdf_WOP(orderNumber, "InputPassed_AddressSearch", driver, "NV", "Washoe");

                        driver.FindElement(By.Name("situssubmit")).SendKeys(Keys.Enter);
                        Thread.Sleep(7000);


                        By Icount = By.Id("search_results_info");
                        if (Exists(Icount))
                        {
                            // success
                            multiparcel(orderNumber);
                            HttpContext.Current.Session["multiParcel_NVWashoe"] = "Yes";
                            return("MultiParcel");
                        }
                    }
                    else if (searchType == "parcel")
                    {
                        driver.Navigate().GoToUrl("https://www.washoecounty.us/assessor/cama/index.php");
                        driver.FindElement(By.Id("parid")).SendKeys(parcelNumber);
                        gc.CreatePdf(orderNumber, parcelNumber, "InputPassed_ParcelSearch", driver, "NV", "Washoe");
                        driver.FindElement(By.Id("apnsubmit")).SendKeys(Keys.Enter);
                        Thread.Sleep(7000);
                    }

                    else if (searchType == "ownername")
                    {
                        //Thread.Sleep(3000);
                        driver.Navigate().GoToUrl("https://www.washoecounty.us/assessor/cama/index.php");
                        driver.FindElement(By.Id("o_lastname")).SendKeys(ownername);
                        gc.CreatePdf_WOP(orderNumber, "InputPassed_OwnerNameSearch", driver, "NV", "Washoe");
                        driver.FindElement(By.Name("ownsubmit")).SendKeys(Keys.Enter);
                        Thread.Sleep(7000);
                        bool norec = false;
                        try
                        {
                            Thread.Sleep(3000);
                            IWebElement norecord = driver.FindElement(By.XPath("//*[@id='search_div']/div[1]"));
                            string[]    name = ownername.Split(null);
                            string      firstname = name[0]; string lastname = name[1];
                            if (firstname.Contains(",") && lastname.Contains(","))
                            {
                                firstname = firstname.Replace(",", "").Trim();
                                lastname  = lastname.Replace(",", "").Trim();
                            }
                            if (lastname.Length == 1)
                            {
                                driver.FindElement(By.Id("o_firstname")).SendKeys(firstname);
                                gc.CreatePdf_WOP(orderNumber, "InputPassed_OwnerNameSearch", driver, "NV", "Washoe");
                                driver.FindElement(By.Name("ownsubmit")).SendKeys(Keys.Enter);
                                Thread.Sleep(7000);
                            }
                            else
                            {
                                driver.FindElement(By.Id("o_firstname")).SendKeys(lastname);
                                driver.FindElement(By.Id("o_lastname")).SendKeys(firstname);
                                gc.CreatePdf_WOP(orderNumber, "InputPassed_OwnerNameSearch", driver, "NV", "Washoe");
                                driver.FindElement(By.Name("ownsubmit")).SendKeys(Keys.Enter);
                                Thread.Sleep(7000);
                            }
                        }
                        catch
                        {
                        }

                        try
                        {
                            IWebElement multi = driver.FindElement(By.XPath("//*[@id='search_results']"));
                            multiparcel(orderNumber);
                            HttpContext.Current.Session["multiParcel_NVWashoe"] = "Yes";
                            return("MultiParcel");
                        }
                        catch
                        {
                        }
                    }

                    try
                    {
                        IWebElement INodata = driver.FindElement(By.Id("search_div"));
                        if (INodata.Text.Contains("No results were found"))
                        {
                            HttpContext.Current.Session["Nodata_NVWashoe"] = "Yes";
                            driver.Quit();
                            return("No Data Found");
                        }
                    }
                    catch { }
                    //APN: 078-221-13

                    outparcelno = driver.FindElement(By.XPath("//*[@id='search_div']/div[1]/div[5]/span[1]")).Text.Trim();
                    outparcelno = outparcelno.Replace("APN: ", "");
                    string outparcelnowoh = outparcelno.Replace("-", "").Trim();
                    gc.CreatePdf(orderNumber, outparcelnowoh, "AssessmentDetails", driver, "NV", "Washoe");
                    siteaddr = driver.FindElement(By.XPath("//*[@id='owner_data']/table/tbody/tr[1]/td[2]")).Text.Trim();
                    owner1   = driver.FindElement(By.XPath("//*[@id='owner_data']/table/tbody/tr[2]/td[2]")).Text.Trim();

                    //legal_desc = driver.FindElement(By.XPath("//*[@id='owner_data']/table/tbody/tr[8]/td[2]")).Text.Replace("'", "").Trim();
                    sub_div    = driver.FindElement(By.XPath("//*[@id='owner_data']/table/tbody/tr[9]/td[2]")).Text.Replace("'", "").Trim();
                    year_built = driver.FindElement(By.XPath("//*[@id='building_data']/table/tbody/tr[3]/td[2]")).Text.Trim();

                    string property_details = siteaddr + "~" + owner1 + "~" + legal_desc + "~" + sub_div + "~" + year_built;
                    gc.insert_date(orderNumber, outparcelno, 1, property_details, 1, DateTime.Now);
                    //db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',1 ,'" + property_details + "',1,1)");
                    //db.ExecuteQuery("insert into real_property (orderno, apn, address,legal_description,subdivision,year_built,owner) values ('" + orderNumber + "', '" + outparcelno + "','" + siteaddr + "','" + legal_desc + "','" + sub_div + "','" + year_built + "','" + owner1 + "')");

                    //valuation Information
                    IWebElement         valuetableElement = driver.FindElement(By.XPath("//*[@id='value_data']/table"));
                    IList <IWebElement> valuetableRow     = valuetableElement.FindElements(By.TagName("tr"));
                    IList <IWebElement> valuerowTD;
                    List <string>       history       = new List <string>();
                    List <string>       taxland       = new List <string>();
                    List <string>       taximprove    = new List <string>();
                    List <string>       taxtotal      = new List <string>();
                    List <string>       assessland    = new List <string>();
                    List <string>       assessimprove = new List <string>();
                    List <string>       assesstotal   = new List <string>();
                    int i = 0;
                    foreach (IWebElement row in valuetableRow)
                    {
                        valuerowTD = row.FindElements(By.TagName("td"));
                        if (valuerowTD.Count != 0)
                        {
                            if (i == 0)
                            {
                                history.Add(valuerowTD[1].Text.Trim().Replace("\r\n", ""));
                                history.Add(valuerowTD[2].Text.Trim().Replace("\r\n", ""));
                            }
                            else if (i == 1)
                            {
                                taxland.Add(valuerowTD[1].Text);
                                taxland.Add(valuerowTD[2].Text);
                            }
                            else if (i == 2)
                            {
                                taximprove.Add(valuerowTD[1].Text);
                                taximprove.Add(valuerowTD[2].Text);
                            }
                            else if (i == 3)
                            {
                                taxtotal.Add(valuerowTD[1].Text);
                                taxtotal.Add(valuerowTD[2].Text);
                            }
                            else if (i == 4)
                            {
                                assessland.Add(valuerowTD[1].Text);
                                assessland.Add(valuerowTD[2].Text);
                            }
                            else if (i == 5)
                            {
                                assessimprove.Add(valuerowTD[1].Text);
                                assessimprove.Add(valuerowTD[2].Text);
                            }
                            else if (i == 6)
                            {
                                assesstotal.Add(valuerowTD[1].Text);
                                assesstotal.Add(valuerowTD[2].Text);
                            }
                        }
                        i++;
                    }
                    string assessment1 = history[0] + "~" + taxland[0] + "~" + taximprove[0] + "~" + taxtotal[0] + "~" + assessland[0] + "~" + assessimprove[0] + "~" + assesstotal[0];
                    string assessment2 = history[1] + "~" + taxland[1] + "~" + taximprove[1] + "~" + taxtotal[1] + "~" + assessland[1] + "~" + assessimprove[1] + "~" + assesstotal[1];
                    gc.insert_date(orderNumber, outparcelno, 2, assessment1, 1, DateTime.Now);
                    gc.insert_date(orderNumber, outparcelno, 2, assessment2, 1, DateTime.Now);
                    AssessmentTime = DateTime.Now.ToString("HH:mm:ss");
                    //db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',2 ,'" + assessment1 + "',1,1)");
                    //db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',2 ,'" + assessment2 + "',1,1)");
                    //db.ExecuteQuery("insert into la_assessor(order_no,parcel_no,year,land,improvements,total,net_asses_value,tax_value,total_assessment) values('" + orderNumber + "','" + outparcelno + "','" + history[0] + "','" + taxland[0] + "','" + taximprove[0] + "','" + taxtotal[0] + "','" + assessland[0] + "','" + assessimprove[0] + "','" + assesstotal[0] + "') ");
                    //db.ExecuteQuery("insert into la_assessor(order_no,parcel_no,year,land,improvements,total,net_asses_value,tax_value,total_assessment) values('" + orderNumber + "','" + outparcelno + "','" + history[1] + "','" + taxland[1] + "','" + taximprove[1] + "','" + taxtotal[1] + "','" + assessland[1] + "','" + assessimprove[1] + "','" + assesstotal[1] + "') ");


                    //outparcelno = "035-310-41";
                    //Treasurer Details
                    driver.Navigate().GoToUrl("https://nv-washoe-treasurer.manatron.com/Tabs/TaxSearch.aspx");
                    var ddlsearch     = driver.FindElement(By.Id("selSearchBy"));
                    var selectElement = new SelectElement(ddlsearch);
                    selectElement.SelectByValue("Column1=");
                    driver.FindElement(By.Id("fldInput")).SendKeys(outparcelnowoh);
                    var wait = new WebDriverWait(driver, TimeSpan.FromMilliseconds(3000));
                    wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id='btnsearch']")));



                    gc.CreatePdf(orderNumber, outparcelnowoh, "InputPassed_Tax_ParcelSearch", driver, "NV", "Washoe");
                    driver.FindElement((By.XPath("//*[@id='btnsearch']"))).SendKeys(Keys.Enter);
                    Thread.Sleep(3000);
                    driver.FindElement(By.LinkText(outparcelnowoh)).SendKeys(Keys.Enter);
                    Thread.Sleep(2000);
                    gc.CreatePdf(orderNumber, outparcelnowoh, "Tax_MainPage", driver, "NV", "Washoe");

                    T_legal_desc  = driver.FindElement(By.XPath("//*[@id='lxT528']/table/tbody/tr[5]/td")).Text;
                    tax_authority = driver.FindElement(By.XPath("//*[@id='dnn_ctr480_HtmlModule_HtmlModule_lblContent']")).Text;
                    tax_authority = gc.Between(tax_authority, "Mailing Address:", "Overnight Address:").Trim();

                    //db.ExecuteQuery("update real_property set legal_description ='" + legal_desc + "', tax_authority = '" + tax_authority + "' where orderno ='" + orderNumber + "' and apn = '" + outparcelno + "' ");
                    property_details = siteaddr + "~" + owner1 + "~" + T_legal_desc + "~" + sub_div + "~" + year_built;
                    //db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',1 ,'" + property_details + "',1,1)");
                    gc.insert_date(orderNumber, outparcelno, 1, property_details, 1, DateTime.Now);
                    gc.CreatePdf(orderNumber, outparcelnowoh, "TaxBill_DetailsPage", driver, "NV", "Washoe");
                    //*[@id="529"]/table
                    IWebElement         taxbilltable    = driver.FindElement(By.XPath("//*[@id='529']/table"));
                    IList <IWebElement> taxbilltableRow = taxbilltable.FindElements(By.TagName("tr"));
                    int rowcount = taxbilltableRow.Count;
                    IList <IWebElement> taxbillrowTD;
                    int w = 1;
                    foreach (IWebElement rowid in taxbilltableRow)
                    {
                        taxbillrowTD = rowid.FindElements(By.TagName("td"));
                        if (taxbillrowTD.Count != 0 && !rowid.Text.Contains("Tax Year"))
                        {
                            if (w < rowcount)
                            {
                                string cons = taxbillrowTD[0].Text + "~" + taxbillrowTD[1].Text + "~" + taxbillrowTD[2].Text + "~" + taxbillrowTD[3].Text + "~" + taxbillrowTD[4].Text + "~" + taxbillrowTD[5].Text;
                                gc.insert_date(orderNumber, outparcelno, 66, cons, 1, DateTime.Now);
                            }
                            else
                            {
                                string cons = "-" + "~" + "-" + "~" + "-" + "~" + "-" + "~" + "Total" + "~" + taxbillrowTD[0].Text;
                                gc.insert_date(orderNumber, outparcelno, 66, cons, 1, DateTime.Now);
                            }
                        }
                        w++;
                    }


                    List <string> bill_year = new List <string>();

                    int l = 0;
                    for (int m = 1; m < rowcount - 1; m++)
                    {
                        driver.FindElement(By.XPath("//*[@id='529']/table/tbody/tr[" + m + "]/td[1]/a")).SendKeys(Keys.Enter);
                        Thread.Sleep(2000);

                        //installments
                        IWebElement         inst1table    = driver.FindElement(By.Id("installments"));
                        IList <IWebElement> inst1tableRow = inst1table.FindElements(By.TagName("tr"));
                        int inst1tableRowcount            = inst1tableRow.Count;
                        IList <IWebElement> inst1rowTD;
                        int    a    = 0;
                        string inst = "";
                        foreach (IWebElement rowid in inst1tableRow)
                        {
                            inst1rowTD = rowid.FindElements(By.TagName("td"));
                            if (inst1rowTD.Count != 0)
                            {
                                if (a > 0 && a < inst1tableRowcount - 1)
                                {
                                    //installment~due_date~tax_year~tax_amount~penalty_amount~Interest~total_due
                                    inst = inst1rowTD[0].Text + "~" + inst1rowTD[1].Text + "~" + inst1rowTD[2].Text + "~" + inst1rowTD[3].Text + "~" + inst1rowTD[4].Text + "~" + inst1rowTD[5].Text + "~" + inst1rowTD[6].Text;
                                    gc.insert_date(orderNumber, outparcelno, 3, inst, 1, DateTime.Now);
                                }
                                if (a == inst1tableRowcount - 1)
                                {
                                    inst = " - " + "~" + " - " + "~" + inst1rowTD[0].Text + "~" + inst1rowTD[1].Text + "~" + inst1rowTD[2].Text + "~" + inst1rowTD[3].Text + "~" + inst1rowTD[4].Text;
                                    gc.insert_date(orderNumber, outparcelno, 3, inst, 1, DateTime.Now);
                                }
                            }
                            a++;
                        }

                        try
                        {
                            //Payment History
                            IWebElement         payhisttable    = driver.FindElement(By.XPath("//*[@id='lxT536']/table"));
                            IList <IWebElement> payhisttableRow = payhisttable.FindElements(By.TagName("tr"));
                            IList <IWebElement> payhistrowTD;

                            foreach (IWebElement rowid1 in payhisttableRow)
                            {
                                payhistrowTD = rowid1.FindElements(By.TagName("td"));
                                if (payhistrowTD.Count != 0)
                                {
                                    string bill = payhistrowTD[0].Text + "~" + payhistrowTD[1].Text + "~" + payhistrowTD[2].Text + "~" + payhistrowTD[3].Text + "~" + payhistrowTD[4].Text;
                                    gc.insert_date(orderNumber, outparcelno, 4, bill, 1, DateTime.Now);
                                }
                            }
                        }
                        catch
                        {
                        }


                        //Tax Detail
                        //*[@id="lxT534"]/table
                        //IList<IWebElement> breakdownslist = driver.FindElements(By.XPath("//*[@id='534_" + pathid + "]/div/table"));
                        IWebElement         taxdetailtable    = driver.FindElement(By.XPath("//*[@id='lxT534']/table"));
                        IList <IWebElement> taxdetailtableRow = taxdetailtable.FindElements(By.TagName("tr"));
                        int taxrowcount = taxdetailtableRow.Count;
                        IList <IWebElement> taxdetailrowTD;
                        int    b             = 1;
                        string tax_breakdown = "";
                        foreach (IWebElement rowid1 in taxdetailtableRow)
                        {
                            taxdetailrowTD = rowid1.FindElements(By.TagName("td"));
                            if (taxdetailrowTD.Count != 0 && b <= taxrowcount)
                            {
                                if (b % 2 == 0 && b != taxrowcount)
                                {
                                    if (l == 0)
                                    {
                                        pathid = driver.FindElement(By.XPath("//*[@id=\"lxT534\"]/table/tbody/tr[" + b + "]/td[1]")).GetAttribute("tb");
                                        driver.FindElement(By.XPath("//*[@id='lxT534']/table/tbody/tr[" + b + "]/td[1]/a")).SendKeys(Keys.Enter);
                                        Thread.Sleep(2000);
                                    }
                                    tax_breakdown = taxdetailrowTD[0].Text + "~" + "-" + "~" + taxdetailrowTD[1].Text + "~" + taxdetailrowTD[2].Text + "~" + taxdetailrowTD[3].Text;
                                    gc.insert_date(orderNumber, outparcelno, 5, tax_breakdown, 1, DateTime.Now);
                                    //db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',5,'" + tax_breakdown + "',1,1)");
                                    //db.ExecuteQuery("insert into tax_breakdown_details (order_no, parcel_no,tax_authority,gross_tax,credit,net_tax) values ('" + orderNumber + "', '" + outparcelno + "', '" + taxdetailrowTD[0].Text + "', '" + taxdetailrowTD[1].Text + "', '" + taxdetailrowTD[2].Text + "', '" + taxdetailrowTD[3].Text + "')");
                                }
                                if (b == taxrowcount)
                                {
                                    tax_breakdown = "Total Tax" + "~" + "-" + "~" + taxdetailrowTD[0].Text + "~" + taxdetailrowTD[1].Text + "~" + taxdetailrowTD[2].Text;
                                    gc.insert_date(orderNumber, outparcelno, 5, tax_breakdown, 1, DateTime.Now);
                                    //  db.ExecuteQuery("insert into tax_breakdown_details (order_no, parcel_no,tax_authority,gross_tax,credit,net_tax) values ('" + orderNumber + "', '" + outparcelno + "', 'Total Tax','" + taxdetailrowTD[0].Text + "', '" + taxdetailrowTD[1].Text + "', '" + taxdetailrowTD[2].Text + "')");
                                }
                            }
                            b++;
                        }

                        if (l == 0)
                        {
                            gc.CreatePdf(orderNumber, outparcelnowoh, "Tax_HistoryDetailsPage", driver, "NV", "Washoe");

                            try
                            {
                                IWebElement         newtable    = driver.FindElement(By.XPath("//*[@id='534_" + pathid + " + 0']/div/table"));
                                IList <IWebElement> newtableRow = newtable.FindElements(By.TagName("tr"));
                                IList <IWebElement> newtablerowTD;
                                int newtableRowcount = newtableRow.Count;

                                foreach (IWebElement rowid1 in newtableRow)
                                {
                                    newtablerowTD = rowid1.FindElements(By.TagName("td"));
                                    if (newtablerowTD.Count != 0 && !rowid1.Text.Contains("Authority"))
                                    {
                                        tax_breakdown = tax_breakdown = newtablerowTD[0].Text + "~" + newtablerowTD[1].Text + "~" + newtablerowTD[2].Text + "~" + newtablerowTD[3].Text + "~" + newtablerowTD[4].Text;
                                        gc.insert_date(orderNumber, outparcelno, 5, tax_breakdown, 1, DateTime.Now);
                                        //db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',5,'" + tax_breakdown + "',1,1)");
                                        // db.ExecuteQuery("insert into tax_breakdown_details (order_no, parcel_no,tax_authority,net_rate,gross_tax,credit,net_tax) values ('" + orderNumber + "', '" + outparcelno + "', '" + newtablerowTD[0].Text + "', '" + newtablerowTD[1].Text + "', '" + newtablerowTD[2].Text + "', '" + newtablerowTD[3].Text + "', '" + newtablerowTD[4].Text + "')");
                                    }
                                }
                            }

                            catch
                            {
                            }


                            for (int z = 300000; z <= 300070; z++)
                            {
                                string tableid  = Convert.ToInt32(z).ToString();
                                string pathtdid = pathid + tableid;
                                try
                                {
                                    IWebElement         commontable    = driver.FindElement(By.XPath("//*[@id='534_" + pathtdid + "']/div/table"));
                                    IList <IWebElement> commontableRow = commontable.FindElements(By.TagName("tr"));
                                    IList <IWebElement> commontablerowTD;
                                    int commontableRowcount = commontableRow.Count;

                                    foreach (IWebElement rowid1 in commontableRow)
                                    {
                                        commontablerowTD = rowid1.FindElements(By.TagName("td"));
                                        if (commontablerowTD.Count != 0 && !rowid1.Text.Contains("Authority"))
                                        {
                                            tax_breakdown = commontablerowTD[0].Text + "~" + commontablerowTD[1].Text + "~" + commontablerowTD[2].Text + "~" + commontablerowTD[3].Text + "~" + commontablerowTD[4].Text;
                                            gc.insert_date(orderNumber, outparcelno, 5, tax_breakdown, 1, DateTime.Now);
                                            // db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',5,'" + tax_breakdown + "',1,1)");
                                            //db.ExecuteQuery("insert into tax_breakdown_details (order_no, parcel_no,tax_authority,net_rate,gross_tax,credit,net_tax) values ('" + orderNumber + "', '" + outparcelno + "', '" + commontablerowTD[0].Text + "', '" + commontablerowTD[1].Text + "', '" + commontablerowTD[2].Text + "', '" + commontablerowTD[3].Text + "', '" + commontablerowTD[4].Text + "')");
                                        }
                                    }
                                }

                                catch
                                {
                                }
                                pathtdid = "";
                            }
                        }
                        l++;
                        driver.Navigate().Back();
                    }
                    TaxTime = DateTime.Now.ToString("HH:mm:ss");
                    // AMG Details
                    string district_amgid = "-", amg_name = "-", status = "-", unbill_principal = "-", situs = "-", Legal_desc = "-", original_ass = "-", payoff = "-", due_desc = "-";
                    string curr_due_principal = "-", curr_due_interest = "-", curr_due_penalty = "-", curr_due_other = "-", curr_due_total_due = "-", amg_tax_authority = "-";
                    string ENI_principal = "-", ENI_interest = "-", ENI_penalty = "-", ENI_other = "-", ENI_total_due = "-";
                    string POB_Prepaid_principal = "-", POB_prepaid_interest = "-", POB_Prepay_Penalty = "-", POB_lien_reles = "-", POB_Curr_due = "-", POB_total_payoff = "-";
                    //string outparcelnowoh = "20808013";
                    // string outparcelnowoh = "03531041";
                    driver.Navigate().GoToUrl("https://www.amgnv.com/");
                    driver.FindElement(By.Name("Parcel")).SendKeys(outparcelnowoh);
                    gc.CreatePdf(orderNumber, outparcelnowoh, "InputPassed_Amg_ParcelSearch", driver, "NV", "Washoe");
                    driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/p/table[2]/tbody/tr/td/table/tbody/tr[2]/td[1]/form/center/b/font/font/input")).SendKeys(Keys.Enter);
                    Thread.Sleep(2000);


                    gc.CreatePdf(orderNumber, outparcelnowoh, "Amg_MainPage", driver, "NV", "Washoe");

                    By amgfound = By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/p/table[2]/tbody/tr/td/b/font");

                    try
                    {
                        if (!Exists(amgfound))
                        {
                            driver.FindElement(By.LinkText(outparcelnowoh)).SendKeys(Keys.Enter);
                            Thread.Sleep(1000);
                            gc.CreatePdf(orderNumber, outparcelnowoh, "Amg_DetailsPage", driver, "NV", "Washoe");


                            IWebElement         amgdetailtable    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[3]"));
                            IList <IWebElement> amgdetailtableRow = amgdetailtable.FindElements(By.TagName("tr"));
                            IList <IWebElement> amgdetailtablerowTD;
                            foreach (IWebElement rowid1 in amgdetailtableRow)
                            {
                                amgdetailtablerowTD = rowid1.FindElements(By.TagName("td"));
                                if (amgdetailtablerowTD.Count != 0 && !rowid1.Text.Contains("Parcel") && !rowid1.Text.Contains("Amounts"))
                                {
                                    district_amgid = amgdetailtablerowTD[1].Text.Trim(); amg_name = amgdetailtablerowTD[2].Text.Trim(); unbill_principal = amgdetailtablerowTD[4].Text.Trim();
                                }
                            }

                            IWebElement         situstable    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[4]"));
                            IList <IWebElement> situstableRow = situstable.FindElements(By.TagName("tr"));
                            IList <IWebElement> situstablerowTD;
                            int situsrowcount = situstableRow.Count;
                            int s             = 0;
                            foreach (IWebElement rowid1 in situstableRow)
                            {
                                situstablerowTD = rowid1.FindElements(By.TagName("td"));
                                if (situstablerowTD.Count != 0 && !rowid1.Text.Contains("Situs ") && s < situsrowcount - 1)
                                {
                                    situs = situstablerowTD[0].Text.Replace(",", "").Trim(); original_ass = situstablerowTD[1].Text.Trim(); payoff = situstablerowTD[2].Text.Trim();
                                }
                                if (s == situsrowcount - 1)
                                {
                                    Legal_desc = situstablerowTD[0].Text.Trim();
                                }
                                s++;
                            }

                            IWebElement         duetable    = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[6]"));
                            IList <IWebElement> duetableRow = duetable.FindElements(By.TagName("tr"));
                            IList <IWebElement> duetablerowTD;
                            int duerowcount = duetableRow.Count;
                            int d           = 0;
                            foreach (IWebElement rowid1 in duetableRow)
                            {
                                duetablerowTD = rowid1.FindElements(By.TagName("td"));
                                if (duetablerowTD.Count != 0 && !rowid1.Text.Contains("Principal") && d == 1)
                                {
                                    curr_due_principal = duetablerowTD[1].Text.Trim(); curr_due_interest = duetablerowTD[2].Text.Trim(); curr_due_penalty = duetablerowTD[3].Text.Trim(); curr_due_other = duetablerowTD[4].Text.Trim(); curr_due_total_due = duetablerowTD[5].Text.Trim();
                                }
                                if (d == 2)
                                {
                                    ENI_principal = duetablerowTD[1].Text.Trim(); ENI_interest = duetablerowTD[2].Text.Trim(); ENI_penalty = duetablerowTD[3].Text.Trim(); ENI_other = duetablerowTD[4].Text.Trim(); ENI_total_due = duetablerowTD[5].Text.Trim();
                                }
                                d++;
                            }

                            amg_tax_authority = driver.FindElement(By.XPath("/html/body/table[3]/tbody/tr/td[6]/table/tbody/tr[2]/td[2]/table[8]/tbody/tr[2]/td[2]/table/tbody/tr/td[2]")).Text;
                            amg_tax_authority = amg_tax_authority.Replace("\n", "");

                            try
                            {
                                string            currentHandle     = driver.CurrentWindowHandle;
                                IWebElement       element           = driver.FindElement(By.LinkText(payoff));
                                PopupWindowFinder finder            = new PopupWindowFinder(driver);
                                string            popupWindowHandle = finder.Click(element);

                                driver.SwitchTo().Window(popupWindowHandle);
                                gc.CreatePdf(orderNumber, outparcelnowoh, "Amg_PayOffPage", driver, "NV", "Washoe");

                                IWebElement         POBtable    = driver.FindElement(By.XPath("/html/body/center/table[2]/tbody/tr/td/table"));
                                IList <IWebElement> POBtableRow = POBtable.FindElements(By.TagName("tr"));
                                //IList<IWebElement> POBtablerowTD;
                                int POBrowcount = POBtableRow.Count;
                                POB_Prepaid_principal = POBtableRow[1].Text.Replace("Prepaid Principal:", "").Trim();
                                POB_prepaid_interest  = POBtableRow[2].Text.Replace("Prepaid Interest:", "").Trim();
                                POB_Prepay_Penalty    = POBtableRow[3].Text.Replace("Prepayment Penalty:", "").Trim();
                                POB_lien_reles        = POBtableRow[4].Text.Replace("Lien Release:", "").Trim();;
                                POB_Curr_due          = POBtableRow[5].Text.Replace("Current Due:", "").Trim();
                                POB_total_payoff      = POBtableRow[6].Text.Replace("Total Payoff:", "").Trim();
                                string amgdetails = district_amgid + "~" + amg_name + "~" + situs + "~" + unbill_principal + "~" + Legal_desc + "~" + original_ass + "~" + payoff + "~" + curr_due_principal + "~" + curr_due_interest + "~" + curr_due_penalty + "~" + curr_due_other + "~" + curr_due_total_due + "~" + ENI_principal + "~" + ENI_interest + "~" + ENI_penalty + "~" + ENI_other + "~" + ENI_total_due + "~" + amg_tax_authority + "~" + POB_Prepaid_principal + "~" + POB_prepaid_interest + "~" + POB_Prepay_Penalty + "~" + POB_lien_reles + "~" + POB_Curr_due + "~" + POB_total_payoff;
                                gc.insert_date(orderNumber, outparcelno, 6, amgdetails, 1, DateTime.Now);
                                //db.ExecuteQuery("insert into data_value_master (Order_no,parcel_no,Data_Field_Text_Id,Data_Field_value,Is_Table,Sequence) values ('" + orderNumber + "','" + outparcelno + "',6,'" + amgdetails + "',1,1)");
                                //  db.ExecuteQuery("insert into amg_details (order_no,parcel_no,District_amgid,Name,Situs,Unbill_prinicipal,Legaldescription,Original_Assesment,Payoff,curr_due_Principal,curr_due_Interest,curr_due_Penalty,curr_due_Other,curr_due_Total_Due,ENI_principal,ENI_interest,ENI_penalty,ENI_other,ENI_total_due,Tax_Authority,PayOff_Br_Prepaid_Principal,PayOff_Br_Prepaid_Interest,PayOff_Br_Prepayment_Penalty,PayOff_Br_Lien_Release,PayOff_Br_Current_Due,PayOff_Br_Total_Payoff) values ('" + orderNumber + "','" + parcelNumber + "','" + district_amgid + "','" + amg_name + "','" + situs + "','" + unbill_principal + "','" + Legal_desc + "','" + original_ass + "','" + payoff + "','" + curr_due_principal + "','" + curr_due_interest + "','" + curr_due_penalty + "','" + curr_due_other + "','" + curr_due_total_due + "','" + amg_tax_authority + "','" + ENI_principal + "','" + ENI_interest + "','" + ENI_penalty + "','" + ENI_other + "','" + ENI_total_due + "','" + POB_Prepaid_principal + "','" + POB_prepaid_interest + "','" + POB_Prepay_Penalty + "','" + POB_lien_reles + "','" + POB_Curr_due + "','" + POB_total_payoff + "')");
                                // Do whatever you need to on the popup browser, then...
                                driver.Quit();
                                //driver.SwitchTo().Window(currentHandle);
                            }
                            catch
                            {
                            }
                        }

                        else
                        {
                            driver.Quit();
                            gc.mergpdf(orderNumber, "NV", "Washoe");
                            LastEndTime = DateTime.Now.ToString("HH:mm:ss");
                            gc.insert_TakenTime(orderNumber, "NV", "Washoe", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);
                            return("Data Inserted Successfully");
                        }
                    }
                    catch
                    {
                    }
                    LastEndTime = DateTime.Now.ToString("HH:mm:ss");

                    driver.Quit();
                    gc.insert_TakenTime(orderNumber, "NV", "Washoe", StartTime, AssessmentTime, TaxTime, CitytaxTime, LastEndTime);
                    gc.mergpdf(orderNumber, "NV", "Washoe");
                    return("Data Inserted Successfully");
                }
                catch (Exception ex)
                {
                    driver.Quit();
                    GlobalClass.LogError(ex, orderNumber);
                    throw ex;
                }
            }
        }
Beispiel #21
0
		int getIndex(SelectElement sel)
		{
			return sel.SelectedIndex;
		}
Beispiel #22
0
        public void FillInfo(string FirstName, string LastName, string Email, string City, string Address, string PostalCode, string PhoneNumber, string PONumber)
        {
            // Fill the info
            // billing address
            SelectElement selectAddress = new SelectElement(driver.FindElement(By.Id("billing-address-select")));

            selectAddress.SelectByText("New Address");
            driver.FindElement(By.Id("BillingNewAddress_FirstName")).Clear();
            driver.FindElement(By.Id("BillingNewAddress_FirstName")).SendKeys(FirstName);
            driver.FindElement(By.Id("BillingNewAddress_LastName")).Clear();
            driver.FindElement(By.Id("BillingNewAddress_LastName")).SendKeys(LastName);
            driver.FindElement(By.Id("BillingNewAddress_Email")).Clear();
            driver.FindElement(By.Id("BillingNewAddress_Email")).SendKeys(Email);
            SelectElement selectBillingCountry = new SelectElement(driver.FindElement(By.Id("BillingNewAddress_CountryId")));

            selectBillingCountry.SelectByText("China");
            driver.FindElement(By.Id("BillingNewAddress_City")).Clear();
            driver.FindElement(By.Id("BillingNewAddress_City")).SendKeys(City);
            driver.FindElement(By.Id("BillingNewAddress_Address1")).Clear();
            driver.FindElement(By.Id("BillingNewAddress_Address1")).SendKeys(Address);
            driver.FindElement(By.Id("BillingNewAddress_ZipPostalCode")).Clear();
            driver.FindElement(By.Id("BillingNewAddress_ZipPostalCode")).SendKeys(PostalCode);
            driver.FindElement(By.Id("BillingNewAddress_PhoneNumber")).Clear();
            driver.FindElement(By.Id("BillingNewAddress_PhoneNumber")).SendKeys(PhoneNumber);
            driver.FindElement(By.CssSelector("div#checkout-step-billing>div#billing-buttons-container>input.button-1")).Click();

            // shipping address
            WebDriverWait waitUntilShippingAddress = new WebDriverWait(driver, TimeSpan.FromSeconds(5));

            waitUntilShippingAddress.Until(ExpectedConditions.ElementIsVisible(By.Id("shipping-address-select")));
            SelectElement select1 = new SelectElement(driver.FindElement(By.Id("shipping-address-select")));

            select1.SelectByText("New Address");
            driver.FindElement(By.Id("ShippingNewAddress_FirstName")).Clear();
            driver.FindElement(By.Id("ShippingNewAddress_FirstName")).SendKeys(FirstName);
            driver.FindElement(By.Id("ShippingNewAddress_LastName")).Clear();
            driver.FindElement(By.Id("ShippingNewAddress_LastName")).SendKeys(LastName);
            driver.FindElement(By.Id("ShippingNewAddress_Email")).Clear();
            driver.FindElement(By.Id("ShippingNewAddress_Email")).SendKeys(Email);
            SelectElement selectShippingCountry = new SelectElement(driver.FindElement(By.Id("ShippingNewAddress_CountryId")));

            selectShippingCountry.SelectByText("China");
            driver.FindElement(By.Id("ShippingNewAddress_City")).Clear();
            driver.FindElement(By.Id("ShippingNewAddress_City")).SendKeys(City);
            driver.FindElement(By.Id("ShippingNewAddress_Address1")).Clear();
            driver.FindElement(By.Id("ShippingNewAddress_Address1")).SendKeys(Address);
            driver.FindElement(By.Id("ShippingNewAddress_ZipPostalCode")).Clear();
            driver.FindElement(By.Id("ShippingNewAddress_ZipPostalCode")).SendKeys(PostalCode);
            driver.FindElement(By.Id("ShippingNewAddress_PhoneNumber")).Clear();
            driver.FindElement(By.Id("ShippingNewAddress_PhoneNumber")).SendKeys(PhoneNumber);
            driver.FindElement(By.CssSelector("div#shipping-buttons-container>input")).Click();

            // shipping method
            WebDriverWait waitUntilMethodList = new WebDriverWait(driver, TimeSpan.FromSeconds(5));

            waitUntilMethodList.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("div.shipping-method>ul.method-list")));
            driver.FindElement(By.CssSelector("ul.method-list input#shippingoption_1")).Click();
            driver.FindElement(By.CssSelector("div#shipping-method-buttons-container>input.shipping-method-next-step-button")).Click();

            // payment method
            WebDriverWait waitUntilPaymentMethodList = new WebDriverWait(driver, TimeSpan.FromSeconds(5));

            waitUntilPaymentMethodList.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("div.payment-method div.method-name img[alt='Purchase Order']")));
            driver.FindElement(By.CssSelector("div.payment-method div.payment-details>input#paymentmethod_3")).Click();
            driver.FindElement(By.CssSelector("div#payment-method-buttons-container>input.payment-method-next-step-button")).Click();

            // payment information
            WebDriverWait waitUntilPONumber = new WebDriverWait(driver, TimeSpan.FromSeconds(5));

            waitUntilPONumber.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("div.payment-info table>tbody>tr")));
            driver.FindElement(By.CssSelector("div.payment-info tbody input#PurchaseOrderNumber")).Clear();
            driver.FindElement(By.CssSelector("div.payment-info tbody input#PurchaseOrderNumber")).SendKeys(PONumber);
            driver.FindElement(By.CssSelector("div#payment-info-buttons-container>input.payment-info-next-step-button")).Click();
        }
        private int selectTerm(tstObject tstObj, SelectElement selection, string inSelection, int inIndex, bool objPres, int rsltFlag, ref string[,] tstresult)
        {
            int fndItem;

                if (rsltFlag == 1)
                {
                    tmpString = "Found list item [" + inSelection + "]";
                    tstresult = arrayAppend(objPres.ToString(), tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                }

                fndItem = 1;
                selection.SelectByIndex(inIndex);

                return fndItem;
        }
Beispiel #24
0
        public void DropDownSelectByText(string text)
        {
            SelectElement dropDown = new SelectElement(control);

            dropDown.SelectByText(text);
        }
Beispiel #25
0
		private void FillSelect(SelectElement el, OptionElement[] options)
		{
			ClearSelect(el);
			for (int i = 0; i < options.Length; i++)
			{
				el.AppendChild(options[i]);
			}
		}
Beispiel #26
0
        public void DropDownSelectByIndex(int index)
        {
            SelectElement dropDown = new SelectElement(control);

            dropDown.SelectByIndex(index);
        }
Beispiel #27
0
 public void AddOption(SelectElement Option)
 {
     this.Options.Add(Option);
 }
Beispiel #28
0
        public void DropDownSelectByValue(string value)
        {
            SelectElement dropDown = new SelectElement(control);

            dropDown.SelectByValue(value);
        }
Beispiel #29
0
        public void SepeteAt()
        {
            Thread.Sleep(3000);

            Paging();
            Thread.Sleep(3000);

            IWebElement List_3rdItem = driver.FindElement(By.XPath(".//*[@id='view']/ul/li[3]"));
            IWebElement ClickItem = List_3rdItem.FindElement(By.ClassName("productName"));
            var sepete_atilan_item = ClickItem.Text;
            ClickItem.Click();
            Thread.Sleep(4000);
            Console.WriteLine("Ürün seçildi ve detay ekranına ulaşıldı...");

            IWebElement SelectBox = driver.FindElement(By.XPath(".//*[@id='skuArea']/fieldset"));
            IWebElement SelectColorCombo = SelectBox.FindElement(By.TagName("select"));

            SelectElement selectColor = new SelectElement(SelectColorCombo);
            selectColor.SelectByIndex(1);
            Console.WriteLine("Ürün rengi seçildi...");

            IWebElement Btn_Basket = driver.FindElement(By.CssSelector(".btn.btnGrey.btnAddBasket"));
            Btn_Basket.Click();
            Thread.Sleep(3000);
            Console.WriteLine("Ürün speete atıldı...");
            IWebElement Sepet = driver.FindElement(By.CssSelector(".myBasket"));
            Sepet.Click();
            Thread.Sleep(8000);
            Console.WriteLine("Sepet içerisine girildi...");
            IWebElement productDetail = driver.FindElement(By.ClassName("productDetail"));
            var title = productDetail.FindElement(By.TagName("h4"));

            Assert.That(title.Text, Is.EqualTo(sepete_atilan_item));
            Console.WriteLine("Sepetteki ürün ile seçilen ürünün aynı ürün olduğu doğrulandı...");
            IWebElement Btn_Sil = driver.FindElement(By.ClassName("remove"));
            Btn_Sil.Click();
            Thread.Sleep(4000);
            Console.WriteLine("Ürün silme işlemi gerçekleştirildi...");

            IWebElement SilinmeOnayi = driver.FindElement(By.XPath(".//*[@id='content']/div/div[1]/div[1]/span[1]"));
            Assert.True(SilinmeOnayi.Text.Contains("Sepetiniz Boş"));
            Console.WriteLine("Ürün silinme onayı alındı...");
            Thread.Sleep(3000);
        }
Beispiel #30
0
        public void SelectOperation(Operation operation)
        {
            var select = new SelectElement(OperationSelect);

            select.SelectByValue(operation.GetDescription());
        }
        public void ShouldOpenAccount()
        {
            // switch to "Add Customer" screen
            ngDriver.FindElement(NgBy.ButtonText("Bank Manager Login")).Click();
            ngDriver.FindElement(NgBy.PartialButtonText("Open Account")).Click();

            // fill new Account data
            NgWebElement ng_customer_select = ngDriver.FindElement(NgBy.Model("custId"));

            StringAssert.IsMatch("userSelect", ng_customer_select.GetAttribute("id"));
            ReadOnlyCollection <NgWebElement> ng_customers = ng_customer_select.FindElements(NgBy.Repeater("cust in Customers"));

            // select customer to log in
            NgWebElement account_customer = ng_customers.First(cust => Regex.IsMatch(cust.Text, "Harry Potter*"));

            Assert.IsNotNull(account_customer);
            account_customer.Click();

            NgWebElement ng_currencies_select = ngDriver.FindElement(NgBy.Model("currency"));
            // use core Selenium
            SelectElement       currencies_select  = new SelectElement(ng_currencies_select.WrappedElement);
            IList <IWebElement> account_currencies = currencies_select.Options;
            IWebElement         account_currency   = account_currencies.First(cust => Regex.IsMatch(cust.Text, "Dollar"));

            Assert.IsNotNull(account_currency);
            currencies_select.SelectByText("Dollar");

            // add the account
            var submit_button = ngDriver.FindElement(By.XPath("/html/body//form/button[@type='submit']"));

            StringAssert.IsMatch("Process", submit_button.Text);
            submit_button.Click();

            try {
                alert      = driver.SwitchTo().Alert();
                alert_text = alert.Text;
                StringAssert.StartsWith("Account created successfully with account Number", alert_text);
                alert.Accept();
            } catch (NoAlertPresentException ex) {
                // Alert not present
                verificationErrors.Append(ex.StackTrace);
            } catch (WebDriverException ex) {
                // Alert not handled by PhantomJS
                verificationErrors.Append(ex.StackTrace);
            }

            // Confirm account added for customer
            Assert.IsEmpty(verificationErrors.ToString());

            // switch to "Customers" screen
            ngDriver.FindElement(NgBy.PartialButtonText("Customers")).Click();

            // get customers
            ng_customers = ngDriver.FindElements(NgBy.Repeater("cust in Customers"));
            // discover customer
            NgWebElement ng_customer = ng_customers.First(cust => Regex.IsMatch(cust.Text, "Harry Potter"));

            Assert.IsNotNull(ng_customer);

            // extract the account id from the alert message
            string account_id = alert_text.FindMatch(@"(?<account_id>\d+)$");

            Assert.IsNotNullOrEmpty(account_id);
            // search accounts of specific customer
            ReadOnlyCollection <NgWebElement> ng_customer_accounts = ng_customer.FindElements(NgBy.Repeater("account in cust.accountNo"));

            NgWebElement account_matching = ng_customer_accounts.First(acc => String.Equals(acc.Text, account_id));

            Assert.IsNotNull(account_matching);
            ngDriver.Highlight(account_matching, highlight_timeout);
        }
Beispiel #32
0
        // [TestMethod, TestCategory("Smoke")]

        //public void RegisterAccount()
        //above chnages to "LoginPage" below as a
        //result of the return at the buttom
        public LoginPage RegisterAccount()
        {
            //click on register button
            var registerButton = Driver.FindElement(By.ClassName("ico-register"));

            registerButton.Click();

            //Assert register page is displayed
            var registerPage = Driver.Title;

            Assert.AreEqual(registerPage, "nopCommerce demo store. Register");

            // click Gender
            var maleGender = Driver.FindElement(By.Id("gender-male"));

            maleGender.Click();

            //enter firstname
            var firstName = Driver.FindElement(By.Id("FirstName"));

            firstName.SendKeys("Dejo");

            //enter lastname
            var lastName = Driver.FindElement(By.Id("LastName"));

            lastName.SendKeys("Akin");

            //select day of Birth
            var dayOfBirth       = Driver.FindElement(By.Name("DateOfBirthDay"));
            var selectDayOfBirth = new SelectElement(dayOfBirth);

            selectDayOfBirth.SelectByIndex(5);//you are counting from the
            //dates

            //select Month of Birth
            var monthOfBirth       = Driver.FindElement(By.Name("DateOfBirthMonth"));
            var selectMonthOfBirth = new SelectElement(monthOfBirth);

            selectMonthOfBirth.SelectByValue("6");//use"6" bcos it is a string

            //select year of Birth
            var yearOfBirth       = Driver.FindElement(By.Name("DateOfBirthYear"));
            var selectYearOfBirth = new SelectElement(yearOfBirth);

            selectYearOfBirth.SelectByText("1980");

            //enter email
            var email = Driver.FindElement(By.Id("Email"));

            email.SendKeys("*****@*****.**");

            //tick newsletter checkbox
            var newsletterBox = Driver.FindElement(By.Id("Newsletter"));

            /**
             * This code below would be standard if the checkbox
             * for newsletter was never ticked by default
             */
            if (!newsletterBox.Selected)
            {
                newsletterBox.Click();
            }

            //enter password
            var password = Driver.FindElement(By.Id("Password"));

            password.SendKeys("welcome123");

            //confirm password
            var passwordConfirm = Driver.FindElement(By.Id("ConfirmPassword"));

            passwordConfirm.SendKeys("welcome123");

            //click register button
            var creatAccountButton = Driver.FindElement(By.Id("register-button"));

            creatAccountButton.Click();
            Thread.Sleep(3000);

            return(new LoginPage(Driver));
        }
        public void SelectSystemDevice()
        {
            SelectElement element = new SelectElement(lstSystemDropdownList);

            element.SelectByValue("25");
        }
        public static string GetSelectedDropDown(this IWebElement element)
        {
            SelectElement ddl = new SelectElement(element);

            return(ddl.AllSelectedOptions.First().ToString());
        }
Beispiel #35
0
 public void SelectElement()
 {
     select = new SelectElement(webDriver.FindElement(By.Id("country1")));
     Thread.Sleep(3000);
 }
        public static IList <IWebElement> GetSelectedListOptions(this IWebElement element)
        {
            SelectElement ddl = new SelectElement(element);

            return(ddl.AllSelectedOptions);
        }
 public void Accept(SelectElement parent)
 {
     throw new NotSupportedException("select can't have parent");
 }
        public static void SelectDropDownList(this IWebElement element, string value)
        {
            SelectElement ddl = new SelectElement(element);

            ddl.SelectByText(value);
        }
Beispiel #39
0
		bool setK(SelectElement sel, int value)
		{
			for (int i = 0; i < sel.Options.Length; i++)
			{
				OptionElement op = (OptionElement)sel.Options[i];
				if (op.Value.Substr(5, op.Value.Length - 5).ToLowerCase() == value.ToString().ToLowerCase())
				{
					op.Selected = true;
					return true;
				}
			}
			return false;
		}
Beispiel #40
0
        public static void SelectDropDown(IWebDriver driver, string Locator, string Lvalue, IWebElement elementR, SelectElement SelectR, string excelVal)
        {
            if (Locator == "Id")
            {
                driver.FindElement(By.Id(Lvalue)).Click();
            }
            else if (Locator == "XPath")
            {
                driver.FindElement(By.XPath(Lvalue)).Click();
            }
            else if (Locator == "Name")
            {
                driver.FindElement(By.Name(Lvalue)).Click();
            }
            else if (Locator == "CssSelector")
            {
                driver.FindElement(By.CssSelector(Lvalue)).Click();
            }
            else
            {
                Console.WriteLine("Invalid Locator value");
            }

            var wait = new WebDriverWait(GlobalDefinitions.driver, TimeSpan.FromSeconds(1000));

            wait.Until(dr => dr.FindElement(By.XPath(Lvalue)).Displayed);

            elementR = GlobalDefinitions.driver.FindElement(By.XPath(Lvalue));
            elementR.Click();
            SelectR = new SelectElement(elementR);
            SelectR.SelectByText(excelVal);
        }
Beispiel #41
0
		void setIndex(SelectElement sel, int index)
		{
			try
			{
				OptionElement op = index > sel.Options.Length - 1 ? (OptionElement)sel.Options[sel.Options.Length - 1] : (OptionElement)sel.Options[index];
				op.Selected = true;
			}
			catch { }
		}
Beispiel #42
0
        public static void SelectFromDropDownByValue(IWebElement element, String value)
        {
            var selectElement = new SelectElement(element);

            selectElement.SelectByValue(value);
        }
        public void selDropDown(tstObject tstObj, bool objPres, string drpName, string lstTag, string suffix, string clk, string lstItem, string chkMod,
                string modID, string resString, string stpNum, string pth, ref string[,] tstresult, out int fndExcep)
        {
            //drpName - name of the droddown
                //lstTag - the tags that contain the actual list of items in the dropdown
                //lstItem - the dropdown item being processed
                //chkMod - is dropodown in a modal window?
                //modID - modal frame id
                //pth - passed in - path to the result file
                //fndExcep - escape and  show result file if an exception is found

                IWebElement dropdownListBox;
                ReadOnlyCollection<IWebElement> lnkList;
                ReadOnlyCollection<IWebElement> lstString;
                SelectElement selection;
                int count;              //number of lst items in the dropdown
                int fndItem;
                string fndList;         //final xpath value
                string sndKey;

                //set initial value for fndExcep
                count = 0;
                fndExcep = 0;
                fndItem = 0;
                sndKey = "A";
                lnkList = null;

                try
                {
                    //2.08 -- check for the new dropdown instituted by the Virtual Academy
                    if (clk != "Std" && clk != "CT")
                    {
                        //determine if need to aswitcvh to modal window -- chkMod = 'Y'
                        if (chkMod == "Y")
                        {
                            //switch to modal frame
                            driver.SwitchTo().DefaultContent();
                            driver.SwitchTo().Frame(modID);
                            Thread.Sleep(750);
                        }

                        //look to see if the dropdown object exists
                        objPres = driver.FindElement(By.XPath(drpName)).Enabled;

                        if (clk == "Y" || drpName == "/html/body/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]/table/tbody/tr" +
                            "/td/div/form/div/div/table/tbody/tr[2]/td[2]/div/div/div/div/div/table/tbody/tr[4]/td/div/div/div/span")
                        {
                            driver.FindElement(By.XPath(drpName)).Click();
                        }

                        //Record result to result file
                        tmpString = "Searching for the " + resString + " dropdown........(" + stpNum + ")";
                        tstresult = arrayAppend(objPres.ToString(), tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);

                        //get count of items in the dropdown
                        count = driver.FindElements(By.XPath(lstTag)).Count;

                        //load all of the dropdown elements into a ReadOnly Collection of IWebElements
                        lnkList = driver.FindElements(By.XPath(lstTag));

                        //loop through the items in the list to find the item from the sheet to click
                        for (int x = 0; x < count; x++)
                        {

                            //append brackets to last tag if x > 0
                            //take lstTag var and pass as is if x = 0..no need for any brackets
                            if (x == 0)
                            {
                                fndList = lstTag;

                                //on the first pass thru, set the list to the first entry showing in the dropdown list
                                //initChar = lnkList[x].FindElement(By.XPath(fndList)).Text.Substring(0, 1);
                                //lnkList[x].FindElement(By.XPath(fndList)).SendKeys(initChar);
                            }
                            else
                            {
                                //append value based on value of x to lstTag
                                fndList = lstTag + "[" + (x).ToString() + "]";
                            }

                            //set the list by default to the first entry in the list by sernding an 'A' to the list

                            if (lnkList[x].Text == lstItem)
                            {
                                //increment one place on the list because the list of dropdown items and array list
                                //are not based the same. The array list is 0-based and the lnkList is not
                                if ((x + 1) == 1)
                                    fndList = lstTag + suffix;
                                else
                                    fndList = lstTag + "[" + (x + 1).ToString() + "]" + suffix;

                                //Record result
                                tmpString = "Found list item [" + lstItem + "]";
                                tstresult = arrayAppend(objPres.ToString(), tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);

                                //Click the selected list item
                                lnkList[x].FindElement(By.XPath(fndList)).Click();
                                fndItem = 1;

                                //Record successful action in result file
                                tmpString = "Successfully selected item [" + lstItem + "]";
                                tstresult = arrayAppend(objPres.ToString(), tmpString, "1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                                //TextFileOps.Write(pth, "Successfully selected item [" + lstItem + "]", 1);
                            }
                            else
                            {
                                switch (drpName)
                                {
                                    case "/html/body/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]/table/tbody/tr" +
                                        "/td/div/form/div/div/table/tbody/tr[2]/td[2]/div/div/div/div/div/table/tbody/tr[4]/td/div/div/div/span":

                                        if (x == 0)
                                            driver.FindElement(By.LinkText(lnkList[x].Text)).SendKeys(sndKey);
                                        else
                                        {
                                            if (sndKey != lnkList[x].Text.Substring(0, 1))
                                            {
                                                sndKey = lnkList[x].Text.Substring(0, 1);
                                                driver.FindElement(By.LinkText(lnkList[x].Text)).SendKeys(sndKey);
                                            }
                                        }

                                        break;
                                }
                            }

                            if (fndItem == 1)
                            {
                                break;
                            }
                        }

                        if (fndItem != 1)
                        {
                            //Record result
                            tmpString = "The item [" + lstItem + "] was not found";
                            tstresult = arrayAppend(objPres.ToString(), tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                        }
                    }
                    else if (clk == "Std")
                    {
                        //look to see if the dropdown object exists
                        objPres = driver.FindElement(By.XPath(drpName)).Enabled;

                        //Record result to result file
                        tmpString = "Searching for the " + resString + " dropdown........(" + stpNum + ")";
                        tstresult = arrayAppend(objPres.ToString(), tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);

                        dropdownListBox = driver.FindElement(By.XPath(drpName));
                        selection = new SelectElement(dropdownListBox);

                        //scroll through the selections in the dropdown
                        for (int x = 0; x < selection.Options.Count; x++)
                        {
                            if (selection.Options[x].Text == lstItem)
                            {
                                tmpString = "Found list item [" + lstItem + "]";
                                tstresult = arrayAppend(objPres.ToString(), tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                                fndItem = 1;
                                selection.SelectByText(lstItem);
                                break;
                            }
                        }

                        if (fndItem == 1)
                        {
                            //Record result
                            tmpString = "Successfully selected item [" + lstItem + "]";
                            tstresult = arrayAppend(objPres.ToString(), tmpString, "1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                        }
                        else
                        {
                            //Record result
                            tmpString = "The item [" + lstItem + "] was not found";
                            tstresult = arrayAppend(objPres.ToString(), tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                        }
                    }
                    else if (clk == "CT")
                    {
                        //look to see if the dropdown object exists
                        objPres = driver.FindElement(By.XPath(drpName)).Enabled;

                        //get count of items in the dropdown
                        count = driver.FindElements(By.XPath(lstTag)).Count;

                        //load all of the dropdown elements into a ReadOnly Collection of IWebElements
                        lstString = driver.FindElements(By.XPath(lstTag));

                        //lstarray = TestSuite.splitList(Convert.ToString(lstString[0].Text), ref itmCount);

                        //scroll through the array and select the appropriate checkboix if applicable
                        for (int y = 0; y < count; y++)
                        {
                            if (lstString[y].Text == lstItem)
                            {
                                if (y == 0)
                                {
                                    fndItem = 1;

                                    tmpString = "Found list item [" + lstItem + "]";
                                    tstresult = arrayAppend(objPres.ToString(), tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);

                                    //drop the list
                                    driver.FindElement(By.XPath(drpName)).Click();

                                    //select  the matching item
                                    driver.FindElement(By.XPath(lstTag + suffix + "/input")).Click();

                                    //click the dropdown again to close
                                    driver.FindElement(By.XPath(drpName)).Click();

                                    //Record result
                                    tmpString = "Successfully selected item [" + lstItem + "]";
                                    tstresult = arrayAppend(objPres.ToString(), tmpString, "1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                                }
                                else
                                {
                                    fndItem = 1;

                                    tmpString = "Found list item [" + lstItem + "]";
                                    tstresult = arrayAppend(objPres.ToString(), tmpString, "80", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);

                                    //drop the list
                                    driver.FindElement(By.XPath(drpName)).Click();

                                    //select  the matching item
                                    driver.FindElement(By.XPath(lstTag + "[" + (y + 1).ToString() + "]")).Click();

                                    //click the dropdown again to close
                                    driver.FindElement(By.XPath(drpName)).Click();

                                    //Record result
                                    tmpString = "Successfully selected item [" + lstItem + "]";
                                    tstresult = arrayAppend(objPres.ToString(), tmpString, "1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                                }
                            }
                        }

                        //record a failure if nothing is clicked is found
                        if (fndItem != 1)
                        {
                            //Record result
                            tmpString = "The item [" + lstItem + "] was not found";
                            tstresult = arrayAppend(objPres.ToString(), tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);
                        }
                    }
                }
                catch (Exception e)
                {
                    //Record failed result
                    tmpString = "Failed clicking the dropdown list box: " + e.Message;
                    tstresult = arrayAppend(objPres.ToString(), tmpString, "-1", String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, String.Empty, tstresult);

                    //Record exception and begin exit process
                    fndExcep = -1;
                }

                if (chkMod == "Y")
                {
                    //Switch back to original frame from modal
                    driver.SwitchTo().DefaultContent();
                    Thread.Sleep(750);
                }
        }
Beispiel #44
0
        public static void SelectFromDropDownByText(IWebElement element, String text)
        {
            var selectElement = new SelectElement(element);

            selectElement.SelectByText(text);
        }
Beispiel #45
0
            public void Step2()
            {
                var d = new Data.Data.AccountOwner();
                var SalutationDropdownSelect = new SelectElement(SalutationDropdown);
                var DOBYearDropdownSelect = new SelectElement(DobYearDropdown);
                var DOBMonthDropdownSelect = new SelectElement(DobMonthDropdown);
                var DOBDayDropdownSelect = new SelectElement(DobDayDropdown);
                var StateDropdownSelect = new SelectElement(StateDropDown);

                SalutationDropdownSelect.SelectByText(d.Salutation);
                FirstNameField.SendKeys(d.FirstName);
                LastNameField.SendKeys(d.LastName);
                SSNField.SendKeys(d.SSN);
                DOBYearDropdownSelect.SelectByText(d.Year);
                DOBMonthDropdownSelect.SelectByText(d.Month);
                DOBDayDropdownSelect.SelectByText(d.Day);
                Address1Field.SendKeys(d.Address1);
                CityField.SendKeys(d.City);
                StateDropdownSelect.SelectByText(d.State);
                ZipCodeField.SendKeys(d.Zip);
                PhoneNumberField.SendKeys(d.PhoneNum);
                CellRadio.Click();
                NextButton.Click();
            }
Beispiel #46
0
        public static void SelectElement(By Locator, int index)
        {
            SelectElement select = new SelectElement(GenericHelper.GetWebElement(Locator));

            select.SelectByIndex(index);
        }
Beispiel #47
0
		private void CopyValuesFromSelectListToArray(SelectElement el, OptionElement[] options)
		{
			for (int i = 0; i < el.Options.Length; i++)
			{
				options[options.Length] = (OptionElement) el.Options[i];
			}
		}
 public static void SelectText(this SelectElement control, string textValue)
 {
     control.SelectByText(textValue);
 }
Beispiel #49
0
		private static void ClearSelect(SelectElement el)
		{
			while (el.Options.Length > 0)
			{
				el.RemoveChild(el.Options[el.Options.Length - 1]);
			}
		}
 public override void PostExecute()
 {
     IEXGateway._IEXResult res;
     //Setting the Device pin back to true
     res = CL.EA.STBSettings.ChangePinCode(Constants.newPIN, defaultPin);
     if (!res.CommandSucceeded)
     {
         try
         {
             LogCommentFailure(CL, "Failed to verify that the change pin codeis not reverted back to the default value");
             string boxID = CL.EA.UI.Utils.GetValueFromEnvironment("BOX_ID").ToString();
             if (boxID == "")
             {
                 LogCommentFailure(CL, "Failed to get the BOX_ID from Environment ini");
             }
             else
             {
                 LogCommentImportant(CL, "Box ID fetched from Environment ini file is " + boxID);
             }
             string remotePSURL = CL.EA.UI.Utils.GetValueFromEnvironment("RemotePSServerURL").ToString();
             if (remotePSURL == "")
             {
                 LogCommentFailure(CL, "Failed to get the RemotePSServerURL from Environment ini");
             }
             else
             {
                 LogCommentImportant(CL, "RemotePSServerURL fetched from Environment ini file is " + remotePSURL);
             }
             FirefoxDriver driver = new FirefoxDriver();
             driver.Navigate().GoToUrl(remotePSURL);
             LogCommentImportant(CL, "Navigating to the Remote PS server which is 10.201.96.19");
             driver.Manage().Window.Maximize();
             driver.FindElement(By.Id("element_1")).Click();
             driver.FindElement(By.Id("element_1")).Clear();
             driver.FindElement(By.Id("element_1")).SendKeys(boxID);
             LogCommentImportant(CL, "Entering the BOX ID");
             CL.IEX.Wait(2);
             LogCommentImportant(CL, "Selecting the API in this case Reset MPIN");
             SelectElement APIselector = new SelectElement(driver.FindElementById("element_2"));
             APIselector.SelectByIndex(3);
             CL.IEX.Wait(2);
             LogCommentImportant(CL, "Selecting the Preferred Language which is en");
             SelectElement Languageselector = new SelectElement(driver.FindElementById("language"));
             Languageselector.SelectByValue("en");
             CL.IEX.Wait(2);
             LogCommentImportant(CL, "Selecting the LAB which is UM");
             SelectElement Labselector = new SelectElement(driver.FindElementById("lab"));
             Labselector.SelectByIndex(3);
             CL.IEX.Wait(5);
             driver.FindElementById("submit_form").Click();
             CL.IEX.Wait(10);
             driver.Quit();
         }
         catch (Exception ex)
         {
             LogCommentFailure(CL, "Failed to reset the Pin from Remote PS server. Reason :" + ex.Message);
             CL.IEX.Wait(10);
             driver.Quit();
         }
     }
     CL.IEX.Wait(10);
     CL.EA.UI.Utils.SendIR("MENU");
     CL.IEX.Wait(3);
     CL.EA.UI.Utils.SendIR("RETOUR");
     CL.IEX.Wait(2);
     CL.EA.UI.Utils.SendIR("MENU");
     CL.IEX.Wait(20);
     //Setting the Channel bar display timout to default
     //string defaultChannelBarTimeOut = CL.EA.GetValueFromINI(EnumINIFile.Project, "CHANNEL_BAR_TIMEOUT", "DEFAULT");
     //if (string.IsNullOrEmpty(defaultChannelBarTimeOut))
     //{
     //    LogCommentFailure(CL, "CHANNEL_BAR_TIMEOUT, DEFAULT fetched from Project.ini is null or empty");
     //}
     //EnumChannelBarTimeout defaultChannelBarTimeOutVal;
     //Enum.TryParse<EnumChannelBarTimeout>(defaultChannelBarTimeOut, out defaultChannelBarTimeOutVal);
     //res = CL.EA.STBSettings.SetBannerDisplayTime(defaultChannelBarTimeOutVal);
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL, "Failed to set the Banner Display timeout to 5");
     //}
     ////Setting the Parental control age limit to default
     //string defaultPCAgeLimit = CL.EA.GetValueFromINI(EnumINIFile.Project, "PARENTAL_CONTROL_AGE_LIMIT", "DEFAULT");
     //EnumParentalControlAge EnumParentalControlAgeValue;
     //Enum.TryParse<EnumParentalControlAge>(defaultPCAgeLimit, out EnumParentalControlAgeValue);
     //res = CL.EA.STBSettings.SetParentalControlAgeLimit(EnumParentalControlAgeValue);
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL, "Failed to set the Parental control Age limit to Default");
     //}
     ////Setting the start Guard time to default
     //string DefaultSGTValue = CL.EA.GetValueFromINI(EnumINIFile.Project, "SGT", "DEFAULT");
     //res = CL.EA.STBSettings.SetGuardTime(true, DefaultSGTValue);
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL,"Failed to set the Guard time to true");
     //}
     ////Setting the Disk Space ManageMent to the Default value
     //res = CL.IEX.MilestonesEPG.NavigateByName("STATE:DISK SPACE MANAGEMENT");
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL, "Failed to navigate to STATE:DISK SPACE MANAGEMENT");
     //}
     //CL.IEX.Wait(2);
     //string DefaultDiskSpaceManagement = CL.EA.GetValueFromINI(EnumINIFile.Project, "DISK_SPACE_MANAGEMENT", "DEFAULT");
     //res= CL.IEX.MilestonesEPG.Navigate(DefaultDiskSpaceManagement);
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL,"Failed to set the Disk space management to Default value");
     //}
     ////Setting the Series recording to the Default value
     //res = CL.IEX.MilestonesEPG.NavigateByName("STATE:SERIES RECORDING");
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL, "Failed to navigate to STATE:SERIES RECORDING");
     //}
     //CL.IEX.Wait(2);
     //string DefaultSeriesRecordingValue = CL.EA.GetValueFromINI(EnumINIFile.Project, "SERIES_RECORDING", "DEFAULT");
     //res = CL.IEX.MilestonesEPG.Navigate(DefaultSeriesRecordingValue);
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL, "Failed to set the SeriesRecordingValue to Default value");
     //}
     ////Unlocking the locked service
     //res = CL.EA.STBSettings.SetUnLockChannel(Service_5.Name);
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL, "Failed to lock the service");
     //}
     ////Unsetting all the Favourites and setting few services as favourites
     //res = CL.EA.STBSettings.UnsetAllFavChannels();
     //if (!res.CommandSucceeded)
     //{
     //    LogCommentFailure(CL, "Failed to unset all the services from the Favourite");
     //}
     //Deleting all the recordings
     res = CL.EA.PVR.DeleteAllRecordsFromArchive();
     if (!res.CommandSucceeded)
     {
         LogCommentFailure(CL, "Failed to delete all records from Archive");
     }
     //Cancelling all bookings from planner
     res = CL.EA.PVR.CancelAllBookingsFromPlanner();
     if (!res.CommandSucceeded)
     {
         LogCommentFailure(CL, "Failed to cancel all bookings from planner");
     }
     res = CL.EA.STBSettings.FactoryReset(SaveRecordings: false, KeepCurrentSettings: false, PinCode: defaultPin);
     if (!res.CommandSucceeded)
     {
         LogCommentInfo(CL, "Failed to do the Factory reset");
     }
     CL.IEX.Wait(60);
 }
 public override void ExplicitVisit(SelectElement fragment)
 {
     _fragments.Add(fragment);
 }
 public void Action_SelectOptionByValue(string value)
 {
     SelectElement selectedElementObj = new SelectElement(_selectedElementItem.refElement);
     if (selectedElementObj != null)
         selectedElementObj.SelectByValue(value);
 }
        internal async Task DataGift(
            string donorTelephone,
            string recipientTelephone,
            int mbToGift)
        {
            var from = CleanNumber(donorTelephone ?? throw new ArgumentNullException(nameof(donorTelephone)));
            var to   = CleanNumber(recipientTelephone ?? throw new ArgumentNullException(nameof(recipientTelephone)));

            using IWebDriver driver = string.IsNullOrWhiteSpace(_driverPath)
                ? new ChromeDriver()
                : new ChromeDriver(ChromeDriverService.CreateDefaultService(_driverPath));

            try
            {
                driver.Url = "https://id.ee.co.uk/id/login";

                await Task.Delay(5000);

                // Cookie warning popup
                foreach (var btn in driver.FindElements(By.TagName("button")))
                {
                    if (btn.Text.Contains("accept", StringComparison.OrdinalIgnoreCase))
                    {
                        btn.Click();
                    }
                }
                await Task.Delay(50);

                // complete login
                driver.FindElement(By.Name("username")).SendKeys(_username);
                await Task.Delay(500);

                driver.FindElement(By.Name("password")).SendKeys(_password);
                await Task.Delay(500);

                driver.FindElement(By.Name("submitButton")).Click();
                await Task.Delay(3000);

                // navigate to family gifting page.
                driver.Navigate().GoToUrl("https://myaccount.ee.co.uk/app/family-gifting");
                await Task.Delay(3000);

                SelectElement selectDonor     = null;
                SelectElement selectRecipient = null;

                // find both drop downs for donor and recepient phone numbers.
                var selects = driver.FindElements(By.TagName("select"));
                foreach (var sel in selects)
                {
                    if (sel.GetAttribute("form")?.Contains("giftDataForm", StringComparison.OrdinalIgnoreCase) == true)
                    {
                        if (sel.GetAttribute("id")?.Contains("donor", StringComparison.OrdinalIgnoreCase) == true)
                        {
                            selectDonor = new SelectElement(sel);
                        }
                        else if (sel.GetAttribute("id")?.Contains("recipient", StringComparison.OrdinalIgnoreCase) == true)
                        {
                            selectRecipient = new SelectElement(sel);
                        }
                    }
                }

                if (selectDonor == null || selectRecipient == null)
                {
                    throw new Exception("Couldn't find donor and recipient <select> dropdown elements");
                }

                IWebElement form            = null;
                IWebElement mbLabel         = null;
                IWebElement incrementButton = null;
                IWebElement giftButton      = null;

                // These take a while to populate so keep trying...
                const int maxAttempts = 10;
                var       attempts    = 0;
                while (true)
                {
                    try
                    {
                        // Select the donor in the donor drop down
                        foreach (var opt in selectDonor.Options)
                        {
                            if (CleanNumber(opt.Text).Contains(from, StringComparison.OrdinalIgnoreCase))
                            {
                                selectDonor.SelectByText(opt.Text);
                                break;
                            }
                        }
                        await Task.Delay(50);

                        // Select the recepient in the recepient drop down
                        foreach (var opt in selectRecipient.Options)
                        {
                            if (CleanNumber(opt.Text).Contains(to, StringComparison.OrdinalIgnoreCase))
                            {
                                selectRecipient.SelectByText(opt.Text);
                                break;
                            }
                        }
                        await Task.Delay(75);


                        // locate the entire giftDataForm
                        form = driver
                               .FindElement(By.Id("giftDataForm"));

                        // Search for the amount (MB/GB) display span
                        mbLabel = form.FindElements(By.TagName("span"))
                                  .Single(s => s.GetAttribute("class")?.Contains("giftingDisplayAmount", StringComparison.OrdinalIgnoreCase) == true);

                        // Search for the increment button
                        incrementButton = form.FindElements(By.TagName("button"))
                                          .Single(s => s.GetAttribute("class")?.Contains("ee-icon-plus", StringComparison.OrdinalIgnoreCase) == true);

                        // Now find and click the "Gift" button
                        giftButton = form.FindElements(By.TagName("button"))
                                     .Single(s => s.GetAttribute("class")?.Contains("gift", StringComparison.OrdinalIgnoreCase) == true &&
                                             s.Text?.Contains("gift", StringComparison.OrdinalIgnoreCase) == true);

                        break;
                    }
                    catch
                    {
                        if (attempts++ > maxAttempts)
                        {
                            throw;
                        }
                        else
                        {
                            await Task.Delay(1000);
                        }
                    }
                }

                // While the display shows less than we want to gift, click the increment button
                var currentGift = ParseMegabytes(mbLabel.Text);
                while (currentGift < mbToGift)
                {
                    incrementButton.Click();
                    await Task.Delay(50);

                    currentGift = ParseMegabytes(mbLabel.Text);
                }

                Console.WriteLine($"Gifting {currentGift}MB from 0{from} to 0{to}.");

                giftButton.Click();

                await Task.Delay(50);

                // Now find and click the "Yes" confirmation button
                var confirmButton = form.FindElements(By.TagName("button"))
                                    .Single(s => s.GetAttribute("type")?.Contains("submit", StringComparison.OrdinalIgnoreCase) == true &&
                                            s.Text?.Contains("yes", StringComparison.OrdinalIgnoreCase) == true);

                confirmButton.Click();

                Console.WriteLine($"Gifted {currentGift}MB from 0{from} to 0{to}.");

                await Task.Delay(2000);
            }
            finally
            {
                await Task.Delay(500);

                driver.Quit();
            }

            decimal ParseMegabytes(string text)
            {
                if (text.Contains("MB"))
                {
                    return(decimal.Parse(text.Replace("MB", "").Trim()));
                }
                else if (text.Contains("GB"))
                {
                    return(decimal.Parse(text.Replace("GB", "").Trim()) * 1000);
                }

                throw new InvalidOperationException($"Cannot parse text {text}");
            }

            string CleanNumber(string num)
            => num?.Replace(" ", "")?.TrimStart('0');
        }
Beispiel #54
0
		string getValue(SelectElement sel)
		{
			return sel.SelectedIndex == -1 ? "" : ((OptionElement)sel.Options[sel.SelectedIndex]).Value;
		}
 public void Action_SelectOptionByText(string text)
 {
     SelectElement selectedElementObj = new SelectElement(_selectedElementItem.refElement);
     if(selectedElementObj!=null)
         selectedElementObj.SelectByText(text);
 }
        public void Case3621()
        {
            utilities.ConsoleMessageStart();
            utilities.extenttest = utilities.extent.StartTest("TFS Case 3620 Resource notes not displaying on My bookings page");
            utilities.extenttest.AssignCategory("Case 3620. Resource notes not showing on my bookings page.");
            webappLogin.NavigateTo();
            webappLogin.LogInSuccess();  //WebApp Login
            Thread.Sleep(4000);
            admin.AccessAdminModule();   //Access Admin Module
            admin.AccessSettings();      //Access Settings Tab
            admin.StatusLink();          //Click on Status Link
            webappStatus.AddNewStatus(); //Creating New Status
            string statusName = webappStatus.StatusName;

            Console.WriteLine(statusName);

            Thread.Sleep(2000);

            //Open New Tab in the Same window and continue on the new Window.
            ((IJavaScriptExecutor)driver).ExecuteScript("window.open();");
            driver.SwitchTo().Window(driver.WindowHandles.Last());

            Thread.Sleep(2000);
            login.NavigateTo();                 //Navigate to QB
            login.LoginSuccess();               //Login to QB
            Thread.Sleep(4000);
            homepage.SelectResource();          //Selecting a Resource
            login.Wait();
            attendees.AddingInternalAttendee(); //Adding Internal Attendee
            Thread.Sleep(2000);
            homepage.NextButton();              //Go to next Page
            Thread.Sleep(2000);
            booking.BookingTitle();
            var refnumber = this.driver.FindElement(By.XPath("//*[@id='page-wrap']/section[2]/div[1]/div/div[3]/span")).Text;

            Console.WriteLine(refnumber);
            Thread.Sleep(3000);

            driver.SwitchTo().Window(driver.WindowHandles.First());

            Thread.Sleep(2000);
            webAppBookingsMain.AccessBookingSearchLink();

            Thread.Sleep(2000);
            this.BookingSearchRefMap.BookingRefNumber.SendKeys(refnumber);

            this.BookingSearchRefMap.BookingSearchSearchButton.Click();


            this.BookingSearchRefMap.BookingLinkWhenSearchByRefNumber.Click();

            SelectElement select = new SelectElement(this.BookingSummaryRefMap.BookingStatusDropdown);

            select.SelectByText(statusName);
            Thread.Sleep(2000);

            this.BookingSummaryRefMap.SaveButton.Click();
            webAppBookingSummaryMain.AcceptSaveBookingPopUP();

            driver.SwitchTo().Window(driver.WindowHandles.Last());

            mybookings.MyBookingsSelect();
            Thread.Sleep(3000);


            utilities.DBConnect("SELECT BookingID, StartTime FROM [Booking] where ReferenceNumber = '" + refnumber + "'");
            Thread.Sleep(2000);
            string D1 = utilities.data[0];
            string D2 = utilities.data[1];


            Console.WriteLine("D1: " + D1);
            Console.WriteLine("D2 : " + D2);

            //Pasing the date value in Text box
            IWebElement         element = driver.FindElement(By.CssSelector(".mybooking-calendar .text-box"));
            IJavaScriptExecutor jse     = (IJavaScriptExecutor)driver;

            jse.ExecuteScript("arguments[0].value='" + D2 + "';", element);

            driver.FindElement(By.CssSelector(".mybooking-calendar .text-box")).SendKeys(Keys.Enter);

            Thread.Sleep(2000);

            this.driver.FindElement(By.XPath("//*[@id='page-wrap']/section[3]/span[1]")).Click();

            Thread.Sleep(2000);
        }
Beispiel #57
0
        /// <summary>
        /// Operate on any object inside the table in Admin
        /// </summary>
        /// Author: Anand
        /// <param name="adminBrowser">browser object</param>
        /// <param name="tableHeading">Table Heading</param>
        /// <param name="searchText">row string to be searched</param>
        /// <param name="objName">Object Type you wanted to operate on</param>
        /// <param name="objValue">Any value you would want to enter or select</param>
        /// <param name="index">column number</param>
        /// <returns> true/false</returns>
        /// ex: AdminTableObjects(adminBrowser, "Reward Adhoc token", "Username", "Text Box", custName, 1)
        /// Created Date: 07-June-2012
        public bool AdminTableObjects(ISelenium adminBrowser, string tableHeading, string searchText, string objName, string objValue, int index)
        {
            try
            {
                bool retVal = false;

                //Handling the link or button in the table
                if (objName.Contains("Link") || objName.Contains("Button"))
                {
                    retVal = AdminTableButtonLink(adminBrowser, tableHeading, searchText, objName, objValue, 0);
                    return retVal;
                }
                //Creating driver object
                IWebDriver driver = ((WebDriverBackedSelenium)adminBrowser).UnderlyingWebDriver;
                //finding all the rows in the desired table
                ReadOnlyCollection<IWebElement> tableRows = driver.FindElements(By.XPath("//table//th[contains(text(),'" + tableHeading + "')]//ancestor::table/tbody/tr"));

                //looping through a particular row
                for (int rowNum = 0; rowNum < tableRows.Count; rowNum++)
                {
                    if (tableRows[rowNum].Text.IndexOf(searchText) == 0)
                    {
                        ReadOnlyCollection<IWebElement> tdS = tableRows[rowNum].FindElements(By.TagName("td"));
                        switch (objName)
                        {
                            case "Text Box":
                                ReadOnlyCollection<IWebElement> txtBox = tdS[index].FindElements(By.TagName("input"));
                                txtBox[0].SendKeys(objValue);
                                retVal = true;
                                break;
                            case "Select Box":
                                ReadOnlyCollection<IWebElement> listBox = tdS[index].FindElements(By.TagName("select"));
                                var selectElement = new SelectElement(listBox[0]);
                                selectElement.SelectByText(objValue);
                                retVal = true;
                                break;
                        }
                        Thread.Sleep(2000);
                    }
                    //if the required functionality is done exit the action
                    if (retVal)
                    {
                        return true;
                    }
                }
                return true;
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
                return false;
            }
        }
        public void ThenEnterRequiredInformationIfNeedToChange()
        {
            //Enter No. of Lay
            driver.FindElement(By.Id("txtNoOfLay")).Clear();
            driver.FindElement(By.Id("txtNoOfLay")).SendKeys("5");
            Thread.Sleep(1000);

            //Enter Table No
            driver.FindElement(By.Id("txtTableNo")).Clear();
            driver.FindElement(By.Id("txtTableNo")).SendKeys("2");
            Thread.Sleep(1000);

            //Select Order Code
            SelectElement select = new SelectElement(driver.FindElement(By.Id("ddlOrderCode")));

            select.SelectByText("B0027761");
            Thread.Sleep(1000);

            //Select Color NAVY
            SelectElement select1 = new SelectElement(driver.FindElement(By.Id("ddlColor")));

            select1.SelectByText("Navy");
            Thread.Sleep(1000);
            //Click Add Button
            driver.FindElement(By.Id("btnAdd")).Click();
            Thread.Sleep(1000);

            //Select Color BLACK
            SelectElement select2 = new SelectElement(driver.FindElement(By.Id("ddlColor")));

            select2.SelectByText("Black");
            Thread.Sleep(1000);
            //Click Add Button
            driver.FindElement(By.Id("btnAdd")).Click();
            Thread.Sleep(1000);

            //Select Color Mid Heather Grey
            SelectElement select3 = new SelectElement(driver.FindElement(By.Id("ddlColor")));

            select3.SelectByText("Mid Heather Grey");
            Thread.Sleep(1000);
            //Click Add Button
            driver.FindElement(By.Id("btnAdd")).Click();
            Thread.Sleep(1000);

            //Select Color WHITE
            SelectElement select4 = new SelectElement(driver.FindElement(By.Id("ddlColor")));

            select4.SelectByText("White");
            Thread.Sleep(1000);
            //Click Add Button
            driver.FindElement(By.Id("btnAdd")).Click();
            Thread.Sleep(1000);

            //Enter 1st Grid Information
            //Enter Marker Ratio
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtMarkerRatio0")).Clear();
            driver.FindElement(By.Id("txtMarkerRatio0")).SendKeys("5");
            //Enter QC Pass Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtQcPass0")).Clear();
            driver.FindElement(By.Id("txtQcPass0")).SendKeys("5");
            //Enter Reject Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectQty0")).Clear();
            driver.FindElement(By.Id("txtRejectQty0")).SendKeys("5");
            //Enter Reject Note
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectNote0")).Clear();
            driver.FindElement(By.Id("txtRejectNote0")).SendKeys("Reject Quantity for Testing EDIT Purpose");
            Thread.Sleep(1000);

            //Enter 2nd Grid Information
            //Enter Marker Ratio
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtMarkerRatio7")).Clear();
            driver.FindElement(By.Id("txtMarkerRatio7")).SendKeys("5");
            //Enter QC Pass Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtQcPass7")).Clear();
            driver.FindElement(By.Id("txtQcPass7")).SendKeys("5");
            //Enter Reject Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectQty7")).Clear();
            driver.FindElement(By.Id("txtRejectQty7")).SendKeys("5");
            //Enter Reject Note
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectNote7")).Clear();
            driver.FindElement(By.Id("txtRejectNote7")).SendKeys("Reject Quantity for Testing EDIT Purpose");
            Thread.Sleep(1000);

            //Enter 3rd Grid Information
            //Enter Marker Ratio
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtMarkerRatio8")).Clear();
            driver.FindElement(By.Id("txtMarkerRatio8")).SendKeys("5");
            //Enter QC Pass Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtQcPass8")).Clear();
            driver.FindElement(By.Id("txtQcPass8")).SendKeys("5");
            //Enter Reject Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectQty8")).Clear();
            driver.FindElement(By.Id("txtRejectQty8")).SendKeys("5");
            //Enter Reject Note
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectNote8")).Clear();
            driver.FindElement(By.Id("txtRejectNote8")).SendKeys("Reject Quantity for Testing EDIT Purpose");
            Thread.Sleep(1000);

            //Enter 4th Grid Information
            //Enter Marker Ratio
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtMarkerRatio9")).Clear();
            driver.FindElement(By.Id("txtMarkerRatio9")).SendKeys("5");
            //Enter QC Pass Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtQcPass9")).Clear();
            driver.FindElement(By.Id("txtQcPass9")).SendKeys("5");
            //Enter Reject Quantity
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectQty9")).Clear();
            driver.FindElement(By.Id("txtRejectQty9")).SendKeys("5");
            //Enter Reject Note
            Thread.Sleep(1000);
            driver.FindElement(By.Id("txtRejectNote9")).Clear();
            driver.FindElement(By.Id("txtRejectNote9")).SendKeys("Reject Quantity for Testing EDIT Purpose");
            Thread.Sleep(1000);
        }
Beispiel #59
0
        private WSelectElement ParseSelectElement(SelectElement sel)
        {
            if (sel == null)
            {
                return null;
            }

            switch (sel.GetType().Name)
            {
                case "SelectScalarExpression":
                    {
                        var sse = sel as SelectScalarExpression;
                        var pScalarExpr = new WSelectScalarExpression
                        {
                            SelectExpr = ParseScalarExpression(sse.Expression),
                            FirstTokenIndex = sse.FirstTokenIndex,
                            LastTokenIndex = sse.LastTokenIndex
                        };
                        if (sse.ColumnName != null)
                        {
                            pScalarExpr.ColumnName = sse.ColumnName.Value;
                        }

                        return pScalarExpr;
                    }
                case "SelectStarExpression":
                    {
                        var sse = sel as SelectStarExpression;
                        return new WSelectStarExpression()
                        {
                            FirstTokenIndex = sse.FirstTokenIndex,
                            LastTokenIndex = sse.LastTokenIndex,
                            Qulifier = ParseMultiPartIdentifier(sse.Qualifier)
                        };
                    }
                case "SelectSetVariable":
                    {
                        var ssv = sel as SelectSetVariable;
                        return new WSelectSetVariable
                        {
                            VariableName = ssv.Variable.Name,
                            Expression = ParseScalarExpression(ssv.Expression),
                            AssignmentType = ssv.AssignmentKind,
                            FirstTokenIndex = ssv.FirstTokenIndex,
                            LastTokenIndex = ssv.LastTokenIndex
                        };
                    }
                default:
                    {
                        return null;
                    }
            }
        }
Beispiel #60
0
        internal static HtmlElement CreateFor(XElement element)
        {
            HtmlElement result = null;

            switch (element.Name.LocalName.ToLower())
            {
            case "form":
                result = new FormElement(element);
                break;

            case "input":
                string type = element.GetAttribute("type") ?? "";
                switch (type.ToLower())
                {
                case "radio":
                    result = new RadioInputElement(element);
                    break;

                case "checkbox":
                    result = new CheckboxInputElement(element);
                    break;

                case "image":
                    result = new ImageInputElement(element);
                    break;

                case "submit":
                case "button":
                case "reset":
                    result = new ButtonInputElement(element);
                    break;

                case "file":
                    result = new FileUploadElement(element);
                    break;

                default:
                    result = new InputElement(element);
                    break;
                }
                break;

            case "textarea":
                result = new TextAreaElement(element);
                break;

            case "select":
                result = new SelectElement(element);
                break;

            case "option":
                result = new OptionElement(element);
                break;

            case "iframe":
            case "frame":
                var src = element.GetAttributeCI("src");
                if (!string.IsNullOrWhiteSpace(src))
                {
                    result = new FrameElement(element);
                }
                else
                {
                    result = default(HtmlElement);
                }
                break;

            case "a":
                result = new AnchorElement(element);
                break;

            case "label":
                result = new LabelElement(element);
                break;

            case "button":
                result = new ButtonInputElement(element);
                break;

            default:
                result = new HtmlElement(element);
                break;
            }
            return(result);
        }