/// <summary> /// Fetches the quote details used for PO processing /// </summary> /// <param name="crtId"></param> /// <param name="quantity"></param> /// <param name="quoteType"></param> /// <returns>Quote details</returns> public List <QuoteDetail> GetQuoteDetails(string crtId, string quantity, QuoteType quoteType, List <string> configTitles = null) { var listOfQuoteDetail = new List <QuoteDetail>(); if (configTitles == null) { var firstRow = this.CatalogDetailsTableRows.FirstOrDefault(); if (firstRow != null) { listOfQuoteDetail.Add( new QuoteDetail() { CrtId = crtId, ItemDescription = firstRow.FindElements(By.TagName("td"))[8].Text.Trim().Split(',')[0], Price = firstRow.FindElements(By.TagName("td"))[9].Text.Trim().Split(' ')[0], Quantity = quantity, QuoteType = quoteType, SupplierPartId = "BHC:" + firstRow.FindElements(By.TagName("td"))[1].Text.Trim() }); } else { Console.WriteLine("No items found in Catalog Viewer page"); } } else { foreach (var configTitle in configTitles) { var configRow = CatalogDetailsTableRows.FirstOrDefault(e => e.FindElements(By.TagName("td"))[7].Text.Contains(configTitle)); if (configRow != null) { listOfQuoteDetail.Add( new QuoteDetail() { CrtId = crtId, ItemDescription = configRow.FindElements(By.TagName("td"))[8].Text.Trim().Split(',')[0], Price = configRow.FindElements(By.TagName("td"))[9].Text.Trim().Split(' ')[0], Quantity = quantity, QuoteType = quoteType, SupplierPartId = "BHC:" + configRow.FindElements(By.TagName("td"))[1].Text.Trim() }); } else { Console.WriteLine("Catalog Item with title **{0}** not found in Catalog Viewer page", configTitle); } } } return(listOfQuoteDetail); }
/// <summary> /// Treat this like a BVT of the page. If Validate does not pass, throw exception and console.writeline a return message into Test Class /// </summary> /// <returns>validated</returns> public override bool Validate() { return(CatalogDetailsTableRows.Any()); }