2

I created data-driven coded ui test with more iterations. When I run the test and when first iteration is done, I want do put some clean up code before every other iteration to clean all changes that are made in the previous iteration.

Any idea how to do that?

1 Answers1

2

Coded UI tests allow method with the [TestCleanup] attribute. Such methods are run after each test. If you are creating Coded UI test file you should find an example of a [TestCleanup] in comments in the CodedUItestN.cs file.

Methods with [ClassCleanup] and [AssemblyCleanup] attributes are also supported.

This SO question has more information Test Method that runs once at the Start of the Test?

Community
  • 1
  • 1
AdrianHHH
  • 13,492
  • 16
  • 50
  • 87