Exemplo n.º 1
0
        private IWebElement SearchOrder(string Id = "", string CompanyName = "")
        {
            var  Filter   = OrderFilterParent.FindElements(By.TagName("input"));
            bool Filtered = false;

            if (Id == "" && CompanyName == "")
            {
                throw new Exception("Atlest one Paramitter must be Given to Search Order");
            }
            if (Id != "" && Filter[0].Text != Id)
            {
                Filtered = true;
                Filter[0].Clear();
                Filter[0].SendKeys(Id);
            }
            if (CompanyName != "" && Filter[1].Text != CompanyName)
            {
                Filtered = true;
                Filter[1].Clear();
                Filter[1].SendKeys(CompanyName);
            }
            if (Filtered)
            {
                Wait.AM_Loaging_ShowAndHide_WithWait(2);
            }
            var ResultList = OrderResultGridParent.FindElements(By.TagName("tr"));

            //for (var count = 0; count < ResultList.Count - 1; count++) {
            //if(ResultList[count].FindElements(By.TagName("td")))
            //}
            var ResultOrder = ResultList.FirstOrDefault(e => e.FindElements(By.TagName("td"))[1].Text == Id || e.FindElements(By.TagName("td"))[2].Text == CompanyName);

            return(ResultOrder);
        }