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); }
internal void SetFutureYearFilter() { Select.ByText(FilterYearDD, (DateTime.Now.Year + 1).ToString()); Wait.AM_Loaging_ShowAndHide(); if (OrderResultGridParent.FindElements(By.TagName("tr"))[0].FindElement(By.TagName("input")).Enabled) { Select.ByText(FilterYearDD, DateTime.Now.Year.ToString()); Wait.AM_Loaging_ShowAndHide(); throw new Exception("Check box is Enabled for future year."); } Select.ByText(FilterYearDD, DateTime.Now.Year.ToString()); Wait.AM_Loaging_ShowAndHide(); }