SPA Conference session: Acceptance Testing AJAX Web Applications through the GUI

One-line description:This case study charts how our automated test programme with Selenium grew from a login/logout smoke test to a framework that runs 100+ user story tests as part of our agile development process.
 
Session format: Tutorial (150 mins) [read about the different session types]
 
Abstract:The Web 2.0 trend to create Rich Internet Applications (RIAs) has brought fresh challenges to testers: web browsers were never designed as test execution environments, yet applications are expected to work in an increasingly diverse set of platforms (2008 saw the introduction of IE8, Firefox 3 and Google Chrome).

Whilst unit testing remains an important tenet of XP and Agile, additional GUI based tests are always necessary to ensure that the application works at the “user story” level. Such GUI tests are often perceived as expensive and slow, and the tools that automate them have been criticized for offering little more than a low-level instruction set.

Through our case study that uses Selenium, we will show that by applying User Centric Design (UCD) as a test structure it is possible to write higher-level tests that can be understood and modified by a Business Analyst.

Having created these tests, we will examine ways to maximize the return on investment by applying tests beyond validating functionality to include portability, performance, regression, resilience etc.


Note: we would be keen to explore ways of making this a more interactive session, perhaps including hands-on portions where the audience use some of our tools and techniques to test an RIA and also solicit feedback on others' experiences in this area.
 
Audience background:* Some familiarity with the browser DOM is useful, but not essential
* Relevant to: Web Developers, Web Testers, Project Managers (anyone concerned with the robustness of AJAX web applications)
 
Benefits of participating:* Illustrate how UCD test structure can assist with writing and test planning
* Give engineers a basic understanding of what Selenium does
* Give project managers a feel for the cost/benefits of GUI automation
 
Materials provided:* PPT slides
* A working RIA and Selenium test environment on a laptop (need connectivity to OHP)
 
Process:We will use a web trading application as an example Rich Internet Application (technology similar to Gmail as it uses AJAX, JavaScript, DHTML) to illustrate what Selenium can do.

We will first demonstrate where we started (our first test!) and contrast this with a more recent “UCD test” that has a straightforward anatomy that is meaningful to Business Analysts and can be drilled down to low-level Selenium instructions.

The main section will be divided evenly between the following:

Browser Mechanics – basic Selenium concepts to illustrate its use
Test Authoring – basic UCD concepts and how they can be applied to Selenium
Test Execution – ideas on how to run tests to get the most out of them

Note: Though presented in a case study format, we would like to raise awareness of other technologies and practices that can solve similar problems.

As the scope of the material is quite extensive, we would like to spin out more detailed discussion as BoF sessions.

Alternatively, we could extend the session to 150 mins (or have a separate workshop 75 min session) to do more practical stuff - maybe an exercise using a basic Selenium script that logs in to Gmail and sends a message to the delegate, then repeat the exercise using UCD at a higher level of abstraction.
 
Detailed timetable:[This will now be a 150 minute session]

0:00 – 0:05 Hellos
0:05 – 0:10 Survey: why are web applications difficult to test through the GUI?
0:10 – 0:30 Browser Mechanics – What does Selenium do?
0:30 – 1:50 Test Authoring – Making GUI tests easier to write
1:50 – 1:10 Test Execution – Increasing return on investment
1:10 – 1:15 Wrap-Up
 
Outputs:A list of perceived reasons why web applications are difficult test, categorized into issues relating to browser mechanics, test authoring and test execution.

In the Wrap-Up section, if there is enough interest we will invite further BoF discussion in the following areas:

* Browser Mechanics – tools and paradigms to facilitate GUI testing
* Test Authoring – tools and paradigms to write tests
* Test Execution – tools and paradigms to run tests
 
History:No history in the public domain, though we have been presenting this material to several clients to encourage best practices.
 
Presenters
1. Andrew MacLeod
Caplin Systems Ltd
2. Patrick Myles
Caplin Systems Ltd
3.