public bool FindErrorMessageInLogDetailPage(string messageToLookFor, string errorMessage)
        {
            var messageRow =
                PoLogReportRows.FirstOrDefault(e => e.FindElements(By.TagName("td"))[5].Text.Contains(messageToLookFor));

            if (messageRow == null)
            {
                Console.WriteLine("Message not found: {0}", messageToLookFor);
                return(false);
            }

            ////messageRow.FindElements(By.TagName("td"))[0].Click();
            this.javaScriptExecutor.ExecuteScript("arguments[0].click();", messageRow.FindElements(By.TagName("td"))[0].FindElement(By.TagName("a")));
            this.webDriver.WaitForPageLoad(new TimeSpan(0, 0, 10));

            //webDriver.FindElement(By.Id("tBox_ThreadID"));
            B2BLogDetailPage B2BLogDetailPage = new B2BLogDetailPage(WebDriver);

            if (B2BLogDetailPage.GetLogDetail().Contains(errorMessage))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool FindMessageOnLogReport(string messageToLookFor)
        {
            var messageRow =
                PoLogReportRows.FirstOrDefault(
                    e =>
                    e.FindElements(By.TagName("td"))[5].Text.Contains(
                        messageToLookFor));

            return(messageRow != null);
        }
        /// <summary>
        /// Looks for a specific message in the table, clicks on the timestamp link.
        /// </summary>
        /// <param name="messageToLookFor">Message to look for</param>
        public bool FindMessageAndGoToLogDetailPage(string messageToLookFor)
        {
            var messageRow =
                PoLogReportRows.FirstOrDefault(e => e.FindElements(By.TagName("td"))[5].Text.Contains(messageToLookFor));

            if (messageRow == null)
            {
                Console.WriteLine("Message not found: {0}", messageToLookFor);
                return(false);
            }

            ////messageRow.FindElements(By.TagName("td"))[0].Click();
            this.javaScriptExecutor.ExecuteScript("arguments[0].click();", messageRow.FindElements(By.TagName("td"))[0].FindElement(By.TagName("a")));
            this.webDriver.WaitForPageLoad(new TimeSpan(0, 0, 10));
            return(true);
        }
        public bool FindQuoteRetrievalMessage(string messagePrefix, string messageSuffix)
        {
            var messageRow =
                PoLogReportRows.FirstOrDefault(
                    e =>
                    e.FindElements(By.TagName("td"))[5].Text.Contains(
                        messagePrefix + QuoteIdInTable.Text.Trim() + messageSuffix));

            if (messageRow == null)
            {
                Console.WriteLine("Message not found: {0}", messagePrefix + QuoteIdInTable.Text.Trim() + messageSuffix);
                return(false);
            }

            return(messageRow != null);
        }
        public string FindDellPurchaseId(string expectedLogEntry)
        {
            var dellPurchaseIdEntry =
                PoLogReportRows.FirstOrDefault(e => e.FindElements(By.TagName("td"))[5].Text.Contains(expectedLogEntry));

            if (dellPurchaseIdEntry == null)
            {
                return(string.Empty);
            }

            var dellPurchaseIdMessage = dellPurchaseIdEntry.FindElements(By.TagName("td"))[5].Text;

            Console.WriteLine("DP ID is generated with message -> {0}", dellPurchaseIdMessage);
            var dellPurchaseId = dellPurchaseIdMessage.Trim().Split(' ').LastOrDefault();

            long dpid;

            if (long.TryParse(dellPurchaseId, out dpid))
            {
                return(dellPurchaseId);
            }

            return(string.Empty);
        }