I had certain difficulties analyzing failures after execution of Selenium's test, especially when tests were executed in a 'continuous integration' mode overnight:
- I could not see values that variables had at the moment of failure. It is especially critical if value assigned to variable generated in test or requested from the web service.
- I could not see a page content at the moment of the failure. So I had no way to quickly figure out what happened - previous navigation failed, control was not present, server error happened etc.
It especially hurt in cases of irreproducible failures.
I thought about using some tool to record video of test run (yuck, bulky AVIs, hard to locate point of the failure) or of a way somehow take a 'regular' jpg screenshot. Both did not look like a good idea because in case of multi window mode it will show only top part of the page.
So I decided to proceed with simply grabbing html of the AUT.
Attached extension is a first (rather quick and probably rough) attempt to solve the problems described above.
'Screenshot' is somewhat not too nice looking because it is simply html of the page, missing css etc. So far it works for me especially considering that I did not have much time to improve it.
How to use
Just include attached code into your user-extensions.js. It was tested with Selenium Core 0.8.0.
Run your tests as you usually do.