Appendix E. Installing software

 

This appendix covers

  • Installing HtmlUnit
  • Configuring Cactus with HtmlUnit
  • Installing Selenium
  • Installing RhinoUnit
  • Installing JsUnit

E.1. Installing HtmlUnit

Download HtmlUnit from http://htmlunit.sourceforge.net/ and unzip it to your local drive. In our examples, we have unzipped it to C:\Java\htmlunit-2.7.

E.1.1. Standard configuration

Add all JAR files to the classpath except for the three XML libraries: XML-APIs, Xalan, and Xerces. Starting with version 1.4.2, Java ships with an XML parser and transformer (Apache Xalan). Because HtmlUnit ships with XML-APIs, Xalan, and Xerces, the version of these libraries must override the default Java versions through the Java-endorsed mechanism.[1], [2]

Move all XML libraries to a subdirectory of HTmlUnit-2.7/lib called endorsed. For example, the lib directory should contain the following files:

commons-codec-1.4.jar
commons-collections-3.2.1.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-lang-2.4.jar
commons-logging-1.1.1.jar
cssparser-0.9.5.jar
htmlunit-2.7.jar
htmlunit-core-js-2.7.jar
nekohtml-1.9.14.jar
sac-1.3.jar
serializer-2.7.1.jar

The directory lib/endorsed should contain these files:

xalan-2.7.1.jar
xercesImpl-2.9.1.jar
xml-apis-1.3.04.jar

E.2. Configuring Cactus with HtmlUnit

E.3. Installing Selenium

E.4. Installing RhinoUnit

E.5. Installing JsUnit