我的代码如下-
string Nodata = _driver.FindElement(By.XPath("//*@id='gridView_EMPLOYEE_DXEmptyRow']/td[1]")).GetAttribute("innerHTML");
Assert.AreEqual("No data to display", Nodata.Trim());
插入失败并显示消息
Message: Assert.AreEqual failed. Expected:<No data to display>. Actual:<<div>
No data to display
</div>>.
答案 0 :(得分:0)
一种更简单的方法是使用<div>
标签进行检查(请注意空格)
Assert.AreEqual("<div>No data to display</div>", Nodata.Trim());