1

Closed

Take screenshot on test failure

description

I was looking at the cloud service team UI tests and noticed some improvements we could make to our own UI tests.

In their test cleanup, they take a screenshot of the primary screen if the test failed (TestContext.CurrentTestOutcome != UnitTestOutcome.Passed). They save the file in the test output folder, using the TestContext.TestName and DateTime.Now for file name.
Closed Aug 5 at 12:31 AM by Zooba
We take screenshots regularly throughout our tests now. Taking them only on failures would be less interesting, because VS has normally been killed by the time we know the test has failed.

comments