I've got a few classes worth of Selenium tests set up and ready to run, however I'd like to log the test results to an external database (in addition to internal TFS status) for different analytic analysis. As part of this I'd like to store the exception as thrown by the test.
I've seen deployments elsewhere which made use of MSTest and still logged exceptions to an external database, but I can't seem to find the correct layer that exposes the thrown exceptions to where I can log them. TestContext doesn't contain them, there's no obvious way to invoke a test within a try/catch block and nothing relevant shows up in the [TestCleanup].
The closest answer I can find on StackOverflow would be this question from 2010 which doesn't seem to have a particularly conclusive answer. Ultimately non-C# programmers will be writing tests on top of my framework, I'd prefer to have them write as little cargo-cult-code as possible.
Is there a way to get the exceptions thrown from within a test running in MSTest? It obviously gets stored by the MSTest system, so it has to be caught somewhere.