public Boolean GetTradeStatusForSearchedVin(string vin, string tradetype) { Boolean checkTradeStatus = false; Actions ac1 = new Actions(Driver.GetDriver()); Actions ac2 = new Actions(Driver.GetDriver()); try { IWebElement VinFromGrid = TradeSummaryGridRef.FindElement(By.CssSelector(".tm-grid-icon-label")); IWebElement TradeStatus = TradeSummaryGridRef.FindElement(By.XPath("//section/div/div/div[3]")); ac1.MoveToElement(VinFromGrid).Click().Build().Perform(); Console.WriteLine("TRADE TYPE========== : " + TradeStatus.Text + " for VIN = " + VinFromGrid.Text); if (VinFromGrid.Text.Contains(vin) == true) { ac1.MoveToElement(TradeStatus).Click().Build().Perform(); if (TradeStatus.Text.Contains(tradetype)) { Console.WriteLine("Status : " + tradetype + " from Trade Summary Grid is found successfully. "); } checkTradeStatus = true; } } catch (NoSuchElementException ex) { Console.WriteLine("Unable to find elements from grid." + ex.StackTrace); } return(checkTradeStatus); }
public Boolean GetCommentsForSearchedVin(string vin, string comments) { Boolean checkTradeComments = false; try { IWebElement VinFromGrid = TradeSummaryGridRef.FindElement(By.CssSelector(".tm-grid-icon-label")); IWebElement TradeComments = TradeSummaryGridRef.FindElement(By.XPath("//section/div/div/div[10]")); Console.WriteLine("TRADE TYPE========== : " + TradeComments.Text + " for VIN = " + VinFromGrid.Text); if (VinFromGrid.Text.Contains(vin) == true) { if (TradeComments.Text.Contains(comments)) { checkTradeComments = true; } } } catch (NoSuchElementException ex) { Console.WriteLine("Unable to find elements from grid." + ex.StackTrace); } return(checkTradeComments); }