Maven Canoo WebTest Plug-in How To

How to setup my Canoo WebTest project?

The plugin assumes that there is a webtest directory located (see the maven.webtest.src property). Within this directory all the Canoo WebTest scripts are expected.

How to run the all samples?

Just go to the "sample" directory of the plugin and type "maven webtest". This will execute all Canoo Webtest scripts and the resulting report is located in "target/docs/webtest-report.html"

How to run a single Canoo Webtest Script?

Having a complex test environment it is handy just to run a single test script. This is done by setting maven.webtest.file on the command line.

maven webtest -Dmaven.webtest.file=sample.xml

How to define a target for a Canoo Webtest Script?

For setting up Canoo Webtest you just want to execute a single target within a single script.

maven webtest -Dmaven.webtest.file=sample.xml

Are there any other tools available?

If you don't like Canoo WebTest than check out HTTPUnit or Latka.

Why does webtest:loop not stop at the first error?!

Well, this is bug since I do not explicitely set maven.webtest.config.haltonfailure and maven.webtest.config.haltonerror to "true" to terminate the test run on the first problems.

How can get more/less output on my console?!

Nowadays Canoo WebTest use Log4J and the configuration file is located in the ${plugin.dir}/plugin-resources/classes

How to pass in parameters?

Any parameters you specifiy in maven.webtest.sysproperties will result in an interactive prompt if they are empty before the tests are run. You can use this to pass in a username from externally. Just define maven.webtest.sysproperties=webtestUsername, and then in your test scripts refer to ${webtestUsername}.