Even if you have made your tests totally reliable, they will fail occasionally. When
this happens it is often very hard to describe what the problem is with words alone. If one of your tests fails, wouldn't it be easier to explain what went wrong if you had a picture of what was happening in the browser when the error happened? I know that, when one of my Selenium tests fails, the rst thing I want to know is what was on the screen at the time of failure. If I know what was on the screen at the time of failure I will be able to diagnose the vast majority of issues without having to hunt through a stack trace for a speci c line number and then looking at the associated code to try and work out what went wrong. Wouldn't it be nice if we got a screenshot showing what was on the screen every time a test failed? Let's take the project that we built in Chapter 1, Creating a Fast Feedback Loop, and extend it a bit to take a screenshot every time there is a test failure. Let's have a look at how we can implement this in TestNG.
Comments
0 comments
Please sign in to leave a comment.