Good evening!
I'm organizing my test suite and looking for the best ways to create an error report when a test fails. I have already implemented a log in .txt with the name of the test that is executed (using TestContext), the test execution time, its status (Passed, error, timeout ...), and saving prints if the test fails.
However, if the test fails, you would also like to save the reason for the error, as well as Visual Studio points out when debugging, or the reason for failure in the test suite itself appears. The case is that I will make a service run the dawn tests, and I will not have access to the written reasons for the failure.
I thought of some possible solutions, I just did not implement them because I believe there are better ways. For example, one of the possibilities I imagined was to handle all tests with try / catch, and save the error inside the catchs.
I'm using the latest stable version of Selenium WebDriver in a C # project, with structure based on Microsoft.VisualStudio.TestTools.UnitTesting. Thank you in advance!