我正在做数据驱动的编码UI测试。我已经给出了10组数据。它在第五个数据集上失败了,并且正在停止。我需要编码的UI测试来继续数据驱动,即使在失败之后。请建议我怎么做。
发布于 2015-10-23 20:20:08
将每组数据放入一个try-catch块中。捕捉错误并忽略它或手动处理它,然后继续。我假设您将数据传递给UIMap。如果是这样,那么这样的事情:
[TestMethod]
public void Test_Transaction_ID_67890_Test()
{
for (int i = 0; i < testCaseList.Count; i++)
{
try
{
this.UIMap.ClickonManage(testCaseList);
this.UIMap.ClickonAdd(testCaseList);
this.UIMap.SelectAssigned(testCaseList);
this.UIMap.SelectTransactionDateTime(testCaseList);
}
catch (Exception e)
{
TestContext.WriteLine(Got An Error On Iteration " + i.ToString() + ".";
TestContext.WriteLine(e.ToString());
}
}https://stackoverflow.com/questions/20416962
复制相似问题