Beispiel #1
0
        public void Enter_MakeCode(string MakeCode)
        {
            Actual_MakeCode = MakeCode;
            int ColNo = GetTable_ColNo("Make Code");

            CellXpath = "((//table)[2]/tbody/tr/td[" + ColNo + "])[" + EditableRowNo_ApplyMakeCode + "]";

            BrowserFactory.Driver.FindElement(By.XPath(CellXpath)).WebClick();     //Clicking the Next Column data of same disabled row
            IWebElement ColumnInput = BrowserFactory.Driver.FindElement(By.XPath(CellXpath + "//*[contains(@class, 'ui-inputtext ui-widget')]"));

            ColumnInput.WebClick();
            ColumnInput.EnterText(MakeCode);

            IList <IWebElement> ListMakeCode = BrowserFactory.Driver.FindElements(By.XPath(CellXpath + "//*[contains(@class, 'ui-inputtext ui-widget')]//following::ul/li"));

            foreach (var Ele in ListMakeCode)
            {
                string text = Ele.GetText();
                if (text.Contains(MakeCode))
                {
                    Ele.WebClick();
                    FlagDealer = true;
                    break;
                }
            }
            if (FlagDealer == false)
            {
                Assert.Fail("Make  is not available");
            }
        }
Beispiel #2
0
        public void Enter_Dealer(string Dealer)
        {
            Actual_Dealer = Dealer;
            if (Disabled_Cell == false)
            {
                IWebElement ColumnInput = BrowserFactory.Driver.FindElement(By.XPath(CellXpath + "//*[contains(@class, 'ui-inputtext ui-widget')]"));
                ColumnInput.EnterText(Dealer);

                IList <IWebElement> ListDealer = BrowserFactory.Driver.FindElements(By.XPath(CellXpath + "//*[contains(@class, 'ui-inputtext ui-widget')]//following::ul/li"));

                foreach (var Ele in ListDealer)
                {
                    string text = Ele.GetText();
                    if (text.Contains(Dealer))
                    {
                        Ele.WebClick();
                        System.Threading.Thread.Sleep(2000);
                        FlagDealer = true;
                        break;
                    }
                }
                if (FlagDealer == false)
                {
                    Assert.Fail("Dealer is not available");
                }
            }
            else
            {
                Assert.Fail("All the asset are registered");
            }
        }
        //public enum columnnnumber
        //{
        //    Manufacture_Desc = 1,
        //    Dealer =2,
        //    Business_Unit = 3,
        //    Make_Code = 2,
        //    Asset_ID = 2,
        //    Asset_Model = 3,
        //    Model_Year =4,
        //    Asset_VIN =5

        //}
        //public int Columnno(string ColumnName)
        //{
        //   // int ColumnNo = (int)columnnnumber.Manufacture_Desc;
        //    int ColumnNo = (int)columnnnumber.Asset_ID;
        //    return ColumnNo;
        //}
        public void FilterAndVerify2ndPage(string ColumnName, string FilterText)

        {
            bool FlagFilter = false;

            ColumnName = "Make Code";
            FilterText = "TOY";
            //get column no from column name -2
            ColumnNo = 2;
            IWebElement         Txtbox_Srchfilter = BrowserFactory.Driver.FindElement(By.XPath("(//label[text()= 'Filter']//following::input[@type = 'text'][1])" + "[" + ColumnNo + "]"));
            IList <IWebElement> ListFIlter        = BrowserFactory.Driver.FindElements(By.XPath("(//div[contains(@class,'ui-multiselect-items')])[" + ColumnNo + "]/ul/li"));
            IWebElement         BtnClosefilter    = BrowserFactory.Driver.FindElement(By.XPath("(//a[contains(@class,'ui-multiselect-close')])" + "[" + ColumnNo + "]"));

            switch (ColumnName)
            {
            case "Manufacture Desc":
                EleFilter_ManufactureDesc.WebClick();
                break;

            case "Dealer":
                EleFilter_Dealer.WebClick();
                break;

            case "Business Unit":
                EleFilter_BusinessUnit.WebClick();
                break;

            case "Make Code":
                EleFilter_MakeCode.WebClick();
                break;

            case "Asset ID":
                EleFilter_AssetID.WebClick();
                break;

            case "Asset Model":
                EleFilter_AssetModel.WebClick();
                break;

            case "Model Year":
                EleFilter_ModelYear.WebClick();
                break;

            case "Asset VIN":
                EleFilter_AssetVIN.WebClick();
                break;

            default:
                break;
            }
            Txtbox_Srchfilter.EnterText(FilterText);
            System.Threading.Thread.Sleep(2000);
            foreach (var Ele in ListFIlter)
            {
                string text = Ele.GetText();
                if (text.Contains(FilterText))
                {
                    Ele.WebClick();
                    FlagFilter = true;
                    break;
                }
            }
            if (FlagFilter == false)
            {
                Assert.Fail("Filter Text is not available");
            }
            System.Threading.Thread.Sleep(1000);
            BtnClosefilter.WebClick();
        }