Monday, August 27, 2012

Canoo WebTest

Canoo WebTest is an open-source tool for testing web applications. It doesn't use real browsers, it validates HTML to comply with the specification. It also has support for testing PDF files, Excel sheets, Java applets and emails. Scripting languages are XML (Ant) or Groovy.

As WebTest scripts are Ant scripts, they are easy to integrate in continuous integration tools. Because WebTest is simply Java it can run everywhere. It is also fast as it doesn't have to load CSS and images and wait for page rendering. There is also a WebTest recorder available, with which you can record your first drafts of the tests. WebTest also has very good built-in reporting functionality.




One thing that can be seen as both good or not so good is that it forces developers to write good HTML, because scripts will fail if HTML doesn't comply with the specification. Javascript support is neither as good as in normal browsers.

If you don't care about running scripts in normal browsers and your application doesn't use much javascript, then this is a good tool for testing your web application.


Installation

 

  1. Install Java JDK version 5 or higher.
  2. Download latest version of WebTest from http://webtest.canoo.com and extract it. 
  3. Add WebTest bin folder to PATH.
  
How to run scripts


  1. Create a new project with command: webtest -f path\to\webtest\webtest.xml wt.createProject
  2. In the new project folder run the command: webtest

Example script

<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "../dtd/Project.dtd">
<project default="test">
<target name="test"> 
 
  <webtest name="testing Google search">
  <invoke url="http://www.google.com" description="Go to Google"/>
  <setInputField name="q" value="WebTest" /> 
  <clickButton id="gbqfb" description="Click search"/>
  <verifyText text="Canoo WebTest" />
  </webtest
</target>
</project>


More information

 

   

No comments:

Post a Comment