You are on page 1of 14

Webtest Automation Framework Tutorial

Catalin Amza

Objective

This tutorial will show you how to get started with the Canoo Webtest Automation Framework and apply it to automate testing Web Applications ...

Test Automation? Yes please.


Enables a more frequent feedback Provides a built-in safety net Facilitates change Tests as executable specifications

Critical for agile software development

Canoo Webtest Automation Framework


A keyword driven framework that facilitates automated testing of Web applications with Canoo Webtest Simplify test creaation and maintenance, allowing more automated testing with fewer technical resources Focus on automated smoke and regression testing

A popular free open-source testing tool for web applications Simple but expressive XML scripting language ANT integration HTMLUnit browser Easy to extend using Groovy, Java Comprehensive test reports

Framework Features
Test Cases simulate user actions and business processes using a simple spreadsheet format Canoo Webtest Automation Framework Easy to understand by non-technical users Application Map Test Cases Independent of the test tool Actions Independent of the GUI of the application being tested Test Suite Test Cycle Application Map maps GUI objects from names that humans can recognize to a data format that is useful Continous Integration Canoo for the automation tool Tool Webtest Single point of maintenance for GUI objects Action Words mimic user actions like navigation and Test Reports form filling and submission Developed by the toolsmith Test suites and test cycles are modular ANT scripts that enable Canoo Webtest to read and execute the test cases based on the information in the Application Map Comprehensive test reports Interoperability with Continuous Integration Tools like Cruise Control or Hudson

Getting Started
Install the framework Test Design Test Build Test Execution Analyze Test Results environment.properties Test Cases Application Map Action Words Test Suites Test Cycle Test Reports

Install the framework


Download and install Canoo Webtest 2.6
http://webtest.canoo.com Requires JDK version 5 or higher

Extract the framework archive to a directory of your choice Update the following properties in the environment.properties file to point to your local settings:
webtest.home: Canoo Webtest installation folder webtest.testdir: Canoo Webetes Automation Framework installation folder

Test Design

Test cases simulate typical user actions like page invocation, navigation via links and form entry and submission using a simple spreadsheet format:
Item: A unique logical name for an application field or object Action: The action to be performed on the item Value: The argument value associated with the action being performed Description: A textual description of what the step does

Test Build
The application map associates each item name to the identification scheme needed by the automation tool to recognize and manipulate the correct GUI object
Name: The logical name associated with the GUI object used in the test cases Type: The type of the GUI object ID: A XPath identification scheme that uniquely identifies the object in the HTML page

Test Build
Canoo Webtest Automation Framework provides a set of easy to learn, intuitive action words The type of a GUI object determines the actions that can be applied to the object and the argument value associated with the used action
Type Webapp Window PageTitle InputField RadioButton SelectField Checkbox Button Link invoke select verify set set set set click click Action Path NA Text Text The value property of the selected HTML control The value property of the selected HTML control true or false NA NA Value

Test Execution
Add the test cases to the test suite (google.xml)
<project name=google" default="suite"> <target name="suite"> <antcall target="testcase"> <param name="description" value="Google Search Canoo Webtest"/> <param name="container" value="googleOk.xls"/> </antcall> Test case </target> </project>

<project name="demo" default="wt.full"> ... <property name="wt.testInWork" value="usecases/google/google.xml"/> ... Test suite </project>

Add the test suites to the test cycle (demo.xml)

Run the test cycle


webtest f demo.xml

Test Reports
Comprehensive test reports that show the exit of each test case and the details of each test step

You might also like