Clean up coded ui test

1.4k Views Asked by At

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

There are 1 best solutions below

0
On

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?