|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionWeb Replay 2 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 Web Replay 2, 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 2, build a JavaScript Scenario File (see below), type the name of the file in the edit box and click on the Replay button. BackgroundWeb Replay 2 is based on Microsoft's Internet Explorer 6.0, DHTML behaviors and JavaScript (unlike Web Replay 1 that was implemented in C++/COM). Web Replay 2 uses a FRAMESET with a DHTML behavior attached to the As a consequence, Web Replay 2 gives you full access to the Microsoft Internet Explorer Document Object Model (DOM) within your scenario files. And since the scenario is a JavaScript program, you can implement virtually any test case. Using the function WebReplay_Navigate(), you can call the server-side code to implement pre-conditions and post-conditions on your test cases (e.g. setting up a database or checking whether the created/modified records are correct). Using the codeWeb Replay provides the following features:
A JavaScript scenario file consists of a definition of a function named function WebReplayScenario()
{
switch (gintState)
{
case 0:
// Open a web page (LOCALHOST only due
// to cross-site scripting limitations)
"http://perso.wanadoo.fr/replay.grasse/freeware/WebReplay2/WebReplay2/WebReplaySDK.htm#WebReplay_Navigate" target=_blank>WebReplay_Navigate(
"http://localhost/WebReplay2/WebReplay2Scenario1_step1.asp");
break;
case 1:
// Type in some text in a form field
"http://perso.wanadoo.fr/replay.grasse/freeware/WebReplay2/WebReplay2/WebReplaySDK.htm#WebReplay_SimulateTextInput" target=_blank>WebReplay_SimulateTextInput("Text1", "NewValue1");
break;
case 2:
// Submit form by clicking on a submit button
"http://perso.wanadoo.fr/replay.grasse/freeware/WebReplay2/WebReplay2/WebReplaySDK.htm#WebReplay_SimulateHTMLElementClick" target=_blank>WebReplay_SimulateHTMLElementClick("OK");
break;
default:
// Automatically exit from scenario
"http://perso.wanadoo.fr/replay.grasse/freeware/WebReplay2/WebReplay2/WebReplaySDK.htm#WebReplay_SetStateNext" target=_blank>WebReplay_SetStateNext(-1);
break;
}
}
This function implements a state-machine based on the global variable The utility function WebReplayScenarioAuto() can ease the process of building scenario - its input is a simple array of states (the state-machine is already implemented - no need to manage the function WebReplayScenario()
{
"http://perso.wanadoo.fr/replay.grasse/freeware/WebReplay2/WebReplay2/WebReplaySDK.htm#WebReplayScenarioAuto" target=_blank>WebReplayScenarioAuto(
[
// State 1: Navigate to the test Page
// (uses an anonymous function definition)
[ null, function () { "http://perso.wanadoo.fr/replay.grasse/freeware/WebReplay2/WebReplay2/WebReplaySDK.htm#WebReplay_Navigate" target=_blank>
WebReplay_Navigate(
"http://localhost/WebReplay2/WebReplay2Scenario1_step1.asp") }],
// State 2: Type in some text in a form field named Text1
[ "Text1", "NewValue1" ],
// State 3: Submit form by clicking on a submit button named "OK"
[ "OK" ],
// State 4: Type in some text in a form field named Text21
[ "Text1", "NewValue2" ],
// State 5: Submit form by clicking on a submit button named "OK"
[ "OK" ],
// State 6: Wait for next page's title:
// <h2>Form Submit Debugger</h2>
// Set state to -1 (end) when the control is found.
[ null, function () { "http://perso.wanadoo.fr/replay.grasse/freeware/WebReplay2/WebReplay2/WebReplaySDK.htm#WebReplay_WaitForHTMLControl" target=_blank>
WebReplay_WaitForHTMLControl("h2", "innerText",
"Form Submit Debugger", -1) } ]
]
);
}
A complete JavaScript SDK is available to build the scenario files; and of course, you can extend the SDK with your own JavaScript code... To build a scenario file, you need to basically know the names (or ids) of the HTML elements within your web application (using the function WebReplay_FindHTMLControlWithName). Alternatively, you can use the content (text) of a control to interact with it (using functions WebReplay_FindAnchorWithText, WebReplay_FindButtonWithText, or WebReplay_FindHTMLControlFromText). You can interact with the HTML controls using these three functions:
Points of interestAlthough it's a complete re-write (v2.1 has nothing to do with Web Replay v1.0), the TODO list is still long. Web Replay 2 TODO list
History
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||