Click here to Skip to main content
13,594,792 members
Click here to Skip to main content
Add your own
alternative version


50 bookmarked
Posted 16 Jun 2005

WebReplay - an automated software testing tool for Web applications

, 16 Jun 2005
Rate this:
Please Sign up or sign in to vote.
This article presents an automated software testing tool for Web applications (Internet/Intranet) based on Internet Explorer.

Click to enlarge


Web Replay is an automated software testing tool for Web applications. It helps in detecting bugs and regressions in Web applications by replaying scenarios to test the application.

Using WebReplay, you can automatically navigate to a Web page, fill in form fields, click on the submit (OK) button, and then continue to another Web page.

To use Web Replay, build an XML Scenario File (see below), type the name of the file in the edit box and click on the Replay button.

Background (optional)

Web Replay is based on Microsoft's WebBrowser control (Microsoft® ActiveX® control). It embeds the control into a very simple dialog-based application which loads an XML scenario file and programmatically drives the WebBrowser control (via its COM Interface IWebBrowser2) to execute the scenario.

Using the code

Web Replay provides the following features:

  • Replay scenarios from an XML file.
  • Supports every feature supported by Microsoft Internet Explorer (includes Windows Integrated Authentication).
  • Supports HTML forms, HTML input elements, HTML hyperlinks (anchors).
  • Supports two actions on HTML elements: set_value and click:
    • set_value simulates a change in the HTML element's value (input, select, etc...).
    • click simulates a mouse click on the HTML element (any element).
  • Supports unnamed HTML elements: Elements can be found with their associated value and/or innerText and/or Href.
  • Stores and reloads the last scenario file name (it uses a good old WebReplay.ini file).
  • Supports dynamically-generated Web Sites (client-side): If your web site generates HTML within the browser (using JavaScript's commands like "document.write"), Web Replay can still play back a given scenario - it uses a timeout mechanism to find the dynamically-generated controls.

Sample XML Scenario

An XML scenario file looks like this:

<?xml version="1.0" encoding="Windows-1252"?>
    <!--<span class="code-comment"> Search something in codeproject --></span>
    <!--<span class="code-comment"> Scenarios are divided into steps (one step per page download) --></span>
      <!--<span class="code-comment"> Every step can contain one or more actions --></span>
      <!--<span class="code-comment"> Action can be of type "navigate" = 
             Web Replay will navigate to the given URL --></span>
      <action type="navigate" url="" />
      <!--<span class="code-comment"> Action can be of type "control" = 
             Web Replay will interact with an HTML element --></span>
      <action type="control" 

             name="target" event="set_value" value="WebReplay" />
      <!--<span class="code-comment"> This field is unnamed; but it has a specific value attribute --></span>
      <action type="control" name="" value="Go" event="click" />

To build a scenario file, you need to basically know the names (or ids) of HTML elements within your Web Application. Alternatively, you can use an empty name and use the HTML element's value (for unnamed items).

Points of Interest

How do you test code? Well, just write a test program! Web Replay helps you with this by providing a simple way of testing you Web apps. But it's still a brand new program; the TODO list is long...

Web Replay TODO List

  • Play scenarios multiple times (even infinite loops to stress-test your Web application).
  • Use of variables/expression in scenario files (to replay scenarios that are always different).
  • Batch playback of scenario files.
  • Enhanced error detection (e.g. a scenario should fail if a given HTML pattern is not found in the HTML page).
  • Automated recording of scenario files (implement an event sink for IWebBrowser2 and record HTML elements names/id and associated event).


V1.0 - $Date: 2005-06-16 11:50:08 +0200 (Thu, 16 Jun 2005) $


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Emmanuel Kartmann
Web Developer
France France
Fell into computer software at the age of 11, founder of 3 startups, and now manager of an independent software vendor (ISV) labelled proSDK ( And still a freeware writer and technical article author!

You may also be interested in...


Comments and Discussions

Generalnice Pin
Donsw22-May-09 7:46
memberDonsw22-May-09 7:46 
GeneralCheck out this WebReplay... Pin
JackNynguen10-Apr-08 13:01
memberJackNynguen10-Apr-08 13:01 
Generalnavigate - error Pin
grandmasta116-Nov-07 0:14
membergrandmasta116-Nov-07 0:14 - Web Testing With C# or VB.NET Pin
ftorres1-Feb-07 17:17
memberftorres1-Feb-07 17:17 
Generaldialog boxes Pin
Anonymous20-Jul-05 10:19
sussAnonymous20-Jul-05 10:19 
GeneralRe: dialog boxes Pin
Emmanuel Kartmann16-Aug-05 22:32
memberEmmanuel Kartmann16-Aug-05 22:32 
GeneralAutomatically retreving the fields Pin
TrappedVector24-Jun-05 3:21
memberTrappedVector24-Jun-05 3:21 
GeneralRe: Automatically retreving the fields Pin
Emmanuel Kartmann25-Jun-05 22:47
memberEmmanuel Kartmann25-Jun-05 22:47 
GeneralRe: Automatically retreving the fields Pin
Emmanuel Kartmann16-Aug-05 22:35
memberEmmanuel Kartmann16-Aug-05 22:35 
Generalselect option Pin
voltek6023-Jun-05 13:06
membervoltek6023-Jun-05 13:06 
GeneralRe: select option Pin
Emmanuel Kartmann23-Jun-05 20:06
memberEmmanuel Kartmann23-Jun-05 20:06 
GeneralRe: select option Pin
voltek6023-Jun-05 20:58
membervoltek6023-Jun-05 20:58 
Generalsome wrong in this application where i build it. Pin
winart21-Jun-05 15:53
memberwinart21-Jun-05 15:53 
GeneralRe: some wrong in this application where i build it. Pin
Emmanuel Kartmann21-Jun-05 19:32
memberEmmanuel Kartmann21-Jun-05 19:32 
GeneralRe: some wrong in this application where i build it. Pin
winart21-Jun-05 23:13
memberwinart21-Jun-05 23:13 
GeneralRe: some wrong in this application where i build it. Pin
Emmanuel Kartmann22-Jun-05 20:09
memberEmmanuel Kartmann22-Jun-05 20:09 
GeneralLook at SWExplorerAutomation Pin
Alex Furman17-Jun-05 10:44
memberAlex Furman17-Jun-05 10:44 
GeneralRe: Look at SWExplorerAutomation Pin
Emmanuel Kartmann20-Jun-05 2:53
memberEmmanuel Kartmann20-Jun-05 2:53 
GeneralRe: Look at SWExplorerAutomation Pin
Alex Furman20-Jun-05 6:07
memberAlex Furman20-Jun-05 6:07 
GeneralRe: Look at SWExplorerAutomation Pin
Emmanuel Kartmann23-Jun-05 5:22
memberEmmanuel Kartmann23-Jun-05 5:22 
QuestionIs that possible to use on Win CE? Pin
Paul_Lai16-Jun-05 22:26
memberPaul_Lai16-Jun-05 22:26 
AnswerRe: Is that possible to use on Win CE? Pin
Emmanuel Kartmann16-Jun-05 22:51
memberEmmanuel Kartmann16-Jun-05 22:51 
GeneralMissing file Pin
Todd Smith16-Jun-05 12:13
memberTodd Smith16-Jun-05 12:13 
GeneralRe: Missing file Pin
Emmanuel Kartmann16-Jun-05 20:41
memberEmmanuel Kartmann16-Jun-05 20:41 
GeneralVery nice! Pin
netclectic16-Jun-05 5:07
membernetclectic16-Jun-05 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03-2016 | 2.8.180621.3 | Last Updated 16 Jun 2005
Article Copyright 2005 by Emmanuel Kartmann
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid