HtmlUnit: An Efficient Approach to Testing Web Applications



Similar documents
Load Testing Ajax Apps using head-less browser tools. NoVaTAIG April 13, 2011 Gopal Addada and Frank Hurley Cigital Inc.

A BASELINE FOR WEB PERFORMANCE WITH PHANTOMJS

Agile Web Application Testing

Certified Selenium Professional VS-1083

Project Plan Log Monitoring Compliance

Deepak Patil (Technical Director) iasys Technologies Pvt. Ltd.

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

Enable Your Automated Web App Testing by WebDriver. Yugang Fan Intel

Progressive Enhancement With GQuery and GWT. Ray Cromwell

Art of Code Front-end Web Development Training Program

Web Conferencing Version 8.3 Troubleshooting Guide

Sostenuto 4.9. Hardware and Software Configuration Guide. Date: September Page 1 of 13

Enterprise RIA Deployment Examples

Web Applications Testing

Web Cloud Architecture

Selenium 1.0 Testing Tools

Selenium WebDriver. Gianluca Carbone. Selenium WebDriver 1

Whitepaper. Rich Internet Applications. Frameworks Evaluation. Document reference: TSL-SES-WP0001 Januar

The UC Learning Center: Disabling Pop-Up Blockers

The Google Web Toolkit (GWT): Overview & Getting Started

How To Write An Ria Application

How To Build A Web App

Web Development with the Eclipse Platform

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

Credits: Some of the slides are based on material adapted from

Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

Rich Internet Applications

Google Web Toolkit (GWT) Architectural Impact on Enterprise Web Application

AJAX Toolkit Framework

Reading an sent with Voltage Secur . Using the Voltage Secur Zero Download Messenger (ZDM)

Front-End Performance Testing and Optimization

Lucy Zhang UI Developer Contact:

Javascript Security, XSS, and Uncovered Topics. Pat Morin COMP 2405

A Tool for Evaluation and Optimization of Web Application Performance

A Model of the Operation of The Model-View- Controller Pattern in a Rails-Based Web Server

Wildix Web API. Quick Guide

IBM Script Portlet for WebSphere Portal Release 1.1

WHITE PAPER on Flex to HTML5 The Migration Challenge. April 2014

Web Development with R

Browser tools that make web development easier. Alan Seiden Consulting alanseiden.com

MEGA Web Application Architecture Overview MEGA 2009 SP4

A Comparison of Open Source Application Development Frameworks for the Enterprise

Introduction to Mobile Performance Testing

A review and analysis of technologies for developing web applications

GUI Test Automation How-To Tips

A Baseline for Web Performance

Team Members: Christopher Copper Philip Eittreim Jeremiah Jekich Andrew Reisdorph. Client: Brian Krzys

Accessing UniSIM MyMail For Students and Associates Via Microsoft Office 365. UniSIM - Restricted

Scalable and Efficient Web Application Architectures. Thin-clients and SQL vs. Thick-clients and NoSQL

Recommended Browser Setting for MySBU Portal

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

Syllabus INFO-UB Design and Development of Web and Mobile Applications (Especially for Start Ups)

WEB DEVELOPMENT CAREERS WEB DEVELOPMENT WEB DEVELOPMENT STARTER PACK WEB DEVELOPMENT CAREERS

Technical Specifications. Technical requirements for Eversheds E-Learning and Learning Management System (LMS)

Performance Testing Web 2.0. Stuart Moncrieff (Load Testing Guru) /

Introduction to Selenium Using Java Language

The maturity level of APEX. Patrick Hellemans Competence Manager Technology

Web Tracking for You. Gregory Fleischer

Developing ASP.NET MVC 4 Web Applications

Developing ASP.NET MVC 4 Web Applications MOC 20486

Improving Magento Front-End Performance

Automation using Selenium

Building a Simple Mobile optimized Web App/Site Using the jquery Mobile Framework

WebIOPi. Installation Walk-through Macros

Section 1.0 Getting Started with the Vālant EMR. Contents

The Internet, the Web, and Electronic Commerce

Instructions for Configuring Your Browser Settings and Online Security FAQ s. ios8 Settings for iphone and ipad app

Rich Web Applications in Server-side Java without Plug-ins or JavaScript

Web Design Technology

Migration and Developer Productivity Solutions Retargeting IT for Emerging Business Needs

Creating Modern CICS Web Applications by Exploiting Open Source Javascript Libraries

Is Liferay Right for Your Organization? Seven Things to Consider When Choosing a Portal Platform

Syllabus INFO-GB Design and Development of Web and Mobile Applications (Especially for Start Ups)

Software Automated Testing

WHITE PAPER. Domo Advanced Architecture

Overview. In the beginning. Issues with Client Side Scripting What is JavaScript? Syntax and the Document Object Model Moving forward with JavaScript

GrandView. Web Client Software Requirements and Recommendations. Revision

AUTOMATED CONFERENCE CD-ROM BUILDER AN OPEN SOURCE APPROACH Stefan Karastanev

WA2256 Responsive Mobile Web Development with HTML5, CSS3, JavaScript, and jquery Mobile. Classroom Setup Guide. Web Age Solutions Inc.

Load Testing on Web Application using Automated Testing Tool: Load Complete

Server-side OSGi with Apache Sling. Felix Meschberger Day Management AG 124

Client-side Web Engineering From HTML to AJAX

Improving Web Vulnerability Scanning. Daniel Zulla

3DHOP Local Setup. Lezione 14 Maggio 2015

Session D15 Simple Visualization of your TimeSeries Data. Shawn Moe IBM

WompMobile Technical FAQ

Rethinking Online Code Editors for Supporting Time-based Web Documents

Project Plan Microsoft Team System Web Client

JavaScript Testing. Beginner's Guide. Liang Yuxian Eugene. Test and debug JavaScript the easy way PUBLISHING MUMBAI BIRMINGHAM. k I I.

Developing ASP.NET MVC 4 Web Applications Course 20486A; 5 Days, Instructor-led

Mobile Application Performance Report

Transcription:

HtmlUnit: An Efficient Approach to Testing Web Applications Marc Guillemot Independent Consultant mguillemot@yahoo.fr Daniel Gredler Sr. Software Developer DHL Global Mail daniel.gredler@gmail.com

Your Speakers > Marc Guillemot Independent consultant Lead developer of HtmlUnit and WebTest Committer to Groovy > Daniel Gredler Sr. Software Developer @ DHL Global Mail Committer to HtmlUnit and Apache Tapestry

Agenda What is HtmlUnit? Simulation: Possibilities & Limitations AJAX Inside HtmlUnit Tools which use HtmlUnit Future Plans Q&A

Requirements for Successful Test Automation Awareness for quality assurance Unit tests Continuous Integration Test early Write testable HTML code Don t write fragile tests!

What is HtmlUnit? A project with a very bad name! 100% Java-based headless browser Open Source (Apache 2 license) Hosted at SourceForge 7 committers (3 very active) Numerous contributors Very mature Useful for integration testing, screen scraping, etc.

Sample Use

HtmlUnit Simulates Real Browsers Focus on 4 browsers Firefox 2 & 3 Internet Explorer 6 & 7 Tries to mimic browser behavior HTTP requests HTML parsing CSS parsing JavaScript execution

Simulation? Real end users don't use HtmlUnit. Tests should run in a real browser to ensure that the application works. (demo)

Simulation!?!? Tests don't ensure that an application works correctly Tests find errors -- that's all HtmlUnit can help to find a lot of errors

What kind of errors can be found? Like any test tool: functional errors JavaScript errors HTTP errors: 404, 500,... Incorrectness incorrect HTML malformed URLs incorrect headers...

Example JavaScript Error www.google.com (Sept. 2008)

AJAX Timing AJAX testing = need for synchronization HtmlUnit solutions: Polling is not the right way! NicelyResynchronizingAjaxController WebClient.waitForBackgroundJavaScript(delay) (coming in 2.5)

Architecture HtmlUnit... Mozilla Rhino CssParser NekoHTML Apache HttpClient

Customization Enable / Disable JavaScript CSS Popup Blocker Throw / No Throw on Script Error on HTTP Failure Status Codes Use Insecure SSL

Extension Points Alert / Confirm / Prompt / Status Handlers JavaScript Preprocessors JavaScript Debugger Callbacks Custom Web Connections Incorrectness Listeners: HTML, CSS, etc.

Extension Point Example: Falsify Responses

Performance Reduce network traffic No rendering No browser startup pause Data point: Celerity vs. Watir Simple local file: test time reduced by 99% Google image search: test time reduced by 69% Digg front page scraping: test time reduced by 74% Local file with DOM access: test time reduced by 97%

Performance: Rhino vs. IE

Other Advantages Platform Independence I m a PC developer vs. I m a Mac developer vs. build server vs. continuous integration server Scalability Standard JVM setup vs. grid component vs. cloud infrastructure

Limitations Simulation not 100% correct: for incorrect HTML code for JavaScript execution on the HTTP layer RIAs No support for Flash or Silverlight Applets supported only as proof of concept

Ensuring Accuracy Simple unit tests Unit tests using WebDriver AJAX library integration tests JavaScript execution flow comparisons

Simple Unit Tests

Library Integration Tests CurvyCorners Dojo ExtJS Sarissa YUI... GWT JQuery MochiKit Prototype

Tools which use HtmlUnit JSFUnit WebDriver PushToTest TestMaker Wepawet Canoo WebTest Grails Functional Testing Plugin Celerity Perl HtmlUnit Schnell JWebUnit TestPlan

Example: WebTest

Example: WebDriver

Future Plans Expand AJAX library integration testing Improved control of background JavaScript Support for other browsers Internet Explorer 8? Chrome? Safari? Migrate to Apache? Frequent releases!

Questions