public void ThenTheMessageResultShouldBeDisplayed(string message) { IList <IWebElement> rows = invoicePage.GetInvoiceRows(); foreach (IWebElement row in rows) { var rowTD = row.FindElements(By.TagName("td")); if (rowTD.Count > 0) { if (rowTD[0].Text.Equals(invoiceModel.InvoiceNumber)) { Assert.True(rowTD[0].Text.Equals(invoiceModel.InvoiceNumber)); invoiceModel.FindAndDeleteInvoice(rowTD); } } } }