I recently wrote a little function that takes a screenshot at the end of a test if it has errored. What sounded very simple at the start turned out to be quite a bit of work, and quite a few lines of code to handle certain scenarios! It's now over 50 lines of code! I'll start with what I had at the beginning, this was to simply take a screenshot in the working directory, we are using SpecFlow and Selenium to run the tests, so we are going to check if the ScenarioContext.Current.TestError isn't null, if it is, then using Selenium, take a screenshot (note the below code is a simplified version of what I had at the beginning). [AfterScenario] public static void TakeScreenShotOnError() { if (ScenarioContext.Current.TestError == null) return; var screenshotDriver = Driver as ITakesScreenshot; if (screenshotD...
Documenting my thoughts on life in the world of Testing
If you don't build your automation logs well - this will become:
ReplyDelete"I have to spend 3 days investigating a failed automated test, rather than spending a whole day running manual tests."
Drill-down logs infrastructure is highly required, yet, hardly any common tools for that.
@halperinko - Kobi Halperin
We've set up our automated tests to give us as much information as possible when they fail, a screenshot is captured and the assertions all have pretty descriptive error messages. When debugging we'll see the stack trace as much as possible, so it's not all doom and gloom.
DeleteAll too often however, tests don't have informative errors or it's difficult to find out why a test failed, then you'll get your 3 days investigating!!!
BitTorrent enables folks to share substantial information with one another using a peer-to-peer network, which indicates they share portions of the file with one another, rather then downloading the whole file from a central site (such as iTunes).
ReplyDeleteMacGIC - Get all Mac Tools at One Place!
Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.
ReplyDeleterunkeeper