final ErrorReporterImpl errorReporter = new ErrorReporterImpl(httpCommandProcessor, testContext);
ErrorReportingCommandProcessor commandProcessor = new ErrorReportingCommandProcessor(httpCommandProcessor,
errorReporter);
final Selenium selenium = new DefaultSelenium(commandProcessor);
selenium.start();
testContext.setAttribute(TapestryTestConstants.BASE_URL_ATTRIBUTE, baseURL);
testContext.setAttribute(TapestryTestConstants.SELENIUM_ATTRIBUTE, selenium);
testContext.setAttribute(TapestryTestConstants.ERROR_REPORTER_ATTRIBUTE, errorReporter);
testContext.setAttribute(TapestryTestConstants.COMMAND_PROCESSOR_ATTRIBUTE, commandProcessor);
testContext.setAttribute(TapestryTestConstants.SHUTDOWN_ATTRIBUTE, new Runnable()
{
@Override
public void run()
{
try
{
LOGGER.info("Shutting down selenium client ...");
try
{
selenium.stop();
} catch (RuntimeException e)
{
LOGGER.error("Selenium client shutdown failure.", e);
}