A few days back, I posted how Page Coverage is a useful technique to determine if any test cases have been missed and to keep managers happy. Page Coverage plugin for Selenium IDE that get you the page coverage of the Selenium IDE based tests. I have uploaded it to the Mozilla Addons website, but the approval process to make it public usually takes a while.Â The good news is that you can grab it right now from the addons page.
Once you install the plugin, a Page coverage tool button will be available on the Selenium IDE toolbar. See the screen shot.
Mini user guide for the plugin
- Click on the Page Coverage tool button to turn on page coverage.
- Run your test case or test suite to capture page coverage.
- Click on the small arrow next to the Page coverage icon and then click View Page Coverage menu item to open the page coverage reports.
- This should open the all page coverage reports or the latest one if you have just executed a test case or test suite.
- Click on the Page Coverage tool button again to turn off page coverage.
Sample Page Coverage Reports
These reports show the elements that were used in the test.
Known Issues / Notes
- The last link or button clicked that triggers a page load will not be captured in the page coverage.
- Using page coverage with this plugin is destructive, i.e. it changes the web page to mark the elements used by the tests . This may sometimes affect your tests. So always run your tests without page coverage to verify the correct results.
- You will see “Error: Image corrupt or truncated” in the error log almost every time a screen shot is taken. The screen shot is still saved correctly.
- If you turn on both highlight elements and page coverage at the same time, page coverage will take precedence. You can have them both installed without problems.
To use this plugin, you will need to install Selenium IDE extension of at least version 1.0.4 first. Only in English for now.
This plugin was very challenging! I had to spend a fair amount of my holidays working on it. The biggest challenge was to determine the right time to grab the screen shot of the web page. My first attempt was to manually insert the grab screen shot commands in the script, which, as you can guess was very painful. Finally, I reached the stage when the screen shots are usually captured at the right moment.
As usual feel free to leave comments, improvements, advise, criticism, problemsâ€¦
This looks very useful, is there a selenium command that will explicitly call the screen capture event? Our site uses frames and so only a third of the automatic capture were with fully loaded frames.
Interesting. I hope to look into this in the future. There is a Selenese command to capture a screen shot of the web page. It is called captureEntirePageScreenshot.
Are the reports generated for page coverage on a per-testcase basis or on a per-testsuite basis?
Both. The reports are generated for what ever you run, i.e. if you run a test case then the report will be just for the test case. If you run a test suite, the report will be for the test suite. The report will contain a screen shot for every web page tested.
This is pretty cool. I wonder if there is a way to not have it capture the ENTIRE full screen, rather, just the visible browser page? The pages on our dev sites have a ton of debugging code at the bottom, and that gets captured by this plugin, causing the pictures to be tiny until you zoom in.
I am not sure that I understand your request. Would you like to restrict the screen shot to just the visible portion of the browser window (i.e. the browser viewport)?
Can you exactly tell me when it capture the screenshot of the page?
whether it’s just before the button or link that make the navigation happen.