【问题标题】:Clean up coded ui test清理编码的 ui 测试
【发布时间】:2013-08-15 12:21:44
【问题描述】:

我创建了具有更多迭代的数据驱动的编码 UI 测试。当我运行测试并完成第一次迭代时,我想在每个其他迭代之前放置一些清理代码,以清理在前一次迭代中所做的所有更改。

知道怎么做吗?

【问题讨论】:

    标签: coded-ui-tests code-cleanup data-driven


    【解决方案1】:

    编码的 UI 测试允许具有 [TestCleanup] 属性的方法。这些方法在每次测试后运行。如果您正在创建 Coded UI 测试文件,您应该在 CodedUItestN.cs 文件的 cmets 中找到 [TestCleanup] 的示例。

    还支持具有 [ClassCleanup] 和 [AssemblyCleanup] 属性的方法。

    这个SO问题有更多信息Test Method that runs once at the Start of the Test?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-08
      • 1970-01-01
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多