你的逻辑是好的:
IWebElement tableElement = driver.FindElement(By.XPath("/html/body/table")); IListtableRow = tableElement.FindElements(By.TagName("tr")); IList rowTD; foreach (IWebElement row in tableRow) { rowTD = row.FindElements(By.TagName("td")); if(rowTD.Count > 9) { if(rowTD[8].Text.Equals("Suspended") && rowTD[10].Text.Equals("Publishing Failed"); //test failed } }