What is the Smooks Report Generator?
Developing web content that is accessible through a number of browsers is challenging. Sites must be tested on all browsers for which support is required. Resolving any browser specific issues requires the author to (a) identify the cause of the issue and (b) apply a fix for that/all browser(s). However, identifying the cause of the issue is often the most difficult step in the process. This tool is intended as an aid to identifying possible browser specific issues in web content, supplying a description of the cause of the issue, and suggesting one or more solutions.
It's a command line tool. When run against a website (see below), it analysis the site content and generates a HTML formatted report similar to the sample report. It produces a report, per page and per browser tested. The report identifies possible issues with the current status of the site markup for each browser. The sample report reports on the status of a test site with respect to 3 different browsers (IE6, Firefox and Opera 7).
This tool is different from the likes of the BOBBY accessibility validation tool in that it was:
- built to test content for structures that may be valid in terms of the W3C Accessibility Guidelines, but still cause problems on a particular browser. As an example, see the following IE bug report on www.positioniseverything.net and this tool reporting on that IE bug in the sample report.
- designed to be easily extended by people using the tool. Hopefully this will spawn a community effort to "document" these bugs in a way that allows them to be automatically identified by this tool.
The Smooks Report Generator is built on the Smooks Content Filter Engine.
Note, this tool is not intended as a replacement for manual/visual site testing. It is hoped that it will help speed up this process, but it cannot eliminate it!
Basic Features
- Produces a formatted website report in HTML (viewable in a browser).
- Can test for multiple browsers in a single run. Produces a page-by-page report for each browser.
- Can test any type of website built/running on any technology/platform. The tool is Java based, but this doesn't mean it can't be used to test sites built using other technologies.
- Supports Cascading Style Sheets (CSS) - both inline and externally linked CSS.
- Supports poorly formed markup. The site markup doesn't need to be "well-formed" HTML or XHTML.
- Extendable. The tools is very configurable. You can add new report generation configurations for newly identified browser incompatibilities/issues.
- Supports "deep" testing of a website i.e. just point it at the homepage and it will drill down through the pages linked off the homepage, producing a report for each page for each requested browser. Of course this is only done for links relative to the site's base URL (specified in report.cmd).
Download and Run...
This tools is only a prototype at the moment but can be downloaded from here. You'll also need Java, which can be downloaded from Sun.
Use the report.cmd script in the bin folder to run the tool (Windows only for now - sorry).
Example: C:\smooks-report-0.1\bin>report -s index.html
The "-s index.html" parameter is the test start page. It is relative to the "base URL" which is set in the report.cmd script (along with some other parameters). You'll need to modify report.cmd appropriately:
set JAVA_HOME= set BASEURL= set OUTFOLDER= set ENCODING=ISO-8859-1 set RECURSIVE=-r set BROWSERS=msie6w,firefox,opera7
Configuring and Extending
This information is based on the contents of the milyn-smooks-report-0.1.zip.
The tools is configured through the following files:
- smooks-report-0.1/device-profile.xml: Use this file to add new browser definitions and profiles.
- smooks-report-0.1/smooks-cdr.lst: Use this file to load the report generation configurations i.e. the .cdrar and .cdrl files in the smooks-report-0.1/cdr folder (and subfolders).
- smooks-report-0.1/cdr/*/**.cdrl
In order to add a new configuration to generate a report for an incompatibility/issue, you need to do the following:
- If it's for a browser that's not configured in smooks-report-0.1/device-profile.xml, add configurations for that browser. Also configure the browsers "friendly-name" in the smooks-report-0.1/cdr/parameters.cdrl file.
- Add a new configuration in the appropriate .cdrl file in the cdr folder. If such a .cdrl file doesn't exist yet, create it and add the file to the smooks-report-0.1/smooks-cdr.lst file.
- Write the incompatibility/issue recognition code. This is done in one of 2 ways:
- By adding/inlining the recognition code directly in the .cdrl configuration. See smooks-report-0.1/cdr/mozilla/firefox.cdrl for an example. See BeanShellReportingUnit
- Create an implementation of the AbstractReportingUnit class, compile and add to the smooks-report-0.1/classes folder, and specify the class in the .cdrl configuration. See smooks-report-0.1/cdr/msie/v6.cdrl and the classes folder for an example.
Building a Repository of Configurations
Obviously, the power of this tool will depend on building up an exaustive repository of report generation configurations for known issues. There are a number of active sites listing details of browser incompatibilities/issues/bugs:
Using the information provided on these sites, report generation configurations can be created. These configurations are used by this tool to recognise an issue and generate a report on that issue for the browser in question. The following is a real example taken from the prototype configurations (see smooks-report-0.1/cdr/opera/common.cdrl):
<!--
See http://www.quirksmode.org/bugreports/archives/2005/10/
Opera_incorrectly_reporting_empty_values_of_radio_.html
-->
<cdres uatarget="opera" selector="input"
path="org/milyn/report/BeanShellReportingUnit.class">
<param name="id">opera-common-0002</param>
<param name="description"> <!--
This input radio/checkbox has an empty value attribute. <p/>
When a radio button or a checkbox has a value="" (empty),
Opera nonetheless reports a value="on".
-->
</param>
<param name="suggestion">
<!--See <a href="http://......" target="new">
www.quirksmode.org</a>-->.
</param>
<param name="code"> <!--
String type = element.getAttribute("type");
if("radio".equals(type) || "checkbox".equals(type)) {
org.w3c.dom.Attr value =
element.getAttributeNode("value");
return (value != null &&
value.getValue().equals(""));
}
-->
</param>
</cdres>
The above sample config uses the BeanShellReportingUnit. This allows the "recognition code" to be scripted directly into the configuration in the "code" <param>. See the previous section on Configuring and Extending.