Вы находитесь на странице: 1из 536

USER GUIDE

e-Tester User Guide


Version 5.1
Empirix, Inc.
Copyright Notice
Notice

Copyright 1997-2001 Empirix Inc. All rights reserved. The contents


of this document and the associated e-TEST suite software are the
property of Empirix Inc. and are copyrighted. No part of this document
may be copied or distributed, transmitted, transcribed, stored in a
retrieval system, or translated into any human or computer language, in
any form, or by any means, electronic, mechanical, magnetic, manual, or
otherwise, or disclosed to third parties without the express written
permission of Empirix Inc.
Printed in the United States of America

Trademarks
Data Bank Wizard, e-Manager, e-Reporter, e-Spider, e-TEST, e-Tester,
d-Tracker, ServerStats, TrueLoad, and Visual Scripts, are all trademarks or
service marks and e-Load and e-Monitor, are registered trademarks of
Empirix Inc in the United Stats and other countries. Microsoft is a
registered trademark and Windows, Visual C++, Visual J++, and Visual
Basic are trademarks of Microsoft Corporation. Java is a trademark of
Sun Microsystems. Pentium is a registered trademark of the Intel

Corporation. All other names are used for identification purposes only
and may be trademarks of their respective owners.

Empirix Inc.

1430 Main St.


Waltham, MA 02451
Ph: 781-993-8500
Fax: 781-993-8600
Web: http://www.empirix.com
Email: webtest@empirix.com
USA, Japan, Singapore, UK/Europe

To contact a local Empirix office, visit our Web site at www.empirix.com

Contents

Contents
Preface
About This Guide ........................................................................................xvii
Related Documentation.................................................................................xix
e-TEST Suite Printed Manuals ............................................................xix
Other Printed Manuals .......................................................................... xx
Electronic Documentation...................................................................... xx
Using Help ...................................................................................................xxi
Conventions..................................................................................................xxii
Obtaining Technical Support .....................................................................xxiii
Chapter 1

Introduction
Feature Highlights...........................................................................................1
Automatic Test Generation..............................................................................2
Visual Scripts ....................................................................................................3
e-Test Programming Interface ........................................................................4
e-Spider and Automatic Script Generation......................................................4
The Data Bank Wizard....................................................................................4
Specialized Web Server Testing ......................................................................5
Real Time Visual Test Results Analysis ..........................................................5
System Requirements .......................................................................................6

Contents

iii

Contents

Chapter 2

e-Tester Basics
Installing and Starting e-TEST suite ..............................................................7
Main Window Features...................................................................................8
Overview of the Menu Options................................................................8
Visual Script Pane ...................................................................................19
Browser Pane...........................................................................................21
Test Scriptlet Editing Pane.....................................................................22
Playback Results Pane ............................................................................23
Status Bar ................................................................................................23
Microsoft Visual Basic IDE ...................................................................24
Java Console ............................................................................................25
Browser Specific Visual Scripts......................................................................25
Setting Preferences.........................................................................................26
Configuring e-Tester to Use a Proxy Server .................................................27
Using Workspaces .........................................................................................28
Adding a New Workspace......................................................................29
Opening a Workspace.............................................................................30
Closing a Workspace ..............................................................................30
Deleting a Workspace.............................................................................31

Chapter 3

Recording and Playing Back Visual Scripts


Recording Visual Scripts................................................................................34
Recording Visual Scripts Manually........................................................34
Recording a Page Snapshot ....................................................................37
Recording Visual Scripts Using e-Spider...............................................38
Recording DHTML Event Handlers ..................................................41
Recording Manual Navigation...............................................................43
Recording from an External Window ....................................................44
Recording Anchor Transitions ...............................................................45
Recording Pages with META Refresh Tags.........................................45
Recording Auto Pages ............................................................................46
Recording Sites that Require User Authentication ................................47
Saving Visual Scripts...............................................................................48
Generating Netscape Scripts...................................................................48

iv

e-Tester User Guide

Contents

Playing Back Visual Scripts ...........................................................................49


Playing Back the Entire Visual Script ....................................................50
Playing Back a Specific Page..................................................................50
Playing Back with Recorded Delay ........................................................50
Playing Back Visual Scripts Multiple Times .........................................51
Playing Back with Data Banks ...............................................................53
Playing Back a Specific Data Bank Record............................................55
Playing Back Visual Scripts on a Different URL ..................................57
Playing Back Visual Scripts in Netscape ................................................58
Viewing Playback Results .......................................................................59
Handling Unexpected Windows During Recording/Playback ...................60
Setting Playback Options...............................................................................61
Setting Netscape Options .......................................................................64
Setting Event Recording Options ..........................................................65
Setting Event Playback Options.............................................................67
Setting Java Options ...............................................................................68
Defining Exclusions to Playback Comparisons ............................................69
Excluding a Range of HTML Source...................................................74
Chapter 4

Working with Visual Scripts


Viewing Visual Scripts....................................................................................75
Changing the Visual Script Pane Width ................................................75
Expanding and Collapsing the Visual Script..........................................75
Overview of Visual Script Nodes............................................................77
Exporting Visual Scripts .........................................................................79
Editing Visual Scripts ....................................................................................80
Copying Pages.........................................................................................80
Moving Pages .........................................................................................80
Appending a Page ...................................................................................80
Deleting Pages ........................................................................................81
Adding Comments..................................................................................81
Deleting Visual Scripts............................................................................82
Working with Default Tests ..........................................................................83
Modifying Default Tests for All Pages..................................................83
Modifying Default Tests for a Specific Page.........................................84
Turning Off Default Tests for a Specific Node.....................................84
Turning Off Existence Tests for a Specific Node..................................85

Contents

Contents

Running Resource Validation ........................................................................85


Running Resource Validation Manually................................................85
Exporting Resource Validation Results..................................................87
Setting the Resource Validation Playback Option .................................88
Turning Off Validation Tests for a Node ..............................................89
Setting Resource Validation Options......................................................89
Working with Visual Script Properties..........................................................90
Viewing Visual Script Node Properties ..................................................90
Basic Node Properties.............................................................................91
ActiveX Properties ..................................................................................92
Address Node Properties........................................................................93
Cookies Properties ..................................................................................94
Custom Page Programmability Properties.............................................96
External Callout Test Properties ............................................................97
Form Element Properties .......................................................................99
Form Element Test Properties .............................................................100
Form Node Properties..........................................................................101
HTML Node Properties .....................................................................102
Image Node Properties .........................................................................103
Java Applet Properties...........................................................................104
Link Node Properties ...........................................................................105
Page Node Properties ...........................................................................106
Panel Properties ....................................................................................107
Parameter Properties.............................................................................108
Script Node Properties..........................................................................109
Server Response Test Properties...........................................................110
Test Scriptlet Properties........................................................................112
Text Matching Test Properties ............................................................113
WML Properties ..................................................................................114
Chapter 5

Using Test Cases


Using Text Matching Tests ........................................................................116
Adding a Text Matching Test Case .....................................................117
Using a Text Matching Test Case to Verify a Data-Driven Test .......118
Editing Text Matching Test Cases ......................................................123
Adding Text Matching Test Cases to the Library...............................123
Using Text Matching Test Cases from the Library ............................124

vi

e-Tester User Guide

Contents

Deleting Text Matching Test Cases from the Library ........................124


Deleting Text Matching Test Cases from the Script ...........................124
Using Server Response Tests.......................................................................125
Adding a Server Response Test Case ...................................................126
Editing Server Response Test Cases ....................................................127
Deleting Server Response Test Cases from the Script .........................127
Using Form Element Test Cases ................................................................128
Adding a Form Element Test Case......................................................129
Form Element Test Case Expressions .................................................130
Using Test Scriptlets....................................................................................131
Using External Callout Test Cases..............................................................133
External Callout Test Cases..................................................................133
Using Custom Tests ....................................................................................137
Using the Custom Test Wizard ...........................................................137
Using Wizard-Generated Code ...........................................................150
Chapter 6

Working with Test Results


Locating and Viewing Test Results .............................................................153
Locating Failures in Visual Scripts.......................................................154
Viewing HTML Differences ...............................................................154
Viewing JavaScript/VBScript Differences ............................................155
Accepting and Discarding Tested Pages.....................................................156
Accepting Tested Pages........................................................................156
Discarding Tested Pages ......................................................................156
Ignoring Specific Failures and Test Cases ..................................................157
Ignoring Specific Failures on Playback................................................157
Ignoring a Specific Test Case on Playback ..........................................157
Using the Results Log .................................................................................158
Analyzing Results Log Timelines ........................................................159
Setting Results Log Options.................................................................161
Showing and Hiding the Results log Pane...........................................162
Selecting a Visual Script Page from the Results Log ...........................162
Viewing Resource Validation Results from the Results Log ...............162
Appending to the Results Log..............................................................163
Exporting the Results Log....................................................................163
Saving Results Log Files ......................................................................164
Overwriting Results Logs.....................................................................164

Contents

vii

Contents

Clearing the Results Log Window .......................................................164


Viewing Saved Results Logs in e-Tester ..............................................165
Exporting Saved Results Logs .............................................................166
Viewing Saved Results Logs in a Browser ...........................................166
Deleting Results Logs...........................................................................167
Setting Error Recovery Options ..................................................................168
Changing Error Recovery Settings.......................................................170
Chapter 7

Using e-Spider
Main Window Features...............................................................................172
File Menu .............................................................................................172
Edit Menu.............................................................................................173
Run Menu.............................................................................................173
Tools Menu...........................................................................................173
Help Menu ...........................................................................................174
Address Line .........................................................................................174
Site Map Tree .......................................................................................174
Status Bar ..............................................................................................175
Setting Maximum Navigation Depth..........................................................175
Working with e-Spider.................................................................................175
Starting e-Spider ...................................................................................175
Pausing and Resuming e-Spider ..........................................................176
Stopping e-Spider..................................................................................176
Appending Pages to the Tree ...............................................................176
Deleting Pages from the Tree...............................................................177
Excluding URLs in e-Spider ...............................................................178
Modifying an Excluded URL .............................................................179
Ignoring a Page in the Tree..................................................................179
Ignoring All But the Current Page in the Tree....................................179
Generating a Visual Script from e-Spider.............................................180
Working with Map Files .............................................................................181
Saving Map Files ..................................................................................181
Creating a New Map File.....................................................................181
Opening an Existing Map File ............................................................181
Exporting the Site Map Tree................................................................182

viii

e-Tester User Guide

Contents

Chapter 8

Using Data Banks


Using the Data Bank Wizard ......................................................................183
Data Bank Variables Tab......................................................................184
Data Binding Tab .................................................................................186
Auto Map and Auto Bind.....................................................................187
Working with Data Banks ...........................................................................188
Creating a Data Bank File ....................................................................188
Recording a Visual Script to Use with a Data Bank ............................189
Mapping Variables to Visual Script Parameters...................................189
Using Internal Variables .......................................................................191
Binding External Variables to Data Bank Fields .................................197
Playing Back a Range of Data Bank Records ......................................199
Playing Back a Specific Data Bank Record..........................................200
Using Data Banks with Java Applet Text Fields .................................201
Using Data Banks with Java Applet KeyListener................................205
The Difference Between Play and Iterate Using Data Banks .............210

Chapter 9

Using Admin Options


Using the Test Library ................................................................................211
Test Library Options ............................................................................212
Adding Text Matching Tests Case to the Library...............................212
Removing Text Matching Test Cases from the Library .....................213
Using the Dialog Manager..........................................................................213
Overview of the Menu Options............................................................214
Overview of the Dialog List .................................................................215
Overview of the Dialog Information ....................................................216
Starting the Dialog Manager................................................................217
Capturing Dialog Information .............................................................217
Specifying Dialog Information .............................................................218
Editing Existing Dialog Information...................................................219
Changing Dialog Evaluation Priority ..................................................219
Using the Authentication Manager.............................................................220
Adding a Record ...................................................................................221
Modifying a Record..............................................................................221
Removing a Record...............................................................................221

Contents

ix

Contents

Working with Workspaces, Scripts, and Logs............................................222


Creating New Workspaces ...................................................................222
Deleting Workspaces ............................................................................223
Deleting Visual Scripts..........................................................................223
Deleting Logs........................................................................................224
Chapter 10

Using the Programming Interface


Overview of Testing Extensibility ...............................................................226
Extensibility Levels Overview ..............................................................227
Level 1: Visual Scripts ..........................................................................228
Level 2: User-Defined Test Cases & Data Banks...............................229
Extending Visual Script Capabilities with Programming ....................230
Level 3: Test Scriptlets .........................................................................231
Level 4: Custom Code in Visual Basic .................................................232
Level 5: External Callout Tests ............................................................235
Level 6: External Programs..................................................................236
Visual Script Programming .........................................................................238
Test Scriptlets........................................................................................238
Custom VBA Tests ...............................................................................238
External Callout Tests...........................................................................238
About Visual Script Navigation ...................................................................239
About Thick Client and Thin Client ...........................................................240
Working with Document Objects ...............................................................241
About the Document Object Hierarchy...............................................241
About Document Object Methods.......................................................243
About Document Object Properties.....................................................243
About Dynamic HTML Events..........................................................245
How the e-PI Accesses Web Page Objects.................................................246
Getting the Document Object ..............................................................246
Finding HTML Elements...................................................................248
Setting Properties Using the Object Model ........................................250
Getting Data Bank Values ...........................................................................251
Setting Up Data Bank Files .................................................................251
Setting Up Visual Script Variables .......................................................252
Getting Data Bank Values Using the e-PI...........................................253
How e-Tester Gets Data Bank Records...............................................254
Setting Data Bank Values Using the e-PI............................................255

e-Tester User Guide

Contents

Using Test Scriptlets....................................................................................256


Web Page Scripting vs. Test Scriptlets ................................................257
Variables and Error Handling..............................................................258
Editing Test Scriptlets ..........................................................................258
Debugging Test Scriptlets ...........................................................................259
Debugging With the Microsoft Script Debugger ...............................259
Debugging with the Microsoft Development Environment ...............261
Creating Custom Visual Basic Tests............................................................265
Using Custom Programmability ..........................................................265
Variables and Error Handling..............................................................270
Editing Custom VBA Tests..................................................................271
Inheriting VBA Code from a Saved Visual Script................................271
Sharing Code Between Visual Scripts...................................................272
Debugging with the VBA Development Environment .......................272
Creating External Callout Tests ..................................................................276
Basic Procedure.....................................................................................276
Using the Sample Visual Basic Project.................................................276
Determining the Name of the External Callout Server........................279
Specifying the External Callout Server in e-Tester?.............................280
Testing External Callout Server Communication with e-Tester .........280
How External Callout Servers Get Called ...........................................280
Identifying Pages in the External Callout Server.................................280
Return Values to e-Tester .....................................................................281
External Program Control ...........................................................................281
Webanlst.Exe COM Server .................................................................281
RSWMint.Exe COM Server...............................................................282
RswIProgsLib Type Library................................................................282
Referencing the Object .........................................................................283
Defining Object Variables ....................................................................283
Assigning the Object Reference............................................................284
Opening Workspaces............................................................................284
Playing Back a Visual Script .................................................................284
Monitoring Script Events.....................................................................285
Closing e-Tester ....................................................................................285
Releasing the Object Variables .............................................................285
About Minimum e-Tester ....................................................................286
About Full e-Tester ..............................................................................286
Contents

xi

Contents

Appendix A

Internet Status Codes


Server Status Codes......................................................................................287
Internet Codes ..............................................................................................291
Additional Information .........................................................................298

Appendix B

Programming Reference
Webanlst.Exe COM Server ........................................................................299
ProgT Class...........................................................................................300
RswEobj Class.......................................................................................301
RSWMint.Exe COM Server......................................................................303
ProgX Class ..........................................................................................303
RswEobj Class.......................................................................................304
RswIProgs Type Library .............................................................................304
IProg Class............................................................................................304
IProgAction Class.................................................................................305
IProgNav Class.....................................................................................306
IProgOM Class ....................................................................................306
IProgPlay Class.....................................................................................307
Playback Results Constants ..................................................................309
Error Constants.....................................................................................310
Status Constants ....................................................................................311
VBADLL Type Library ..............................................................................311
RSWApp Class .....................................................................................312
RSWAppOM Class..............................................................................314
RSWVBAPage Class............................................................................315
RSWVBAScript Class ..........................................................................315
RSWVBATest Class.............................................................................316
VBAGlobalObject Class .......................................................................317
Product Constants.................................................................................317
AfterPlay Event............................................................................................318
AmIWAPScript Method.............................................................................319
Back Method................................................................................................320
BeforeAction Event......................................................................................322
BeforePlay Event..........................................................................................324
Cancel Property............................................................................................325

xii

e-Tester User Guide

Contents

ChangeCurrentPage Method ......................................................................327


ChangeNavigation Method .........................................................................329
ChangeNavigation Method .........................................................................331
CurrentPageNumber Property ....................................................................331
DoPage Method...........................................................................................333
DoRegExpMatch Method ..........................................................................334
DoRV Method .............................................................................................335
DoScript Method.........................................................................................339
EndPlay Event .............................................................................................340
ErrDescription Property ..............................................................................341
ErrNumber Property ...................................................................................343
EventClass Property.....................................................................................345
EventContext Property ................................................................................346
EventElem Property ....................................................................................348
EventType Property.....................................................................................350
ExecutingProduct Property .........................................................................352
FindDoc Method.........................................................................................353
FindElement Method ..................................................................................356
FindElements Method ................................................................................361
FindElementValue Method.........................................................................364
FindInHtml Method...................................................................................368
FireEvent Method .......................................................................................370
Gen Property ................................................................................................372
GetCookies Method.....................................................................................374
GetCurrentVuId Method ............................................................................376
GetDataBank Method .................................................................................377
GetDataBankSize Method...........................................................................379
GetDataBankValue Method ........................................................................380
GetDocuments Method ...............................................................................383
GetElementByPath Method........................................................................384
GetHtml Method.........................................................................................387
GetOriginalHtml Method...........................................................................389
GetParameters Method................................................................................390
GetParameterValues Method ......................................................................391
GetRecordedPostdata Method ....................................................................394
GetRecordedUrl Method ............................................................................397
GetTopDocument Method..........................................................................399
GetTopDocuments Method ........................................................................401
Contents

xiii

Contents

GoBack Method...........................................................................................403
GotoPage Method........................................................................................404
Halt Method ................................................................................................406
HasCustomTests Method ...........................................................................407
Index Property..............................................................................................408
InsertNav Method .......................................................................................410
IterateScript Method....................................................................................412
IterationCount Method................................................................................413
IterationsBegin Event ..................................................................................414
IterationsEnd Event.....................................................................................415
LastDialogText Method..............................................................................416
LastDialogTitle Method..............................................................................417
Length Property ...........................................................................................418
MatchHtml Method....................................................................................419
MatchPattern Method.................................................................................420
Nav Property ................................................................................................421
Navigate Method .........................................................................................423
Om Property ................................................................................................425
OpenScript Method.....................................................................................427
OpenWorkspace Method ............................................................................428
PageBegin Event..........................................................................................429
PageEnd Event ............................................................................................431
PageUId Property........................................................................................433
PerformTest Event.......................................................................................434
Play Property................................................................................................435
PlaySuspended Event...................................................................................436
Postdata Property .........................................................................................437
Quit Method ................................................................................................438
ReplaceNav Method ....................................................................................439
RSWApp Property.......................................................................................440
SaveScript Method.......................................................................................441
ScriptBegin Event ........................................................................................443
ScriptClose Event.........................................................................................444
ScriptEnd Event...........................................................................................445
ScriptLength Property .................................................................................447
ScriptName Property ...................................................................................448
ScriptOpen Event.........................................................................................449
ScriptRename Event ....................................................................................450
xiv

e-Tester User Guide

Contents

ScriptSave Event ..........................................................................................451


SetBehaviour Method ..................................................................................452
SetCookies Method......................................................................................454
SetCurrentDataBankRecord Method .........................................................456
SetDataBankValue Method .........................................................................457
SetOptions Method......................................................................................461
SetParameterValues Method .......................................................................462
StartPlay Event.............................................................................................464
StateOf Method ...........................................................................................465
TestLog Method..........................................................................................466
TimeToNavigate Property...........................................................................467
TransitionEnd Event ...................................................................................468
URL Property..............................................................................................470
WriteToLog Method...................................................................................471
Appendix C

HTML and DHTML Resources


Web Resources.............................................................................................473
Elements Defined by HTML.....................................................................474
Objects Defined by Dynamic HTML........................................................475
Collections Exposed by Dynamic HTML .................................................477
Properties in Dynamic HTML...................................................................477
Methods in Dynamic HTML ....................................................................482
Events in Dynamic HTML ........................................................................484
Appendix D

Regular Expressions
MetaCharacters ............................................................................................485
I n d e x ........................................................................................................491

Contents

xv

Contents

[This page intentionally left blank]

xvi

e-Tester User Guide

Preface
Welcome to the e-Tester User Guide. This guide explains how to use the
features and options of e-Tester for testing Web pages or applications.
This guide is intended for Web test engineers who will be developing
e-Tester Visual Scripts for regression and performance (load and
scalability) testing of a Web site or application. The guide does require an
understanding of software or Web application testing concepts. Test
engineers using e-Tester should be familiar with the concepts of
regression testing, load testing, scalability testing, and operational
monitoring.
The record/playback paradigm of e-Tester does not require any
programming experience to develop Visual Scripts for testing. However,
the advanced programmability features available in e-Tester do require
experience with programming languages such as VBScript and Visual
Basic. The programming sections of this manual assume that you
understand programming concepts in VBScript and Visual Basic.

About This Guide


This guide contains the following chapters and appendixes:
Chapter 1 Introduction: provides an overview of the major features of

e-Tester.
Chapter 2 ee-Tester Basics: provides descriptions of the e-Tester main

window features and menu options.


Chapter 3 Recording
Recording and Playing Back Visual Scripts: explains how to

record and play back Visual Scripts.


Chapter 4 Working with Visual Scripts: explains how to view and edit

Visual Scripts, modify default tests, run Resource Validation, and work
with script node properties.
xvii

Preface

Chapter 5 Using Test Cases: explains how use built-in test cases and
how to create your own programmatic tests.
Chapter 6 Working with Test Results: explains how to locate and view

playback differences and how to accept or discard differences. It also


explains how to use the Results Log and set error recovery options.
Chapter 7 Using ee-Spider: explains how to use e-Spider to map web
pages or applications automatically. It also explains how to generate a
Visual Script from an e-Spider map.
Chapter
Chapter 8 Using Data Banks: explains how to create and use external

data sources with Visual Scripts.


Chapter 9 Using Admin Options: explains how to manage the Test

Library, set up unexpected dialog box handling, and how to define user
names and passwords for specific URLs. It also explains how to create and
delete Workspaces, and how to delete Visual Scripts and Results Logs.
Chapter 10 Using the Programming Interface: explains how to extend

your testing capabilities using the e-Test Programming Interface with


standard programming languages, such as VBScript, Visual Basic, Java,
and C++ to extend the capabilities of Visual Scripts.
Appendix A Internet Status Codes: lists the status codes and Internet

error codes that can be returned from a server.


Appendix
Appendix B Programming Reference: provides a detailed reference for
the procedures, properties, methods, and events that you can use when
creating your own customized tests for use with e-Tester.
Appendix C HTML
HTML and DHTML Resources: lists the HTML elements and

DHTML objects, collections, and properties that can be used when creating

Web pages. The lists are provided as a convenient resource when using the
e-Test Programming Interface (e-PI) to create Test Scriptlets, Custom VBA
tests, and External Callout tests for Visual Scripts.
Appendix D Regular Expressions: provides a reference for Regular
Expression syntax.

xviii

e-Tester User Guide

Preface

Related Documentation
The e-TEST suite includes a complete set of printed manuals, electronic
manuals, and online help.

e-TEST Suite Printed Manuals


The e-TEST suite includes the following printed manuals:
Getting Started with e-TEST suite introduces the software tools in the
e-TEST suite and provides step-by-step tutorials for e-Tester, e-Manager,
e-Monitor, and e-Load (which includes ServerStats and e-Reporter).
e-Tester User Guide explains how to use the features and options of
e-Tester to create Visual Scripts for regression/performance testing and
monitoring of Web sites or applications. This guide also includes
reference information for using the e-Tester Programming Interface for
expanding Visual Script capabilities using Visual Basic for Applications
(VBA).
e-Tester for WAP User Guide explains how to use the Wireless
Application Protocol recording features of e-Tester. This manual is a
supplement to the e-Tester User Guide and is included only if you have
the WAP enabled version of e-Tester.
e-Manager User Guide explains how to use the features and options of
e-Manager to schedule and play back multiple Visual Scripts for
regression testing of Web sites or applications. e-Manager uses the Visual
Scripts developed by e-Tester.
e-Monitor User Guide explains how to use the features and options of
e-Monitor to perform periodic or continuous monitoring of Web sites
and related servers. e-Monitor uses the Visual Scripts developed by
e-Tester.
e-Load User Guide explains how to use the features and options of
e-Load to simulate multiple users accessing a Web site or application for
performance testing. e-Load uses the Visual Scripts developed by
e-Tester.

Preface

xix

Preface

ServerStats User Guide explains how to use the features and options of
ServerStats to monitor operational performance of a variety of application
servers, Web servers, database servers and systems.
e-Reporter User Guide explains how to use the features and options of
e-Reporter and WebReporter to generate graphs and reports for e-Load,
e-Monitor, and ServerStats performance data.

Other Printed Manuals


In addition to the e-TEST suite documentation set, the following printed
manuals are available with the d-Tracker product:
d-Tracker User Guide explains how to use the features and options of
d-Tracker for issue/defect tracking and management.
d-Tracker Administrator Guide explains how to use the administrative
features and options of d-Tracker for customizing the terminology and
appearance of d-Tracker for your organizations requirements.

Electronic Documentation
The e-TEST suite download from our Web site automatically installs an
Adobe Portable Document Format (PDF) version of the Getting Started
with e-TEST suite manual and an e-Spider Tutorial. These documents
require the Adobe Acrobat Reader, version 4.x, to open and view the
.PDF files. You can download the free Acrobat Reader from the Adobe
Web site: http://www.adobe.com/products/acrobat/readstep2.html.
The Getting Started with e-TEST suite PDF file is an option on the
e-TEST suite Start menu. The e-Spider Tutorial PDF file is copied to the
e-TEST suite installation directory (C:\Empirix\eTEST is the default).
The installation also includes a readme.doc file that contains release notes
and the latest updates to the product documentation. The readme.doc file
opens in Microsoft Wordpad when you select the Release Notes option
on the e-TEST suite Start menu. Also included is an e-Monitor v5.0 to
v5.1 conversion documentation (Wm50-51Conv.pdf) file that explains how
to migrate existing 5.0 Shell Scripts to 5.1 jobs and schedules.
The full e-TEST suite documentation set is provided on the product CDROM in Adobe Portable Document Format (PDF). You can use the
xx

e-Tester User Guide

Preface

Acrobat Reader, version 4.x, to view, search, and print the documentation
set. The e-TEST suite CD-ROM includes the Acrobat Reader application.
You can install Acrobat Reader using the e-TEST suite CD-ROM setup
program or by selecting ar40eng.exe in the Acrobat Reader directory. See
the Adobe Web site, http://www.adobe.com, for additional information
about Acrobat Reader.
The full documentation set includes the following files:
E e-Test Suite Getting Started.pdf
E e-Tester User Guide.pdf
E e-Tester for WAP User Guide.pdf
E e-Manager User Guide.pdf
E e-Monitor User Guide.pdf
E e-Load User Guide.pdf

E WebReporter User Guide.pdf


E e-Spider Tutorial.pdf
E d-Tracker User Guide.pdf
E d-Tracker Administrator Guide.pdf
E readme.doc
E Wm50-51Conv.pdf

All of the .PDF files are in the Documentation directory of the product
CD-ROM. The e-Test Suite Getting Started.pdf, e-Spider Tutorial.pdf,
WM50-51Conv.pdf, and readme.doc files are installed during the e-TEST
suite setup procedure. You can copy the user guide .PDF files to a local
drive or open them in Acrobat Reader from the CD-ROM.
If you downloaded the product from the our Web site and wish to receive
electronic versions of the User Guides in .PDF format, please send an
email message to webtest_support@empirix.com. Youll need the Acrobat
Reader v4 to open and view the documents.
The e-TEST suite CD-ROM also includes the Microsoft Visual Basic
Scripting Edition (VBScript) Language Reference documentation. You
can install the files using the e-TEST suite CD-ROM setup program or by
selecting vbsdoc.exe in the MS VB Script Documentation directory.

Using Help
e-Tester provides a comprehensive on-line help system. The help topics
include step-by-step how to instructions for common tasks and a
complete reference.
You can press the F1 key at any open dialog box for an explanation of the
options. You can select Help Contents to open the on-line help contents
and index.

Preface

xxi

Preface

Conventions
This guide uses the following typographical conventions to identify
specific items:
Convention

Description

Bold Sans Serif

Menu options and dialog box text.

Sans Serif Underlined

Web page hyperlinks.

Sans Serif

File names, Visual Script nodes,


dialog box option selections.

Fixed-Pitch type

Program code.

Fixed-Pitch Italic type

User-specified program code


parameters.

Arrow between menu options.

Select each option in sequence.

Icon.

xxii

An Event procedure in the Visual


Basic programming language.

Icon.

A Method procedure in the Visual


Basic programming language.

Icon.

An Object Property in the Visual


Basic programming language.

e-Tester User Guide

Preface

Obtaining Technical Support


If you have questions about e-TEST suite, first look in this guide, the
online Help, and the release notes delivered with the software.
You can also check our Web site for the latest information about upgrades
and other issues at http://www.empirix.com.
If you wish to contact Empirix Web Test + Monitoring Support, please
use the following contact numbers and email addresses:
Tel.

North America: (781) 993-8562 (8 a.m. to 8 p.m. EST)


Europe: +44 (0) 1344 668413 (8:30 - 18:00 GMT)
Japan: 81-3-3791-5353

Fax.

North America: (781) 993-8600

Email

North America: webtest_support@empirix.com


Europe: europe_webtest_support@empirix.com

Key Requests: To request a software license key, please call (781) 9938500 or send your request via email to keys@empirix.com.

Preface

xxiii

Preface

[This page intentionally left blank]

xxiv

e-Tester User Guide

Chapter 1

Introduction
e-Tester is a functional test tool that lets you easily create, maintain, and
execute regression testing scripts for your Web-based applications.
e-Tester features a powerful, intuitive Visual Script, an automated test
case generator, a specialized text matching component and the ability to
execute data-driven tests using the Data Bank Wizard.
The development of the World Wide Web and the popularity of Webbased applications require a new generation of automated test tools.
e-Tester is an integrated framework on which to build automated tests
specifically for this new paradigm in software technology. e-Tester is
designed to deliver an immediate improvement to the quality of your
software by offering repeatable, measurable results that help keep pace
with the application development cycle.

Feature Highlights
e-Tester offers the following advantages for Web-based application
testing:
E Visual Script Technology/Automatic Test Generation you can record

and test your entire application in minutes with reusable, objectoriented Visual Scripts. Recorded Visual Scripts automatically capture
and test Anchors, Elements, Forms, Frames, HTML, Images, Image
Maps, Links, ActiveX controls, Java Applets, VBScript, and
JavaScript. Visual Scripts require no programming.

E Graphical Test Results and Simple Script Updating test failures and

HTML differences are indicated by red flags annotated within the

Visual Scripts for rapid diagnoses of application errors. Visual Scripts


can be updated to reflect changes to the application with the click of a
button.
1

Automatic Test Generation

E e-Spider automatically maps your entire site and creates Visual

Scripts for all or part of your application.

E Data Bank Wizard create data-driven tests without programming. A

single Visual Script can be used over and over with varying input and
response data using values from an external data source.

E Visual Test Case Insertion additional test cases can be added to Visual

Scripts to verify server response times, form elements, and the presence
or absence of specific text in a page.

E HTTPs and SSL Support supports all popular protocols as well as

certificates.

E BuiltBuilt-in Application Server Support automatically manages session

variables for Net Dynamics, BroadVision, WebObjects, ColdFusion,


and Microsoft ASP platforms.

E Broad Extensibility with Standard Languages Visual Scripts can be

extended though custom Visual Basic for Applications (VBA) code,


Test Scriptlets, and external tests with your custom code written in
Visual Basic, VBScript, C++, or Java.

E High Throughput Resource Validation automatically collects and

verifies all referenced Web resources that include links and images.

E Test Case Librarian


Librarian allows you to create and store re-useable test cases

for use across multiple test scripts.

Automatic Test Generation


e-Tester maximizes your productivity by virtually eliminating the need for
programming. A Visual Script is recorded to capture your interaction with
the Web application-under-test. A series of default test cases are
automatically generated and added to the Visual Script. The default tests
are designed for Anchors, Elements, Forms, Frames, HTML, Images,
Image Maps, Links, ActiveX controls, Java Applets, VBScript, and
JavaScript. Custom test cases can be added to the Visual Scripts to suit
your specialized requirements.
In addition, you can add text matching test cases to detect the presence or
absence of complex phrases embedded inside the HTML of the pages.
2

e-Tester User Guide

Visual Scripts

These user-defined test cases can be stored in the Test Case Librarian for
quick and simple re-use across all visual scripts.
e-Tester provides full testing flexibility and extensibility using the e-Test
Programming Interface. You can access the e-Test Programming Interface
using VBScript Test Scriptlets, custom tests in the integrated Visual Basic
for Applications development environment, an ActiveX Enabled External
Callout Facility, and External Program control. The e-Test Programming
Interface allows you to embed your own testing logic at strategic points in
the recorded script to suit your specialized testing needs. The e-Test
Programming Interface supports many programming environments,
including Microsoft Visual C++, Microsoft Visual Basic, and VBScript.

Visual Scripts
Visual Scripts offer the fastest and easiest way to define tests for Web

applications. Visual Scripts capture the interaction of the user with the
Web application under test. These scripts serve as your baseline and can
be replayed against new versions of your Web application to detect
functional, regression, scalability, and post-deployment defects.
Visual Scripts offer you the power and flexibility to address all the testing
challenges you face in your organization.
E You build a suite of Visual Scripts that serve as the baseline for

regression and functional testing of your entire application.

E A subset of the Visual Scripts that depict different profiles of usages of

your application can be re-used for load testing and scalability testing.

E All of the functional testing scripts that depict correct behavior of your

Web application can be re-used after deployment to monitor your


application 24 hours a day, 7 days a week.

Since Web applications may sometimes require that you have separate
baselines for different browsers, e-Tester allows you to create baselines for
both Internet Explorer and Netscape Navigator.

Chapter 1: Introduction

e-Test Programming Interface

e-Test Programming Interface


As powerful as Visual Scripts are, there may be circumstances where Web
testing requires specialized capabilities to achieve specific test objectives. Some
examples are communicating with external programs or databases, performing
tests that use custom algorithms to verify page content, and performing
conditional navigation of a Web site based upon dynamically changing data.
e-Tester provides testing flexibility and extensibility through the e-Test
Programming Interface (e-PI). The e-PI can be used with standard
programming languages, such as Visual Basic, VBScript, JavaScript, Java,
and C++ to extend the capabilities of Visual Scripts. e-Tester provides
four ways to extend Visual Script testing capabilities using the e-PI:
custom Visual Basic for Applications (VBA) code, Test Scriptlets,
External Callout tests, and External Program Control.

e-Spider and Automatic Script Generation


e-Spider adds a new dimension to the Visual Web Scripting paradigm.
e-Spider automatically searches the HTML pages that make up your Web
site or Web application. e-Spider allows you to quickly and easily generate
a complete and comprehensive regression test with the push of a button.
e-Spider uses advanced techniques and algorithms to determine and
generate a complete mapping of all the HTML pages. You then have the
option of determining the final set of pages to use in generating a Visual
Script. An entire Web application can be mapped, recorded, and tested in
just minutes using e-Spider.

The Data Bank Wizard


The Data Bank Wizard allows you to quickly and efficiently create
automated data-driven tests. Data Banks are used to hold unlimited
amounts of input data that can be automatically fed into your Web
application. e-Tester determines the set of parameters defined by each
page of the Web application in the Visual Script. Users can map these
parameters to values in Data Bank files using the Data Bank Wizard.

e-Tester User Guide

Specialized Web Server Testing

During playback, the parameters in the Web page are filled with values from
the Data Bank file. Data Bank files can be easily created or modified using any
simple text editor, spreadsheet, word processor, or database application.
e-Tester can also be used to automatically generate a Data Bank file from
a Visual Script. Users can create sophisticated unattended regression tests
to thoroughly exercise a Web application by using varied input data from
Data Bank files.

Specialized Web Server Testing


A key component of any Web-based solution is the portion of the
application residing on the Web server that is used to support the Web
client. It is important that the structure and content of each response from
Web servers remain accurate for each of the many different types of
requests originating from a Web client application. e-Tester has been
designed to test the Web server accurately for expected results,
responsiveness, and all unexpected error conditions.
e-Tester based testing is independent of the type of Web server1 and the
operating system2 on which the Web server is running.

Real Time Visual Test Results Analysis


e-Tester presents the contents of each Web page and the test cases
graphically using an intuitive tree format in the Visual Script. This unique
approach allows errors and problems encountered during playback to be
displayed using simple color-coded flags in the Visual Script.
Test results are displayed dynamically in the Visual Script tree as the script is
being played back. In addition, e-Tester shows a summary of the details of
the playback in an output log window as a list of playback events. Users can
double-click on any error event in the output log to advance quickly and
efficiently to the corresponding page in the script. Errors encountered upon
Visual Script playback may either be rejected, ignored using a special mask
feature, or accepted to create a modified baseline script.
1

Includes IIS, Netscape, APACHE, NTSE, and other custom servers.

Includes all UNIX and Microsoft Windows platforms.

Chapter 1: Introduction

System Requirements

System Requirements
e-Tester has the following system requirements:
E Operating System: Microsoft Windows NT 4.0, Windows 2000, or

Windows 98 (e-Tester and e-Manager only). The e-TEST suite is

NOT supported on Windows 95.


E Recommended Memory: Minimum 64 MB; 128 MB recommended.
E Disk Space: 100 MB.
E System: IBM-compatible PC with Pentium Pro or faster processor

recommended

e-Tester User Guide

Chapter 2

e-Tester Basics
This chapter explains how to use the main features of e-Tester. It explains
how to install and start the program and provides a description of the
features of the main window.

Installing and Starting e-TEST suite


There are two ways that you can install e-TEST suite:
1.

From the Empirix, Inc. Web site:

http://www.empirix.com/Empirix/Web+Test+Monitoring/Products
/choose+form.html
E Download the product (ets##-IE4.exe or ets##-IE5.exe) from the

Web site and save it to a temporary directory on your hard disk.

E Run ets###-IE#.exe and follow the setup instructions to install

e-TEST suite.

2.

From the CD:


E Insert the e-TEST suite CD into your computers CD-ROM drive.
E In Windows, click Start Run and browse to the drive letter that

corresponds to the CD-ROM drive.

E Run setup.exe located in the root directory of the CD-ROM.


3.
4.

Follow the setup instructions to install the e-TEST suite.


When the installation is complete, click Start Programs ee-TEST

suite ee-Tester to start e-Tester.

Main Window Features

Main Window Features


The e-Tester main window is where you perform the majority of your
Visual Script development activities. The main window consists of the
menu bar, toolbar, and three panes: the Visual Script pane, Browser pane,
and Playback Results Log pane, which are all fully scrollable.
URL or File Location
Visual Script Pane
Browser Pane

Results Pane

Status Line

The Title bar of the window shows the program name followed by the
current Workspace and Visual Script name.
Directly above the Web Browser pane is a combo box for entering the
URL or file location of the Web page(s) to test. The bottom of the main
window includes a status line.

Overview of the Menu Options


The e-Tester menu has the following options:

The following sections explain each of the menu options and show the
associated toolbar buttons.
8

e-Tester User Guide

Main Window Features

File Menu
These menu options let you work with Visual Script files, workspaces, and
output logs. The following options are available:
New Script creates a new Visual Script.
Open Script opens an existing Visual Script for playback or

modification.
Close Script closes the currently open Visual Script.
Open Workspace opens a different workspace for storing test scripts

and output log information. You create and delete workspaces using the
options on the Admin menu.
Close Workspace closes the currently open workspace.
Save Script saves any changes to the currently open Visual Script. If the

script has not been saved before, e-Tester asks for a filename.
Save Script As saves the currently open Visual Script using a different

filename.
Save Output Log As saves the current Playback Results Log to a file.
Inherit VBA From imports Visual Basic for Applications code from a

saved Visual Script and adds the code to the current Visual Script.
Export Script As exports the currently open Visual Script to an ASCII text

file. The Visual Script hierarchy is written to the text file the same way as
it is expanded or collapsed in the Visual Script pane.
Export Output Log As exports the contents of the Results log pane to an
ASCII text file. You can also export saved Results log files using Results
View Results Log.
Script Comments opens a dialog box for inserting comments about

Visual Script development and modification.


Exit exits e-Tester.

Chapter 2: e-Tester Basics

Main Window Features

Edit Menu
These menu options let you edit Visual Scripts, expand and collapse the
script tree, clear the output log window, and work with the Data Bank
Wizard. The following options are available:
Cut Page cuts the currently selected page from the Visual Script .
Copy Page copies the currently selected page in the Visual Script tree

for pasting in e-Tester.


Paste Page paste a Visual Script page that has been copied to the

clipboard into the current Visual Script.


Delete (item) removes the currently selected item from the Visual Script.
Add Script Comment opens a dialog box for entering a comment for the

currently selected Visual Script page. Page comments appear as a node in


the Visual Script tree. You can add comments to each page of the Visual
Script.
Expand Page expands the Visual Script tree hierarchy for the currently
selected page. You can also expand a page in the Visual Script by clicking
on the icon in the tree.
Collapse Page collapses the Visual Script tree for the currently selected page.
Expand Script expands the entire Visual Script tree.
Collapse Script collapses the entire Visual Script tree.
Switch to IE Baseline switches to the Internet Explorer-specific Visual Script.
Switch to Netscape Baseline switches to the Netscape Navigator-specific

Visual Script.
Clear Output Window removes the current information from the Output

Log window.
Reset To Original State clears any left-over, persistent settings from a

previous recording and playback. Selecting this option resets e-Tester to a


clean start-up state. The default browser window name is reset to none,
persistent cookies are cleared, user authentication is cleared, and any
external browser windows that may have been opened are closed.

10

e-Tester User Guide

Main Window Features

Use this option before loading the page where you want to start recording
into the browser pane. This ensures that the new Visual Script that you
record will not be affected by any left-over persistent settings.
Data Bank Wizard opens the Data Bank Wizard dialog box.
Properties opens the properties dialog box for the currently selected

node in the Visual Script tree.

Run Menu
These options let you record and play back Visual Scripts, generate
Netscape-specific baselines, and run resource validation. The following
options are available:
Record provides options for starting and stopping manual recording of
Visual Scripts and generating Netscape-specific baselines. The following
submenu options are available:
Start

starts recording Visual Scripts.

Stop

stops recording Visual Scripts when in record mode.

Page Snapshot records the state (mouse click events, user input

data, etc.) of the current page in the browser to the Visual Script.
This option is only active if the state of the page has changed since
it was recorded to the Visual Script. For example, if a user clicks on
the page (but not a link to another page), enters text into form
fields, or performs other actions that do not cause a transition to a
new page, the state of the page changes. However, the changed state
is not automatically recorded as part of the Visual Script. The Page
Snapshot option lets you manually record the current state of the
page as part of the Visual Script.
Navigate Manually opens a dialog box for manually specifying the

page URL, target frame, post data and header information for the
next page to record to the Visual Script.
Current Page appends the current page to the Visual Script.
Generate Netscape Script converts the default IE-specific Visual

Script to a new Netscape-specific Visual Script for testing in a


Netscape browser.
Chapter 2: e-Tester Basics

11

Main Window Features

Playback provides options for starting and stopping playback of the

currently open Visual Script. The following submenu options are available:
Start

starts playback of the Visual Script.

Stop

stops playback of the Visual Script.

Current Page plays back the currently selected page in the Visual

Script.
Up to Current Page plays back the Visual Script from the beginning

up to the currently selected page in the Visual Script tree.


Iterate

plays back a Visual Script repeatedly, with or without a


Data Bank.

Resource Validation runs the resource validation test for the currently

open Visual Script.

Tests Menu
These options let you insert and modify test cases in the Visual Script.
The following options are available:
Insert Text Matching Test inserts a test case to match the presence or

absence of a specific text string in a Web page into the Visual Script.
Insert Server Response Test inserts a test case specifying the minimum and

maximum server response time for a page into the Visual Script.
Insert Test Scriptlet Before opens the Test Scriptlet pane for writing code

to use as an extended test for a Visual Script. The code executes before the
page of a Visual Script plays back. Test Scriptlets Before are custom
VBScript code snippets that can be used to access and evaluate the Web
page source, Document Object Model, and page navigation before the
page plays back in the Visual Script. The VBScript that you create is
stored as an internal part of the Visual Script.
Insert Test Scriptlet After opens the Test Scriptlet pane for writing code

to use as an extended test for a Visual Script. The code executes after the
page plays back in the Visual Script. The VBScript that you create is
stored as an internal part of the Visual Script.

12

e-Tester User Guide

Main Window Features

Insert External Callout Test inserts a user-defined external test into the
Visual Script. External Callout tests are programs you create in an
ActiveX .dll. See Chapter 10 and Appendix B of this manual for the
requirements for creating the ActiveX .dll.
Insert Form Element Test
Test inserts a test that performs the specified

alphanumeric comparison on Form element properties and attributes.


Insert Custom Test opens the Custom Test Wizard for defining a

custom test on a Web page element object. The Custom Test Wizard lets
you select the element object directly from the Web page by highlighting
it with the mouse. The wizard also lets you specify the element object
property to test and the type of test to perform. The Custom Test Wizard
generates Microsoft Visual Basic for Applications (VBA) code in the
Microsoft Visual Basic Integrated Development Environment. You can
customize the wizard-generated code for your own specific testing
purposes. Chapter 5 explains how to use the Custom Test Wizard.
Modify Default Tests opens a dialog box where you can set options for

the automatic, built-in, e-Tester test cases. This is available only when a
page is selected in the Visual Script.
Modify Text Matching Test opens a dialog box for changing the options

of a user-inserted Text Matching test case. This option is only active


when a Text Matching test case is selected in the Visual Script.
Modify Server Response Test opens a dialog box for changing the

options of a user-inserted Server Response test case. This option is only


active when a Server Response test case is selected in the Visual Script.
Modify Test Scriptlet Before opens a script editing pane for changing the

Test Scriptlet. This option is only active when a Test Scriptlet Before
node is selected in the Visual Script.
Modify Test Scriptlet After opens a script editing pane for changing the

Test Scriptlet. This option is only active when a Test Scriptlet After node
is selected in the Visual Script.
Modify External Callout Test opens a dialog box for changing the options

of a user-inserted External Callout test case. This option is only active


when an External Callout test case node is selected in the Visual Script.

Chapter 2: e-Tester Basics

13

Main Window Features

Modify Form Element Test opens a dialog box for changing the options

of a user-inserted Form Element test case.


Modify Custom Test opens the Custom Test Wizard for changing the

Custom Test options. This option is only active when a Custom Test node
is selected in the Visual Script.

Browser Menu
These options let you navigate Web pages in the e-Tester Browser. The
following options are available:
Go Back goes back to the previous Web page.
Go Forward goes forward to the next Web page.
Go Home goes to the URL specified in the RSW.INI file for the home page.
Stop stops loading the currently selected Web page.
Show Applet Resource opens a window listing the Java Applet resources

recorded to each page of the Visual Script.


Show Java Console opens the Java console window. This option only
appears if you installed the e-TEST suite with Java support. The Microsoft
VM - Java console enabled setting on the Advanced tab of the Control

Panel Internet Properties must also be selected.


Show Plugin Java Console - enables the Sun Java Plugin console window.
The window does not open immediately when you select the menu option.
The window opens automatically when e-Tester records or plays back a
page with a Java applet. This option is only available if Sun Plugin Applet
Support is enabled in Options Java.
Options opens the Control Panel Internet Properties dialog box.
Search the World Wide Web goes to the URL specified in the RSW.INI
file. The default search engine is http://www.google.com/.

14

e-Tester User Guide

Main Window Features

Results Menu
These options let you locate failures in the Visual Script and accept or
discard tested versions of Visual Script pages. The following options are
available:
View Results Log opens a dialog box for viewing or exporting Results log

files in the current workspace.


View Results
Results Log - HTML opens a browser windows for viewing the

results log in HTML format. The HTML format provides options for
submitting failure information to d-Tracker (if installed).
Find Next Failure jumps to the next failure indicated in the Visual Script.
You can also press the F3 key.
Find Previous Failure jumps to the previous failure indicated in the
Visual Script. You can also press the Shift-F3 keys.
Accept Tested Page accepts the changes detected in the selected Web

page after playback as the new baseline for testing.


Discard Tested Page discards the changes detected in the selected Visual

Script page on playback and retains the recorded baseline for testing.
Accept All Tested Pages accepts all changes detected in the Web pages

by the Visual Script as the new baseline for testing.


Discard All Tested Pages discards all changed Visual Script pages and

retains all of the recorded pages as the baseline for testing.

Options Menu
These selections let you set the options for Visual Script playback, external
callout tests, resource validation, and the results log. The following
options are available:
Playback opens a dialog box for setting the Visual Script playback options.
Error Recovery opens a dialog box for setting the error recovery actions
to perform on failure of tests.
External Callout opens a dialog box for setting the External Callout

OLE Server test options.

Chapter 2: e-Tester Basics

15

Main Window Features

Comparison Exclusions opens a dialog box for setting customized


playback comparison exclusions for dynamic content and overrides to the
automatic exclusions.
Resource Validation opens a dialog box for setting the resource validation

test options.
Results Log opens a dialog box for setting the playback result output log

options.
Netscape opens a dialog box for setting the Netscape related Visual

Scripting options.
Event Playback opens a dialog box for specifying the delay and failure

settings for playback of Dynamic HTML (DHTML) and Java Applet


events.
Preferences opens a dialog box for setting auto save and browser
timeout preferences.
Java opens a dialog box for specifying the pacing mode for Visual Script

playback of Java Applets.


WAP Options opens a dialog box for selecting the Wireless Application

Protocol (WAP) browser to emulate when recording WAP applications.


Event Recording opens a dialog box for specifying DHTML events to

record for specific HTML tags.

Tools Menu
These options let you open other tools in the e-TEST suite. The available
options will depend upon the software you have installed on your system.
The following options may appear on the Tools menu:
WAP Script Recorder - starts and closes the Wireless Application Protocol
browser for recording Visual Scripts for WAP applications. Use Options
WAP Options to specify the WAP browser to emulate.
e-Spider opens the e-Spider window, which allows you to map your site

or Web application.
e-Manager starts the e-Manager application for running multiple Visual

Scripts as a single job.


16

e-Tester User Guide

Main Window Features

e-Monitor starts e-Monitor for creating jobs and schedules that can play
back multiple e-Tester Visual Scripts for monitoring of a Web
application.
e-Load starts the e-Load for performing load and stress testing on Web

applications.
Code View opens the Visual Basic for Applications environment for
developing custom test code. You can also right-click on a Custom Page
Programmability node of a Visual Script to open the VBA environment.
e-Load Quick Test starts e-Load using the current Visual Script as a

Virtual User Scenario Profile.

Admin Menu
These options let you perform administrative tasks on your test library,
workspaces, and scripts. The following options are available:
Test Library opens a dialog box for adding, removing, or modifying Text

Matching test cases.


Dialog Manager opens a window for specifying actions to take to handle

unexpected dialog boxes during playback of a Visual Script.


Authentication Manager opens a window for specifying user name and

password information for use during playback of Visual Scripts.


Configure dd-Tracker Server - opens a dialog box for specifying the server

where d-Tracker is installed and the user name and password to use for
entering issue/defect information.
New Workspace opens a dialog box for creating a new workspace.
Delete Workspace opens a dialog box for selecting the workspace to delete.
Delete Scripts opens a dialog box for selecting the Visual Scripts to delete.
Delete Logs opens a dialog box for selecting the playback results log files

to delete.

Chapter 2: e-Tester Basics

17

Main Window Features

Window Menu
These options let you change the view and size of the panes of the
e-Tester main window. The following options are available:
Resize Visual Script View changes the relative widths of the Visual Script

pane and the Browser pane of the e-Tester main window to make one or
the other more visible.
Resize Output Log View shows or hides the Playback Results Log pane.

Help Menu
These options let you access the e-Tester online help, provide information
about obtaining Technical Support, and show the e-Tester serial number
and current license.

18

e-Tester User Guide

Main Window Features

Visual Script Pane


The Visual Script pane shows the tree hierarchy of recorded Web sites
and pages. When you record Web pages (either manually or using the
e-Spider), e-Tester creates the Visual Script tree for you.
Collapsed Page
Expanded Page

Page Hierarchy

Click

to expand a branch or

to collapse a branch.

The Visual Script tree will include any test cases you insert into the Visual
Script. Each item in the tree is identified by its icon and a text description.

Visual Script Icons


The Visual Script uses additional icons in the tree to represent the following:
- Yellow flag:
skip test.

- Red flag:
test case failure.

- Red and yellow flags:


ignore test failure.

- Yellow flag with


stripe: test skipped at
current node and by
higher level node.

- Red flag with stripe:


test case failure and
failure ignored by
higher level node.

- Red and yellow flags


with stripes: failures
and test ignored by
higher level node.

- Page: current page


being played back.

Chapter 2: e-Tester Basics

19

Main Window Features

Visual Script Popup Menu


When working with Visual Scripts, you can use the popup menu as a
shortcut to various menu options. Right-clicking the mouse when a Visual
Script node is selected opens the popup menu:

The available options will vary depending upon which type of Visual
Script node is selected. The following are examples of the available popup
menu options:
E Toggle the default existence test for Visual Script nodes;
E Expand and collapse Visual Script nodes;
E Load the selected page into the browser pane;
E Modify default tests;
E Accept or discard tested pages generated by Visual Script playback;
E Modify test case options and Test Scriptlets;
E View Visual Script node properties.

Menu items that are dimmed do not apply to the currently selected Visual
Script node.

20

e-Tester User Guide

Main Window Features

Visual Script View


You can toggle the Visual Script pane width using the Window Resize
Visual Script View option or by dragging the border between the Browser
pane and the Visual Script pane.

Browser Pane
The browser pane contains a seamlessly integrated Web browser that you use
to select the Web pages to test. It provides full navigation and Web access.
Enter URL or File Location

Drop Down History List

Web Page in Browser

Enter the full path and file name of the URL or local file, or drop down
the list to select from recently accessed Web pages.

Chapter 2: e-Tester Basics

21

Main Window Features

Test Scriptlet Editing Pane


e-Tester provides the ability to extend the capabilities of your Visual
Scripts programmatically using Test Scriptlets. Test Scriptlets use the
Visual Basic Scripting Edition (VBScript) scripting language syntax.
When you add a Test Scriptlet to a Visual Script, the e-Tester browser
pane changes to a script-editing pane where you can define your own
VBScript code.
The following illustration shows the script-editing pane with a VBScript
code snippet:
Test Scriptlet
in Script-Editing Pane
Test Case
in Visual Script

The e-Test Programming Interface (e-PI) provides several methods and


properties for accessing the HTML source of Web pages recorded to a
Visual Script. You can use Test Scriptlets when your testing requires
specialized capabilities to achieve specific test objectives. Chapter 10 and
Appendix B explain how to use the e-PI to create custom tests using your
own VBScript code.

22

e-Tester User Guide

Main Window Features

Playback Results Pane


The Playback Results pane shows a summary of the Visual Script test
playback.
Drag to Adjust Width

Double-Click to View Page

Playback Results Summary

Double-Click to View Validation

You can adjust the widths of the individual columns by dragging the dividers.
Icons in the Visual Script show the location of any specific failures of
default tests or test cases. Resource Validation test results are listed in a
separate window after playback of the script.
You can turn on and off the display of the Playback Results pane using
the Window Resize Output Log View option.

Status Bar
The status bar provides status and current progress information. The
mode determines the information that appears in the status bar.
Mode (PLAY/EDIT/REC)
Browser

Visual Script Status

Elapsed Time
Browser Status

Progress

The Browser status indicates the browser-specific type of Visual Script.


The e logo indicates an Internet Explorer-specific (the default) Visual
Script; the N logo indicates a Netscape-specific Visual Script.

Chapter 2: e-Tester Basics

23

Main Window Features

Microsoft Visual Basic IDE


e-Tester includes the Microsoft Visual Basic for Applications Integrated
Development Environment for developing custom tests using Visual
Basic. Custom VBA tests are Visual Basic code added to the e-Tester Visual
Scripts to extend testing capabilities.

You can develop custom tests using the e-Tester Custom Test Wizard or
your own custom code. The Custom Test Wizard lets you select Web
page objects, specify test options, and automatically generate Visual Basic
code. Chapter 5 explains how to use the Custom Test Wizard. Chapter 10
and Appendix B explain how to use the e-PI to create custom tests using
your own Visual Basic code.

24

e-Tester User Guide

Browser Specific Visual Scripts

Java Console
The Java Console displays error information for Java applets.

You can use the Java console to view more detailed messages than are
displayed in the Browser Status pane of the Status Bar.
Select Browser Show Java Console to open the window. The Show Java
Console menu option only appears if you installed the e-TEST suite with
Java support.
The Microsoft VM - Java console enabled (requires restart) setting on the
Advanced tab of the Control Panel Internet Properties must also be
selected before the window will open.

Browser Specific Visual Scripts


The e-Tester Visual Scripts are, by default, designed to drive playback
through the built-in browser pane, which is Microsoft Internet Explorer.
e-Tester also provides the capability to generate Visual Scripts that drive
playback through Netscape Navigator (version 4.x or higher). You must
specifically generate the Netscape compatible Visual Script from a
recorded Visual Script.
To playback Netscape Visual Scripts, Netscape Navigator 4.0 (or higher)
must be installed. See Recording and Playing Back Visual Scripts in
Chapter3 for additional information.
Chapter 2: e-Tester Basics

25

Setting Preferences

Setting Preferences
The Preferences options let you set auto save and browser timeout options.
Selecting Options Preferences opens the Preferences dialog box:

The Preferences dialog box has the following options:


Auto save modified scripts without prompting automatically saves

modified Visual Scripts.


Retain Data Bank Variables Acro
Across
ss Visual Scripts when selected, e-Tester

saves Data Bank variables for use across multiple Visual Scripts. If you
specify Data Bank variables and bind the variables to fields in a Data
Dank file for a specific Visual Script, selecting this option saves those
Data Bank variables and field bindings for use with a new Visual Script.
You only need to map the saved Data Bank variables to the specific
Parameters in the new Visual Script. When cleared, all Data Bank
variables, mappings, and field bindings are cleared when you close a
Visual Script or create a new Visual Script.
Record all list selections by index when checked, e-Tester selects options
in a <SELECT> list of a Web page using the zero-based index of the
<OPTION> tags (for example Value[0], Value[1], etc.) and ignores the text

of the option. When cleared, e-Tester selects list items using the value of
the option in the HTML source (for example, the text List Value within
the HTML: <OPTION Value=List Value). The default setting is cleared.

26

e-Tester User Guide

Configuring e-Tester to Use a Proxy Server

Generate Script for Load when selected, e-Tester generates the

navigation information and files required for playing back the Visual
Script in e-Load. When cleared, e-Tester does not generate the navigation
and files for playing back the Visual Script in e-Load. The default is
selected.
Browser Timeout sets the amount of time the browser will wait for a

response from the server before a timeout occurs.


HTML Capture specifies how e-Tester captures the HTML source of a

Web page in the Visual Script. You can view the captured HTML source
in the Visual Script by selecting an HTML node of a Visual Script page
and selecting Edit Properties.
E Capture Original when selected, e-Tester captures the HTML source

as sent by the server to the client browser. This is the standard setting.

E Capture
Capture Processed when selected, e-Tester captures the HTML

source in structured form after the client browser processes the HTML.

Configuring e-Tester to Use a Proxy Server


You can configure e-Tester to use a proxy server to access the Internet. If
Internet Explorer is already set up to use a proxy server, e-Tester
automatically uses those settings.
To configure the proxy server:
1.

Obtain the proxy server address from your system administrator.

2.

Select Browser Options. e-Tester opens the Internet Properties.

3.

Click the Connection tab.

4.

Click the LAN Settings button.

Chapter 2: e-Tester Basics

27

Using Workspaces

5.

In the Proxy server group, select the Use a proxy server check box.

Access Using
Proxy Server

5.

Click Advanced, and then type the appropriate proxy server address
or addresses.
Specify Proxy
Addresses

6.

Click OK to close the Proxy Settings.

7.

Click OK to close the LAN Settings.

8.

Click OK to close the Internet Properties.

Using Workspaces
Workspaces store project related Visual Script files and Results log files.
You can use Workspaces to organize your various testing projects.
e-Tester lets you create multiple Workspaces.
The Workspace is a user-specified subdirectory of the installation
directory (C:\Empirix is the default). e-Tester automatically appends an
28

e-Tester User Guide

Using Workspaces

exclamation point to the directory name to identify the directory as a


Workspace directory.
When you record and save Visual Scripts, or play back a Visual Script and
save the log file, e-Tester stores the script or log file in the currently open
Workspace.
The following sections explain how to add, open, close, and delete
Workspaces.

Adding a New Workspace


When starting a new testing project, you should create a project-specific
Workspace to store related files.
To add a new Workspace:
1.

Select Admin New Workspace. e-Tester opens a dialog box for


entering a name for the new Workspace.

The New Workspace


Workspace dialog box also lists the existing Workspaces
and highlights the currently open Workspace.
2.

Enter a name for the Workspace directory.

3.

Click OK.
Note: The new Workspace does not automatically become the

currently open Workspace. You must open the new Workspace to


use it to store project files.

Chapter 2: e-Tester Basics

29

Using Workspaces

Opening a Workspace
e-Tester automatically opens the last open Workspace when you start e-Tester.
To open a different Workspace:
1.

Select File Open Workspace. e-Tester opens a dialog box for


selecting the Workspace to open.

Note: If you have an unsaved Visual Script, e-Tester asks if you want
to save the file before opening the Open Project Workspace dialog
box. Click Yes to save the file, No to discard the unsaved file, or
Cancel to cancel opening a new workspace.
2.

Select the Workspace to open.

3.

Click OK. The opened workspace name appears in the title bar of
e-Tester.

Closing a Workspace
Although it is not necessary to close a Workspace before opening a different
Workspace, you may want to do this in certain situations. For example, you
may want to close a Workspace at the end of a testing project. This makes
sure that the next time you start e-Tester for another testing project, the
previous project Workspace will not open automatically.

30

e-Tester User Guide

Using Workspaces

To close the Workspace:


1.

Select File Close Workspace.


Note: If you have an unsaved Visual Script, e-Tester asks if you want
to save the file before closing the Workspace. Click Yes to save the
file, No to discard the unsaved file, or Cancel to cancel closing the

workspace.
When you close the Workspace, the majority of the e-Tester menu options
and toolbar buttons are dimmed. Opening a Workspace restores the menu
and toolbar options.

Deleting a Workspace
e-Tester lets you delete a Workspace and all project files in the
Workspace.
To delete a Workspace:
1.

Select Admin Delete Workspace.

2.

Select the Workspace to delete.

3.

Click OK.

4.

Click Yes to delete the Workspace and associated files or click No or


Cancel to cancel.
CAUTION
CAUTION: Deleting a Workspace has the potential of erasing a large

amount of data including Visual Script files, results logs, e-Load


scenarios and profiles, and e-Monitor scripts. Be sure you really want to
do this before proceeding.

Chapter 2: e-Tester Basics

31

Using Workspaces

[This page intentionally left blank]

32

e-Tester User Guide

Chapter 3

Recording and Playing Back


Visual Scripts
Visual Scripts offer the fastest and easiest way to define tests for Web
applications. When you record Visual Scripts, you capture the interaction
of the user with the Web application under test. These scripts serve as
your baseline and can be replayed against new versions of your Web
application to detect functional, regression, scalability, and postdeployment defects.
A subset of the Visual Scripts that depict different profiles of usages of
your application can be re-used for load and scalability testing of your
application.
All of the functional testing scripts that depict correct behavior of your
Web application can be re-used after deployment to monitor your
application 24 hours a day, 7 days a week.
Since Web applications may sometimes require that you have separate
baselines for different browsers, e-Tester offers you the flexibility to create
baseline Visual Scripts for both Internet Explorer and Netscape Navigator.
You can switch between the two baselines at the touch of a button.
This chapter explains how to record and playback Visual Scripts.

33

Recording Visual Scripts

Recording Visual Scripts


Basic recording of Visual Scripts is simple. Load the first page, press a
button in e-Tester, and navigate your Web site or application as a normal
user. When finished, stop recording. You can also use the e-Spider to
create a Visual Script that maps an entire site or application without
having to navigate the pages manually.
e-Tester also provides the capability to add test cases and map external
data sources (Data Banks) to your Visual Scripts.

Recording Visual Scripts Manually


The most basic procedure for recording Visual Scripts is manual recording.
Manual recording lets you determine the sequence of actions and the pages
to include in the Visual Script.
To record Visual Scripts manually:

34

1.

Select Edit Reset To Original State to clear any persistent cookies or


user login information that may be currently saved by the browser.
This is only necessary if there has been previous user activity in the
browser that may have saved persistent settings. For example, if you
previously logged into a Web application and the settings are not
cleared, the Web application may not redisplay the login page.

2.

Type or select the full URL or path and file name of the first page into
the address line of the Browser pane of e-Tester. (If typed, press Enter.)

e-Tester User Guide

Recording Visual Scripts

Select from History List


Type URL or
File Location

3.

Select Run Record Start or click the toolbar button.

4.

Navigate the Web page or application in the Browser pane.


E Follow links.
E Submit form data, etc.

Chapter 3: Recording and Playing Back Visual Scripts

35

Recording Visual Scripts

As you navigate the site or application, e-Tester adds page nodes to


the Visual Script. Each page node automatically captures Anchors,
Elements, Forms, Frames, HTML, Images, Image Maps, Links,
ActiveX controls, Java Applets, VBScript, and JavaScript for testing
upon playback.

Page Nodes in
Visual Script Pane

5.

Select Run Record Stop or click the toolbar button when finished.
Once the Visual Script is recorded, you can customize the script in a
variety of ways. See Working with Visual Scripts in Chapter 4 for
additional details about customizing Visual Scripts.
Notes: When recording frames-based Web pages, be sure to follow

links starting from the base frame. This provides e-Tester with a
reference point from which to start navigating frames during playback.
It is important that the first page recorded to the Visual Script is not
loaded into the browser pane by an action that occurred on a previous
page (for example, Back/Forward browser buttons, link navigation,
or form submission). If the recording of the first page of the Visual
Script is dependent upon the context of navigation to the page, the
Visual Script playback may not work correctly.
36

e-Tester User Guide

Recording Visual Scripts

Recording a Page Snapshot


e-Tester automatically records page nodes to the Visual Script each time
the browser transitions from one page to the next. The pages are recorded
in their default state as the page loads into the browser.
In some instances, you may want to manually record the current state of a
page to the Visual Script (i.e. make a snapshot of the page) to capture
changes to the page after it was loaded and recorded. For example, if a
user clicks on the page (but not a link to another page), enters text into
form fields, or performs other actions that do not cause a transition to a
new page, the state of the page changes. However, the changed state is not
automatically recorded as part of the Visual Script. You can manually
record the current state of the page (including user clicks and data entered
into forms, etc.) to the Visual Script by taking a Page Snapshot.
Page Snapshots are also used for recording events in Java applets.
The Page Snapshot option is only active if the state of the page has
changed since the page was recorded to the Visual Script or an applet
event was triggered.
To record a Page Snapshot:
1.

Select Run Record Start or click the toolbar button to start


recording.

2.

Navigate to a page that provides for user interaction, for example, a


form page or a Java applet. However, you can make a snapshot of any
page with state changes).

3.

Click on the page or enter data into a form (without submitting the
form data), or click on a option in a Java applet to trigger an event.

4.

Select Run Record Page Snapshot or click the toolbar button to


record the current state of the page to the Visual Script.

5.

Submit the form data or continue navigating the Web site, applet or
application to record additional pages to the Visual Script.

6.

Select Run Record Stop or click the toolbar button when finished
recording.

Chapter 3: Recording and Playing Back Visual Scripts

37

Recording Visual Scripts

Recording Visual Scripts Using e-Spider


e-Spider provides a convenient way to record a Visual Script without
manual navigation. e-Spider automatically follows page links to map a site
or application. You can then generate a Visual Script from the e-Spider
map.
Note: If you have a very large site or application, it is not advisable to try

to spider the entire site from the home page due to time and system
resource issues. A more efficient approach is to identify related sections of
your site or application and create a set of modular Visual Scripts by first
manually loading a specific page in a section and then starting e-Spider.
To record Visual Scripts with the e-Spider:

38

1.

Type or select the full URL or path and file name of the first page
where you want to start spidering into the address line of the Browser
pane of e-Tester.

2.

Select Tools e-Spider or click the toolbar button. The e-Spider


opens in a new window:

3.

Click the Start Spider button.

e-Tester User Guide

Recording Visual Scripts

4.

Wait for the e-Spider to finish. e-Spider builds a map of the site or
application as a tree hierarchy.

e-Spider also generates a report and shows it in the e-Tester browser.


5.

Make any edits to the e-Spider tree as necessary:


E Append form results pages.
E Ignore pages.

Appending Form Pages to the e-Spider Map


e-Spider does not navigate below pages that contain forms. Pages with
forms are shown with and F icon ( ) next to the page node. e-Spider
provides an interactive capability so that you can navigate to pages with
forms, fill in the form, navigate to the pages below, and then add the
generated results page to the e-Spider map.
6.

Double-click the page with a form in the e-Spider map. The page
appears in the e-Tester Browser pane.

7.

Enter the form data and click the Submit button.


Note: The Web page Submit button can have any user-defined

image or text label, such as Register, Search, or Finished.


8.

When the Results page appears in the e-Tester Browser pane, click
the Append Page to Tree button in e-Spider to add the Results page
to the e-Spider tree. The icon appears next to the page with the
form in the e-Spider map.

9.

Repeat steps 6-8 for each form page in the e-Spider tree.
Note: See Using

e-Spider in Chapter 7 for additional details about


using e-Spider options to modify the tree.

Chapter 3: Recording and Playing Back Visual Scripts

39

Recording Visual Scripts

Saving the Map File and Generating the Visual Script


10.

Select File Save Site Map As or click the toolbar button in e-Spider
to save the site map to a file. This is useful if you need to make any
change to the tree in the future.

11.

Click the Generate Script button to create a e-Tester Visual Script


from the e-Spider tree. The Visual Script appears in the left pane of
e-Tester.

Generated
Visual Script

e-Spider generates a report subsequent to each spidering session. The


report appears in the browser pane of e-Tester. The report is stored as
an HTML file in the Spider folder of the RSW installation directory.
The report contains summary information about start/stop time,
links, levels, and forms.
12.

40

Close the e-Spider window.

e-Tester User Guide

Recording Visual Scripts

Form input data appears under the Visual Script Parameters node of the
Results page returned by the Web application processing the form:

Note: See Working

with Visual Scripts in Chapter 4 for additional


details about Visual Scripts.

Recording DHTML Event Handlers


You can define how e-Tester identifies and captures Dynamic HTML
(DHTML) event handlers before recording Visual Scripts for Web pages
that use the event handlers.
To define how e-Tester identifies DHTML event handlers:
1.

Start e-Tester.

2.

Analyze your Web page or application source to determine which


HTML tags use which DHTML event handlers (for example,
OnMouseOver, OnMouseOut, etc.).

3.

Select Options Event RRecording


ecording. e-Tester opens a window for
specifying which event handlers are use with which HTML tags.
Initially the Events to Record tree is empty.

Chapter 3: Recording and Playing Back Visual Scripts

41

Recording Visual Scripts

42

4.

Select an HTML tag in the Element Tag list.

5.

Select a DHTML event handler in the Event Name list.

6.

Click Add Event.

7.

Repeat steps 5-6 to add multiple event handlers to the selected


HTML tag.

8.

Repeat steps 4-7 to add multiple HTML tag/event handler


definitions to the Events to Record list.

9.

Click OK.

10.

Record and playback the Visual Script.


e-Tester User Guide

Recording Visual Scripts

Recording Manual Navigation


Certain Netscape-specific JavaScript, VBScript, CGI, or ASP applications
may require manual navigation when recording Visual Scripts in the builtin browser pane, which is Internet Explorer compatible, to pass the
correct post data to the page or application. In this case, you can use
manual navigation rather than page clicks to record the Visual Script
before generating a Netscape-specific Visual Script.
To record manual navigation:
1.

Select Run Record Start or click the toolbar button to start


recording.

2.

Select Run Record Navigate Manually. e-Tester opens a dialog


box for setting the navigation information:

3.

Type the following navigation information and click Navigate.


URL the Uniform Resource Locator of the page to which to

navigate.
Target Frame the name of the frame if navigating to a frames based
page. This is the value of a Target= attribute of the frame set.
PostData any name/value pair data to include as Post data for the
page. Specify as name=value&name=value,&name=value, etc.
Headers any additional HTTP headers to send to the server. The
headers are in addition to standard browser headers.

Chapter 3: Recording and Playing Back Visual Scripts

43

Recording Visual Scripts

Recording from an External Window


e-Tester provides the ability to record Visual Scripts using an external
browser window. You should start recording in an external window if
your application generates an external window and carries forward one or
more cookies.
To record from an external window:
1.

Start e-Tester and type the following URL in the Address field:
c:\Empirix\eTEST\rswwin.htm.

2.

Select Run Record Start or click the toolbar button to start


recording.

3.

Type the URL of your Web application in the Address line and press
Enter.

4.

Navigate the site to record pages.

5.

Close the external window.

6.

Select Run Record Stop or click the toolbar button when finished.

The recorded Visual Script will carry forward the cookies and play back
correctly.

44

e-Tester User Guide

Recording Visual Scripts

Recording Anchor Transitions


e-Tester, by default, automatically records clicks on links that go to
Anchor tags within the same Web page when recording Visual Scripts.
For example, the following HTML shows the structure of a link to an
Anchor tag:
<A HREF="#Section1">See Section 1</A>
<P>Some Additional HTML</P>
<H1><A NAME="Section1">Section 1</A></H1>

The click event on the See Section 1 link will be recorded and will be
executed on playback of the Visual Script.
You can override the default recording behavior and have e-Tester not
record clicks to Anchor tags.
To record anchor transitions:
1.

Press Ctrl-F12 to open the Advanced Settings Manager.

2.

Set the following setting in the WebAnalyst section of the either the
Global User Defaults or <Scriptname> Settings branch.
IgnoreAnchorTransitions=True
Note: If IgnoreAnchorTransitions does not appear in the Global User
Defaults | WebAnalyst tree, click the right mouse button on the
WebAnalyst node and select Add Settings. Select the check box next to
IgnoreAnchorTransitions and click Add Setting.

3.

Select File Exit.

4.

Click Apply to save the changes.

Recording Pages with META Refresh Tags


Web applications that have redirection in some of the pages are
automatically handled during record and playback.
If a Visual Script is being recorded and a page is encountered that has a
META Refresh tag with a refresh time under 10 seconds, this page will be
skipped and will not be recorded.
Chapter 3: Recording and Playing Back Visual Scripts

45

Recording Visual Scripts

If a page is encountered that has a META Refresh tag and a refresh time
over 10 seconds, the page will be recorded in the Visual Script.

Recording Auto Pages


An Auto page is a page that is recorded without any action on the part of
the user. For example, certain applications will have the user wait for the
completion of a long server-side transaction and display automatically one
or more Please wait... pages to let the user know that the transaction is
in progress and has not completed. If the page was displayed three times,
the page is recorded three times in the Visual Script.
Since the same number of these Please wait pages may not appear
when the script is played back, you should create a Test Scriptlet After or
Custom VBA afterPlay test on the first Auto page to check for the
expected HTML in the transaction completed page. The following is an
example of a Custom VBA afterPlay test that handles Auto pages.
'determine if server has returned requested page
'if not, replay current page
'if so, skip to next Visual Script page after
'last Auto page (in example case, page 4)
If RSWApp.FindInHtml("<TITLE>Table of Contents") Then
RSWApp.GotoPage(4)
Else
RSWApp.GotoPage(1) 'the current page
End If

This code checks for the text string <TITLE>Table of Contents in the
HTML source of the page returned by the server. If the string is not in
the source, the Custom VBA code replays the current page. e-Tester loops
on the current page (which should be the first Auto page) until the server
returns a page with the <TITLE>Table of Contents string in the
HTML source. Playback then continues with the Visual Script page after
the last Auto page. In the above example, the next page after the last Auto
page is page four of the Visual Script.

46

e-Tester User Guide

Recording Visual Scripts

Recording Sites that Require User Authentication


For security purposes, many Web applications restrict entry by requiring
users to enter a username and password pair into a popup dialog box.
Note: If you record a Visual Script with a login Web page (not a popup

dialog box), which may not reappear when you revisit the site due a
session cookie, e-Tester recognizes the cookie and skips the login page
during playback. e-Tester logs a message indicating the login page was
skipped and playback continues with the next page.
To automate the user name and passwords during recording and playback
of a Visual Script, you can use the e-Tester Authentication Manager. The
Authentication Manager lets you specify username and password
combinations for multiple URLs. You can also map the usernames and
passwords to a Data Bank file. When e-Tester encounters a URL that
needs authentication via a popup dialog box, it automatically fills in the
username and password in the dialog box that is displayed. Select Admin
Authentication Manager to add URLs, usernames, and passwords to the
Authentication Manager. See the Using Admin Options in Chapter 9 for
additional information about using the Authentication Manager.
Alternatively, navigating to the URL will cause the browser to display a
dialog box wherein the user must type in a username and password. To
bypass the popup box that prompts for the username and password, prefix
the username and password to the URL before navigating as shown
below:
http://<username>:<password>@<URL>

As an example, if you wish to bypass the username/password pair prompt


for a site called www.empirix.com using guest/guest as the username and
password pair, the URL would look as follows:
http://guest:guest@www.empirix.com

The same technique can be applied for 'Spidering' sites that require
authentication.

Chapter 3: Recording and Playing Back Visual Scripts

47

Recording Visual Scripts

Saving Visual Scripts


Once you have recorded a Visual Script, you can save the script to a file.
To save a Visual Script:
1.

Select File Save Script or click the toolbar button.


or:
Select File Save Script As.

2.

Enter a name and click Save.


Note: e-Tester saves Visual Script files to the current Workspace as

the default location. The Workspace is a user-specified subdirectory


of the installation directory (C:\Empirix\eTEST is the default).

Generating Netscape Scripts


The e-Tester Visual Scripts are, by default, designed to drive playback
through the built-in browser pane, which is Microsoft Internet Explorer.
e-Tester also provides the capability to generate Visual Scripts that drive
playback through Netscape Navigator (version 4.x or higher). You must
specifically generate the Netscape compatible Visual Script from a
recorded Visual Script.
To generate a Netscape Script:
1.

Record a new Visual Script.


or:
open an existing Visual Script.

2.

If a new Visual Script, save the script.

3.

Select Run Record Generate Netscape Script or click the toolbar


button.

4.

Save the Visual Script with a .nom file extension


Notes: Generating and playing back Netscape-specific Visual Scripts

requires Netscape Navigator version 4.x or higher installed on the


system.

48

e-Tester User Guide

Playing Back Visual Scripts

Netscape-specific Visual Scripts have a .nom filename extension.


Internet Explorer-specific Visual Scripts have a .mom filename
extension. Empirix highly recommends that you save Netscapespecific Visual Scripts using the same filename as the equivalent
Internet Explorer-specific Visual Scripts and use the two toolbar
buttons to switch between the two versions.

Playing Back Visual Scripts


When you play back a Visual Script, e-Tester compares the current
version of your Web site or application against the baseline recorded in
the Visual Script. Test failures and HTML differences are indicated by
red flags annotated within the Visual Scripts during playback.
You can playback Visual Scripts as they were recorded or you can
customize the script in a variety of ways. For example:
E Add test cases
E Modify default tests
E Append pages
E Ignore specific test cases
E Connect Data Banks
E Ignore specific failures
E Add custom programmatic tests
You can also set the global and script-specific playback options. See
Working with Visual Scripts in Chapter 4 for additional details about
customizing Visual Scripts.
e-Tester uses a heuristic program to determine and exclude machinegenerated components of Web page source that can change dynamically
(i.e. session IDs) when visiting a site. The machine-generated components
will not be tested and will not cause red flags to be generated in the Visual
Script during playback.
You can specify exclusions to the heuristic comparison between master
pages and tested pages on Visual Script playback. You can specify those
parts of Web page source that change from one session to another and
exclude them from the Visual Script playback comparison. The specified
exclusions will not be tested and will not cause red flags to be generated
during playback. This is useful for masking specific parts of URLs,
HTML elements and attributes, and scripts.

Chapter 3: Recording and Playing Back Visual Scripts

49

Playing Back Visual Scripts

Playing Back the Entire Visual Script


To play back a Visual Script:
1.

Select Options Playback.

2.

3.

Set the Playback options:


E Global Settings
E Script Settings
Click OK.

4.

Select Run Playback Start or click the toolbar button.


The Playback Results pane shows a summary of the Visual Script test
playback.
Note: It is important that you do not close any new browser windows

opened by e-Tester until playback is finished.

Playing Back a Specific Page


To play back a specific page in the Visual Script:
1.

Select the page to play back in the Visual Script.

2.

Select Run Playback Current Page or click the toolbar button.

Playing Back with Recorded Delay


Visual Scripts record the actual amount of time a user spends on a page
before going to another page. This think time delay is recorded in the
Duration node under the Address node for the page. The default Visual
Script playback mechanism ignores the recorded delay.
To play back Visual Script using the recorded delay, check the Play with
Recorded Delay Between Pages check box in the Playback Options, as
follows:

50

1.

Select Options Playback.

2.

Click the Script


Script Settings tab.

e-Tester User Guide

Playing Back Visual Scripts

Select to play
back with
recorded delay
Specify maximum
delay time

3.

Select the Play with Recorded Delay Between Pages check box.

4.

Specify a maximum amount of recorded delay to allow during


playback in the Maximum Delay (seconds) box.

5.

Click OK.

6.

Play back the Visual Script.

Playing Back Visual Scripts Multiple Times


e-Tester lets you play back Visual Scripts multiple times (iterations). To
play back with iterations:
1.

Select Run Playback Iterate or click the toolbar button.

Chapter 3: Recording and Playing Back Visual Scripts

51

Playing Back Visual Scripts

2.

Set the Iteration options as follows:


Data Banks Data Banks are external files that store data that can be
passed to parameters in a Web page or application recorded in a
Visual Script. To play back iterations from a Data Bank, you must
first use the Data Bank Wizard to map variables and bind Data Bank
fields to the Visual Script parameters. See Using Data Banks in
Chapter 8 for details about using the Data Bank Wizard.
E Playback without Data Bank playback of the Visual Script uses

the recorded data values as the parameters in the Web page or


application.

E Playback with Data Bank playback of the Visual Script uses data

values from a Data Bank as the parameters in the Web pages or


application.
'
Use All Records each playback of the entire Visual
Script (all pages) advances to the next record in the Data
Bank file and uses the data as the parameter(s) in the
Visual Script. This is useful if you want to play back the
Visual Script using all records or a range of records in
the Data Bank file.
'
Use Current Record Only playback of the entire Visual
Script (all pages) uses only the data from the current
record in the Data Bank file. This feature is useful when
you want to debug a problem with a particular record in
the Data Bank file.
Playback without Data Bank playback of the Visual Script uses the
recorded data values as the parameters in the Web page or
application. Even if you have used the Data Bank Wizard to add
variables and bound the variables to Data Bank fields, the values
from the Data Bank file are not used.

E Number of Iterations the number of times e-Tester plays back the

entire Visual Script (all pages).

E Delay Between Iterations the amount of time e-Tester waits after

completing a full iteration before starting the next iteration.

52

e-Tester User Guide

Playing Back Visual Scripts

Playback with Data Bank playback of the Visual Script uses data
values from a Data Bank file as the parameters in the Web pages or
application.
E Name the name of Data Bank file being used.
E Current Record Number the current record from the Data Bank
file. Data from this record will be passed to the parameters if Use
Current Record Only is selected.
E Start at Record the first Data Bank record to use for playback

iterations. Enter a number or First for the first record.

E End at Record the last Data Bank record to use for playback

iterations. Enter a number or Last if you are unsure of the last


record number in the Data Bank file.

E Iterate Over Range the number of times e-Tester iterates the

entire Visual Script (all pages) using all of the specified records for
each iteration. If you have a Data Bank file with 5 records and
Iterate over the range 2 times, e-Tester plays back the entire Visual
Script (all pages) a total of 10 times - twice for each record.

3.

Click Iterate to start playback with iterations.

Playing Back with Data Banks


e-Tester let you pass external data from a Data Bank to forms on playback
of a Visual Script. To play back using external data from a Data Bank,
you must first create a Data Bank file and then use the Data Bank Wizard
to map variables and bind Data Bank fields to the Visual Script
parameters. See Using Data Banks in Chapter 8 for details about creating
Data Bank files and using the Data Bank Wizard.
To pass external data to forms on playback:
1.

Record a Web page with a form.

2.

Enter data into the form and click the Submit button.

3.

Wait for the Results page to load in the Browser pane.

4.

Stop Recording.

5.

Select the Results page in the Visual Script.

Chapter 3: Recording and Playing Back Visual Scripts

53

Playing Back Visual Scripts

6.

Select Edit Data Bank Wizard or click the toolbar button.

7.

Select the Variables tab and map variables to the Visual Script
parameters.

Select variables
to map to script
parameters

Click to map
all variables to
script parameters

8.

Select the Data Binding tab and select a Data Bank file.

Select variables
to bind to Data
Bank fields

Click to bind
all variables to
Data Bank fields

54

9.

Bind Data Bank fields to the variables.

10.

Click OK.
e-Tester User Guide

Playing Back Visual Scripts

11.

Select Run Playback Iterate.

12.

Select Playback with Data Bank.


Set to
Playback
Data Bank

Set Which
Data Bank
Records

Set #
of Iterations
Through
Range

13.

Select Use All Records.

14.

Specify the range of Data Bank records to use during playback of the
script in the Start at Record and End at Record fields. You can enter
First and Last, respectively, to iterate playback through the entire
Data Bank.

15.

Set the number of iterations through the Data Bank in the Iterate over
Range field.

16.

Click Iterate.

17.

e-Tester plays back the entire Visual Script (all pages) using all of the
specified records for each iteration. If you have a Data Bank with 5
records and iterate over the range 2 times, e-Tester plays back the
Visual Script (all pages) a total of 10 times - twice for each record.

Playing Back a Specific Data Bank Record


To play back a specific Data Bank record:
1.

Map Visual Script Parameters to variables.

2.

Bind variables to fields in a Data Bank file.

3.

Select Edit Data Bank Wizard or click the toolbar button.

Chapter 3: Recording and Playing Back Visual Scripts

55

Playing Back Visual Scripts

4.

Click Goto Record.

Click to specify
Data Bank record

5.

Enter a record number and click OK.

6.

Click OK to close the Data Bank Wizard.

7.

Select Run Playback Iterate.

8.

Select Playback with Data Banks.


Set to
Playback
Data Bank

Specific
Record
Set #
of Iterations
Over
Record

56

9.

Select Use Current Record Only.

10.

Set the number of iterations for the record in the Iterate Over Record field.
e-Tester User Guide

Playing Back Visual Scripts

11.

Click Iterate.

12.

e-Tester plays back the entire Visual Script (all pages) using the
specified record for each iteration.

Playing Back Visual Scripts on a Different URL


Frequently it is necessary to play back a Visual Script using another URL
that is different from the URL that was used when the script was
originally recorded. This occurs when you have a staging server or a test
server (located under one URL) and a production web server (located
under another URL) where the application is actually deployed.
In this context, the structure of the web pages is generally the same
throughout the application, the main difference being the URL for each
page of the Visual Script.
To convert a script for playback against the new URL:
1.

Expand the first page in the Visual Script.

2.

Locate the Address node and click the right-mouse button.

3.

Select Properties.

4.

Edit the URL by changing the original URL to the new URL.

5.

Click on OK in the properties dialog box.

6.

Play back the script.

7.

After playback is complete, review the red flags; select Results

Accept All Tested Pages.


8.

Save the Visual Script to a new name.

9.

The new script can now be used to play back against the new URL.

Chapter 3: Recording and Playing Back Visual Scripts

57

Playing Back Visual Scripts

Playing Back Visual Scripts in Netscape


The e-Tester Visual Scripts are, by default, designed to drive playback
through the built-in browser pane, which is Microsoft Internet Explorer.
e-Tester also provides the capability to playback Visual Scripts through
Netscape Navigator (version 4.x or higher). You must specifically generate
the Netscape compatible Visual Script from a recorded Visual Script.
To play back Visual Scripts in Netscape:

58

1.

Select Options Netscape.

2.

Set the Start and Exit Netscape options.

3.

Record a new Visual Script or open an existing Visual Script.

4.

If a new Visual Script, save the script as an IE baseline Visual Script


(.mom file extension).

5.

Select Run Record Generate Netscape Script or click the toolbar


button.

6.

Save the Visual Script as a Netscape baseline Visual Script (.nom file
extension).

7.

Select Edit Switch to Netscape Baseline or click the toolbar button.

8.

Select Run Playback Start or click the toolbar button.


e-Tester User Guide

Playing Back Visual Scripts

Viewing Playback Results


The Playback Results pane shows a summary of the Visual Script playback.

Double-Click to View Page

Playback Results Summary

Double-Click to View Validation

Double-click the corresponding Test # to view a page in the Browser pane.


Resource Validation test results are listed in a separate window after
playback of the script. Double click the Resource Validation Test # to
open the Resource Validation window.
You can turn on and off the display of the Playback Results pane using
the Window Resize Output Log View option.
Flags in the Visual Script show the location of any differences between the
baseline page (master) and the tested page. Failures of default tests or test
cases are also indicated by flags in the Visual Script.

Script Differences are


Indicated by Flags
on the Script Nodes

See Working with Visual Scripts in Chapter 4 for a complete list of the
flags and icons used in Visual Scripts.

Chapter 3: Recording and Playing Back Visual Scripts

59

Handling Unexpected Windows During Recording/Playback

Handling Unexpected Windows During


Recording/Playback
From time-to-time Web applications will display popup message boxes or
windows unexpectedly. Examples of this would include JavaScript alerts,
VBScript message boxes, prompts, confirm dialog boxes, various security
warnings, and other dialog boxes that are posted by the browser control.
e-Tester provides the capability to automatically dismiss dialog boxes that
appear during playback of a Visual Script. The automatic dismissal
feature can be turned on and off using the Automatically Dismiss Dialogs
During Playback check box in Options Playback.
If you encounter popup boxes or windows during recording, you must
dismiss them manually. If you encounter dialog boxes that are generated
from inside of VBScript functions, you can detect them using the e-Tester
Dialog Manager and add them to the list of unexpected windows.
If unexpected dialog boxes are encountered on play back that are not
automatically dismissed, you can specify information about the dialog box
using the e-Tester Dialog Manager. Once you add the dialog box to the
Dialog Manager, all Visual Scripts will be able to recognize and
automatically dismiss the dialog box or window on subsequent play back
of the Visual Script. Select Admin Dialog Manager in e-Tester to open
the settings.
The Dialog Manager contains dialog box-specific information, such as
Windows class and caption, default action, etc. The Dialog Manager comes
with a pre-specified number of standard dialog boxes that it recognizes. You
can add information about other dialog boxes to recognize and dismiss
automatically during playback. See Using Admin Options in Chapter 9 for
more information about using the Dialog Manager.
The e-Tester Dialog Manager uses the RswSpy utility to recognize and
dismiss dialog boxes that appear during playback of Visual Scripts.
RswSpy appears as a taskbar icon while e-Tester is running. RswSpy
indicates Disabled until you playback a Visual Script. During Visual
Script playback, RswSpy indicates Enabled.
The RswSpy is automatically launched and closed by e-Tester and does
not require any user actions.
60

e-Tester User Guide

Setting Playback Options

Setting Playback Options


The Playback Options dialog box lets you specify the global and scriptspecific playback options for Visual Scripts. Selecting Options Playback
opens the Playback Options dialog box. The dialog box contains two tabs:
Global Settings and Script Settings.
Global Settings set playback options that apply to all Visual Scripts.

The Global Settings tab has the following options:


E Timeout on Page After sets the maximum amount of time e-Tester

will wait for a Web page or application to respond.

E Number of Retries on a Timeout sets the maximum number of times

e-Tester will retry a Web page or application after a timeout.

E Automatically Dismiss Dialogs During Playback when selected,

e-Tester will automatically dismiss dialog boxes that appear during


playback of the Visual Script. Dialog boxes are evaluated and cleared
based upon the settings listed in Admin Dialog Manager.

E Automatically Run Resource Validation After Playback when selected,

e-Tester performs the Resource Validation tests after playback of the


Visual Script.

Chapter 3: Recording and Playing Back Visual Scripts

61

Setting Playback Options

E Always Invoke Script Debugger on Scripting Errors when selected,

e-Tester opens a debugger window upon detecting an error in a Test


Scriptlet.

E Always Invoke VBA IDE on VBA Errors when selected, e-Tester opens

the Visual Basic for Applications Integrated Development


Environment upon detecting an error in a Custom VBA test.

E Use Distinct Cookie Directory when selected, cookies are stored in a


separate directory under the installation directory (C:\Empirix is the

default).
Script Settings the Script Setting tab is where you set playback options

that apply only to the current Visual Script.

The Script Settings tab has the following options:


Data Banks play back a Visual Script with or without a Data Bank:
E Playback without Data Bank when selected, e-Tester plays back the

Visual Script using the parameters recorded in the script.

E Playback with Data Bank when selected, e-Tester plays back the

Visual Script using the data values from the specified Data Bank.

'
Use All Records when selected, e-Tester plays back the Visual

Script for each record in the Data Bank file.

'
Use Current Record Only when selected, e-Tester plays back the

Visual Script using only the current record in the Data Bank file.

62

e-Tester User Guide

Setting Playback Options

Start New Browser Session Before Playback when selected, e-Tester starts a
new browser session before starting playback of the Visual Script. A new
session clears current graphs and statistics and starts collecting new data.
Delete Persistent Cookies Before Playback when selected, e-Tester deletes

cookies set by Web applications before playing back the Visual Script.
Skip Auto Pages in Thin Load when selected, Visual Script playback in

e-Loads Thin Client mode will skip auto pages that were recorded as part
of the Visual Script.
Play with Recorded Delay Between Pages when selected, e-Tester

includes any delay or think time time (i.e. the time a user took to read a
page, locate a link, and then click the link) between pages that occurred
when the Visual Script was recorded.
Maximum Delay (seconds) sets the maximum amount of time e-Tester will

wait between playback of pages in the Visual Script. This option is only
available when Play with Recorded Delay
Delay Between Pages is selected. This is
useful to reduce long think time delays that occurred when the Visual
Script was recorded to a specific maximum amount of time during playback.

Chapter 3: Recording and Playing Back Visual Scripts

63

Setting Playback Options

Setting Netscape Options


The Netscape Options determine when the Netscape browser is started
and exited.
Selecting Options Netscape opens the Netscape Options dialog box:

The Netscape Options dialog box has the following options:


Delete cookie file after each run when selected, e-Tester automatically

deletes the specified cookie file after each playback of the Visual Script.
Specify the path and filename of the Netscape cookie file.
Start Ne
Netscape
tscape determines when the Netscape browser is started.
E Before playing Netscape script starts the Netscape browser before

starting play back of a Netscape-specific Visual Script.

E After opening Netscape script starts the Netscape browser

automatically after opening a Netscape-specific Visual Script.

E During e-Tester start automatically starts the Netscape browser when

starting e-Tester.

64

e-Tester User Guide

Setting Playback Options

Exit Netscape determines when the Netscape browser exits.


E After playing Netscape script exits the Netscape browser after

playback of a Netscape-specific Visual Script finishes.

E After closing Netscape script exits the Netscape browser when you

close a Netscape-specific Visual Script.

E When opening IE script exits the Netscape browser when you open an

Internet Explorer-specific Visual Script.

E Only when exiting e-Tester exits the Netscape browser only when you

exit e-Tester.

Launch Timeout sets the maximum time that e-Tester will wait for the

Netscape browser to open.


Wait for Activity sets the amount of time e-Tester waits after page activity

completes before navigating to the next page of the Visual Script on


playback.
Open Netscape opens the Netscape Navigator browser.
Close Netscape closes the Netscape Navigator browser.

Setting Event Recording Options


The Event Recording options specify which DHTML events to record
for specific page objects. For example, you can specify that e-Tester
Visual Scripts automatically record OnClick, OnMouseOver, or other
events handlers used with Anchor (A) tags in the page HTML source.
The Event Recording options let you select specific HTML tags and then
associate one or more event handlers to associate with the tags when
recording Visual Scripts.
Selecting Options Event Recording opens the Event Recording Options
dialog box.

Chapter 3: Recording and Playing Back Visual Scripts

65

Setting Playback Options

The Event Recording Options dialog box has the following options:

Events to Record lists the HTML tags and the associated DHTML event
handlers that you specify. You customize the Event to Record list as

required for your Web application. Each HTML tag can have more than
one DHTML event handler associated with it. You can enable and disable
event recording for specific tags and event handlers by selecting or
clearing the check box next to the name.
Element Tag provides a list of the HTML tags. Select a tag and then

select the event handler name.


Event Name provides a list of the DHTML event handlers for the
selected HTML tag. Select an event handler and then click Add Event.
Add Event adds the currently selected event handler to the currently

selected HTML tag. When you add event handlers to tags, the tag name
and event name appear in the Events to Record list. You can add multiple
event handlers to the currently selected HTML tag. Select another event
handler name and click Add Event again.
You should define Event Recording options before loading Web pages
and recording Visual Scripts.
66

e-Tester User Guide

Setting Playback Options

Setting Event Playback Options


The Event playback options specify delay and failure settings for playback
of Dynamic HTML (DHTML) and Java Applet events recorded by
e-Tester.
Selecting Options Event Playback opens the Event Playback Options
dialog box:

The Event Playback Options dialog box has the following options:
Event Playback Delay sets the type of delay to use for playback of

DHTML and Java events.


E Use Constant Delay when selected, e-Tester uses a constant delay

time between playback of DHTML and Java events.

'
Delay (sec) sets the amount of time to use as the constant delay.

This setting should not be set to 0 to avoid unpredictable


playback behavior.

E Use Recorded Delay when selected, e-Tester uses the recorded delay

time between playback of DHTML and Java events.

'
Min (sec) sets the minimum playback delay time in seconds.
'
Max (sec) sets the maximum playback delay time in seconds.

Chapter 3: Recording and Playing Back Visual Scripts

67

Setting Playback Options

Event Failure sets the retry and timeout options in case of a DHTML or

Java event playback failure.


E Retry Event if Failed when selected, e-Tester retries the DHTML or

Java event until successful or the timeout limit is reached. A DHTML


event is successful if the DHTML object is found by e-Tester during
playback. A Java Applet event is successful if the Java object is found
and the object is in the correct state for e-Tester to play back the event.
'
Timeout (sec) sets the maximum amount of time to retry failed

events before timing out. This setting also sets the playback timeout
for transitions between Java nodes of the Visual Script tree.

Setting Java Options


These options specify the Java Applet support for Microsoft Java Applets
and Sun Plugin Applet.
Microsoft Java Applet Support these setting specify if Microsoft Java

Applet support is enabled and which version of e-Tester Visual Scripts are
being used.
E No Support when selected, the Microsoft Java Applet support is

disabled.

E Default Support (Recommended) when selected, the e-Tester v5.1 or

higher Microsoft Java Applet support is enabled.

E Pre ee-Tester v5.1 Support (backward


(backward compatibility with v5.0 script only)

when selected, the e-Tester v5.0 Java Applet support is enabled.

Sun Plugin Applet Support this option specifies if Sun Plugin Applet

support is enabled or disabled.


E Sun Plugin Applet Version 1.2 (or higher) Support when selected the

Sun Plugin Java Applet support is enabled..

68

e-Tester User Guide

Defining Exclusions to Playback Comparisons

Defining Exclusions to Playback Comparisons


Web applications that use dynamic content may require special
considerations when using the record/playback paradigm for testing.
Session IDs and other machine-generated HTML source that changes
each time a page is accessed will be different in the recorded master
version of the page from the version of the page compared on playback.
e-Tester uses a heuristic program to determine and exclude machinegenerated components of Web page source that can change dynamically
(i.e. session IDs) when visiting a site. The machine-generated components
will not be tested and will not cause red flags to be generated in the Visual
Script during playback. The HTML source excluded from the playback
comparison will be shown in purple text when you double-click on any
Different HTML node in the Visual Script.
In some cases, you may want to specify which types of content to include
in the playback comparison and which types to exclude. You can override
specific components of the heuristic comparison between master pages
and tested pages on Visual Script playback. You can also specify those
parts of Web page source that change from one session to another and
exclude them from the Visual Script playback comparison. The specified
exclusions will not be tested and will not cause red flags to be generated
during playback. This is useful for masking specific parts of URLs,
HTML elements and attributes, and scripts.
In cases where HTML source appears to the heuristic program to be
machine-generated, but is necessary for page navigation or other testing,
e-Tester must override the heuristic program for accurate playback
comparison. (This may happen if complex alphanumeric naming
conventions are used for paths and files in an application.) e-Tester lets
you override specific content comparison filters that determines machinegenerated components of Web page source.

Chapter 3: Recording and Playing Back Visual Scripts

69

Defining Exclusions to Playback Comparisons

Selecting Options Comparison Exclusions opens the Comparison


Exclusions dialog box:

The Comparison Exclusions dialog box has the following options:


User Defined Content Comparison Filters specifies a Regular Expression

used to exclude specific text strings from the e-Tester playback


comparison.
E Text Pattern Masks (Regular Expression) specify any regular expression

using the following format:

expression | [expression] | []
expression can be any regular expression. You can specify multiple
expressions with logical OR using the pipe (|) character between

expressions. The following is an example of how the settings can be


specified.

BV_SessionID=[0-9]*.[0-9]*&|BV_EngineID=[a-z]*.[09]*&|VALUE="[0-9]*"

See Appendix D for information about Regular Expression syntax.

70

e-Tester User Guide

Defining Exclusions to Playback Comparisons

URLs specifies components of a URL to exclude from the playback

comparison. The settings can use pattern matching to specify components


of the URL to exclude. The pattern matches are performed using the
Visual Basic Like operator.
E Use Regular Expression
Expression Syntax when selected, the following URL

settings use Regular Expression syntax. When cleared, the URL


settings use the syntax defined below.

E URL Parameters specifies URL parameters to exclude from Visual

Script playback comparison using the following format:


LikePattern,[LikePattern],[]

LikePattern is the pattern to match for the value of the URL

parameter. Each exclusion string must be separated from the other


exclusion strings by commas, as follows:

param1=*,param2=*,param3=*,paramN=*

The following examples show how specific settings affect the playback
comparison.
For the following URL:
http://www.foo.com/engine123/submit.pl?name1=value1&n
ame2=value2
name*=value*

excludes the URL parameters name1=value1 and name2=value2


from the playback comparison.
For the following URL:
<A
HREF=/frameset/news.jsp?BV_SessionID=@@@@0166988701.0
932590606@@@@&BV_EngineID=calfdfllemjbfdicfmjcfkkdhhm
.0&selected=news.htm>
BV_EngineID=*,BV_SessionID=*,BV_SourceName=*

excludes the URL parameters

BV_SessionID=@@@@0166988701.0932590606@@@@&BV_EngineI
D=calfdfllemjbfdicfmjcfkkdhhm.0

Chapter 3: Recording and Playing Back Visual Scripts

71

Defining Exclusions to Playback Comparisons

E URL Parameter Values specifies URL parameter values to exclude

from Visual Script playback comparison using the following format:


LikePattern,[LikePattern],[]
LikePattern is the pattern to match for the value of the URL

parameter value. Each exclusion string must be separated from the


other exclusion strings by commas, as follows:

val1*,val2*,val3*,valN*

The following example shows how specific settings affect the playback
comparison.
For the following URL:
http://www.foo.com/engine123/submit.pl?name1=value1&n
ame2=value2
value*

excludes the URL parameters value1 and value2 from the playback
comparison.
E URL Subpaths specifies URL path values to exclude from Visual

Script playback comparison using the following format:


LikePattern,[LikePattern],[]

LikePattern is the pattern to match for the path of the URL. Each

exclusion string must be separated from the other exclusion strings by


commas, as follows:
path1*,path2*,path3*,pathN*

The following example shows how specific settings affect the playback
comparison.
For the following URL:
http://www.foo.com/engine123/submit.pl?name1=value1&n
ame2=value2
www*.foo.com,engine*

excludes the URL path parameters www.foo.com, engine123 and


submit.pl from the playback comparison.

72

e-Tester User Guide

Defining Exclusions to Playback Comparisons

Apply Automatic Contents Comparison Filters To specifies if specific


types of machine-generated Web page components should be included or
excluded from the playback comparison. These settings are used in cases
where HTML source appears to be machine-generated, but is necessary
for page navigation or other testing, e-Tester must override the defaults
heuristic comparison program for accurate playback comparison.
E URLs when selected, parts of URLs that appear to be machine-

generated are ignored during the playback comparison.

E Elements when selected, parts of form elements that appear to be

machine-generated are ignored during the playback comparison.

E Scripts when selected, parts of script literals that appear to be

machine-generated are ignored during the playback comparison.

E HTMLs when selected, parts of HTML that appears to be machine-

generated is ignored during the playback comparison.

The Automatic Contents Comparison Filters settings apply globally to the


Web page component types. Use the Text Pattern Masks setting with these
settings to specify the exclusion expression for comparison filters.

Chapter 3: Recording and Playing Back Visual Scripts

73

Defining Exclusions to Playback Comparisons

Excluding a Range of HTML Source


e-Tester lets you exclude specific segments of HTML source from the
Visual Script playback comparison. This method involves inserting <DIV
BV_BeginIgnore> and <DIV BV_EndIgnore> tags into the HTML
source of the page, directly around the HTML to exclude, as follows:
<BODY>
HTML Source that e-Tester will compare against Master on
playback of Visual Script.
<DIV BV_BeginIgnore>HTML differences ignored between start
and end DIV BV_BeginIgnore tag</DIV>
e-Tester ignores differences between Master and current
HTML Source on playback of the Visual Script.
<DIV BV_EndIgnore>HTML Source between start and end DIV
BV_EndIgnore tag is compared against Master on playback
</DIV>
HTML Source that e-Tester will compare against Master on
playback of Visual Script.
</BODY>

The excluded HTML source will not be tested and will not cause red
flags to be generated in the Visual Script during playback. The HTML
source excluded from the playback comparison will be shown in purple
text when you double-click on any Different HTML node in the Visual
Script.
Both <DIV BV_BeginIgnore> and <DIV BV_EndIgnore> require the
closing </DIV> tag. If you omit the <DIV BV_EndIgnore> tag, all
HTML differences that follow <DIV BV_BeginIgnore> will be ignored.

74

e-Tester User Guide

Chapter 4

Working with Visual Scripts


Visual Scripts define the baseline for testing of your Web site or application.
Recorded Visual Scripts include a set of default tests that are automatically
executed on playback of the script. These tests are designed for Anchors,
Elements, Forms, Frames, HTML, Images, Image Maps, Links,
ActiveX controls, Java Applets, VBScript, and JavaScript. The Visual
Scripts and default tests can be customized to suit your requirements
without programming.

Viewing Visual Scripts


e-Tester Visual Scripts show the recorded Web site or application as a tree
hierarchy. The Visual Scripts provide visual indications of the type of
recorded information, the structure of the site or application, and any
comparison problems encountered during playback. Comparison
problems are shown using simple color-coded flags in the script itself.

Changing the Visual Script Pane Width


To toggle the Visual Script pane width:
Select Window Resize Visual Script View or click the toolbar button.
or:
Click and drag the divider between the Visual Script pane and the
Browser pane.

Expanding and Collapsing the Visual Script


Visual Scripts form a tree hierarchy showing the structure of the Web site
or applications. When working with Visual Scripts, you will need to

75

Viewing Visual Scripts

expand the script, or sections of the script, to view specific nodes, add test
cases and modify default tests.
Collapsed Page
Expanded Page

Page Hierarchy

To expand and collapse the entire Visual Script:


E Select Edit Expand Script or select Edit Collapse Script.

To expand or collapse a specific Visual Script node:


1.

Select the node in the Visual Script.

2.

Click the
the node.

icon to expand the node or click the

icon to collapse

To expand and collapse Visual Script pages:


1.

Select the page node in the Visual Script.

2.

Select Edit Expand Page or click the icon next to the page node
or select Edit Collapse Page or click the icon to next to the page
node.
Note: You can also click the right mouse button and select the Expand
or Collapse
Collapse options from the popup menu.

Clicking the icon expands the page to its previous expanded state,
which might be one level or all levels depending upon the last time
the page was expanded.

76

e-Tester User Guide

Viewing Visual Scripts

Overview of Visual Script Nodes


Each Visual Script page in the hierarchy contains a set of sub-nodes that
define the structure of the page. The following nodes can be in the tree:
Address node: the URL for the page. Below this node are the duration

and any parameters used by forms.


E Duration node: shows the download time for the page and the playback

delay associated with the page. The playback delay is the actual amount of
time (think time) the user spent on the page before going to another page.

E Cookies node: shows the Client Request and Server Response values.
E Parameters node: shows the form elements and data values for form
results pages. If the page is mapped to a Data Bank, the Parameters

node shows which parameters are mapped to variables and bound to a


Data Bank file.
Custom Page Programmability node: the Visual Basic for Applications custom

programmability node. This node provides access to the VBA Integrated


Development Environment for custom page and script tests. Custom tests
created using the Custom Test Wizard appear below this node.
Frame node: the main frame for the entire page. Below this node are the

other components of the page.


E ActiveX node: lists the ActiveX objects in the page.
E Anchors node: list the anchors in the page.
E Form node: lists the forms and elements in the page.
E Frames node: lists the frames in a frames-based page.
E HTML node: contains the HTML source for the page.
E Images node: lists all images in the page.
E Java Applet node: contains the properties of Java Applets in the page.
E Links node: lists all links in the page.
E Scripts node: lists all VBScripts and JavaScripts in the page.
E Tests node: lists the user-defined test cases added to the Visual Script.
Chapter 4: Working with Visual Scripts

77

Viewing Visual Scripts

Note
Note: The Address, Custom Page Programmability, and Frame nodes are

always included in the Visual Script. The sub-nodes can vary depending
upon the structure of the recorded page. Web pages that include other
types of page components will have additional tree nodes displayed in a
similar fashion.
In addition to icons with textual identifiers (for example, HTML, images,
links, etc.), the Visual Script use the following icons:
Icon

Description

Plus icon node has lower level nodes.


Minus icon node fully expanded.
Page icon current page played back in the Browser.
Yellow flag ignore (skip) test.
Red flag test case failure.
Red and yellow flags ignore test failure.
Yellow flag with stripe test skipped by higher-level node.
Red flag with stripe failure ignored by higher-level node.
Red and yellow flags with stripes failure and skip test in
this node and a higher-level node has a yellow flag.
Arrow Parameter mapped to variable, but not bound to
Data Bank field.
Check mark Parameter mapped to variable and bound to
Data Bank field.
Failure flags appear after playback of the Visual Script if the baseline
version of the page differs from the version under test. You can set Ignore
flags manually for specific nodes after analyzing test results. Data Bank
icons appear after you use the Data Bank Wizard to map parameters to a
Data Bank file.

78

e-Tester User Guide

Viewing Visual Scripts

Exporting Visual Scripts


You can export Visual Script to an ASCII file.
To export the Visual Script to an ASCII file:
1.

Expand or collapse the Visual Script to show the node(s) you want to
export. The text in the exported file will appear the same as is shown
in the Visual Script pane.

2.

Select File Export Visual Script As. e-Tester opens a dialog box for
saving the file.

3.

Enter a file name and click OK.

You can use any ASCII editor to view or print the file. The following is an
example of a Visual Script exported to an ASCII file:
- [1] EMPIRIX|HOME
+ Address: http://www.empirix.com/
- Frame (EMPIRIX|HOME)
Html
+ Images
- Links
http://www.empirix.com:80/index.html
http://www.empirix.com:80/company/index.html
http://www.empirix.com:80/products/index.html
http://www.empirix.com:80/news/index.html
http://www.empirix.com:80/support/index.html
http://www.empirix.com:80/contact/index.html
http://www.empirix.com:80/success.html
http://www.empirix.com:80/partners.html
http://www.empirix.com:80/jobs.html
http://www.empirix.com:80/sitemap.html
http://www.empirix.com:80/y2k.html
+ [2] EMPIRIX|PRODUCTS|e-TEST SUITE
+ [3] EMPIRIX|NEWS & EVENTS|IN THE NEWS

The nodes with the minus (-) signs are nodes that were expanded in the
Visual Script pane when the script was exported. The nodes with the plus
(+) signs are nodes that were collapsed in the Visual Script pane when the
script was exported.

Chapter 4: Working with Visual Scripts

79

Editing Visual Scripts

Editing Visual Scripts


Once you record a Visual Script, you can modify the page hierarchy if
necessary. e-Tester lets you do the following:
E Copy pages
E Add Comments
E Move pages
E Delete pages
E Append pages
E Delete Visual Scripts

Copying Pages
To copy a page in the Visual Script:
1.

Select the page node to copy in the Visual Script

2.

Select Edit Copy Page.

3.

Select Edit Paste Page or click the toolbar button.

Moving Pages
To move a page in the Visual Script:
1.

Select the page to move in the Visual Script tree.

2.

Select Edit Cut or click the toolbar button.

3.

Select the page location in the Visual Script where you want the page
moved.

4.

Select Edit Paste or click the toolbar button. The page is pasted to
the Visual Script directly after the currently selected page.

Appending a Page
To append a page to the Visual Script:

80

1.

Load the page to append into the Browser pane.

2.

Select Run Record Current Page


Page or click the toolbar button. The
new page is appended to the end of the Visual Script.

e-Tester User Guide

Editing Visual Scripts

Deleting Pages
To delete a page from the Visual Script:
1.

Select the Page to delete in the Visual Script.

2.

Select Edit Delete Page or click the toolbar button.

Adding Comments
To add comments for an entire Visual Script:
1.

Select File Script Comments. The comments dialog box opens:

2.

Enter any text to document Visual Script modifications. Use


Shift-Enter to create a new line.

3.

Select OK or press Enter to close the Script Comments window.


Note: e-Tester automatically adds a date and time stamp each time

you save the Visual Script.


To add a comment line for a specific page of a Visual Script:
1.

Record a Visual Script

2.

Select the top-level node of the page where you want to add a
comment.

3.

Select Edit Add Comment to Page.

Chapter 4: Working with Visual Scripts

81

Editing Visual Scripts

The comments dialog box opens.

4.

Enter any text to document Visual Script page modifications. Page


comments are limited to a single line of text.

5.

Select OK.

The comment appears as a node in the Visual Script.

Deleting Visual Scripts


To delete a Visual Script:

82

1.

Select Admin Delete Scripts. The list of scripts opens:

2.

Select the Visual Script to delete.

3.

Click OK.

4.

Click Yes to confirm the deletion or click No to cancel.

e-Tester User Guide

Working with Default Tests

Working with Default Tests


Recorded Visual Scripts automatically include a set of default tests that
verify the existence of the following types of page items:
E Anchors
E Image Maps
E Elements
E Links
E Forms
E ActiveX Controls
E Frames
E Java Applets
E HTML
E Scripts
E Images
You can modify the default existence test for a specific page, for all pages
in a Visual Script, or a specific node in a Visual Script.

Modifying Default Tests for All Pages


To modify default tests for all pages:
1.

Select the first page in the Visual Script.

2.

Select Tests Modify Default Tests. The default test dialog box opens:

Apply Default Test


to All Pages

3.

Check the Apply to All Pages of Visual Scripts check box.

4.

Click OK.

Chapter 4: Working with Visual Scripts

83

Working with Default Tests

Modifying Default Tests for a Specific Page


To modify default tests for specific page:
1.

Select the page node in the Visual Script.

2.

Select Tests Modify


Modify Default Tests. You can also click the right
mouse button to select Modify Default Tests from the popup menu.

Apply Default Test


to Specific Page
Nodes

3.

Check or clear items as appropriate in the Test For Existence of group.

4.

Click OK.

Turning Off Default Tests for a Specific Node


To turn off default test for a specific node:
1.

Select the node in the Visual Script.

2.

Click the right mouse button and select Dont TTest


est (item).
Note: Nodes with ignored tests are identified with a yellow flag (

next to the node.

84

e-Tester User Guide

Running Resource Validation

Turning Off Existence Tests for a Specific Node


To turn off the existence test for a specific node
1.

Select the node in the Visual Script.

2.

Select Edit Properties. The properties dialog box opens:

3.

Clear the Execute Existence


Existence Test check box. Clearing this check box is
the same as clicking the right mouse button and selecting Dont Test
(item).

4.

Click OK.
Note: You can also press the F4 key to view properties, or click the
right mouse button and select Properties from the popup menu.

Running Resource Validation


The Resource Validation test checks the integrity of the referenced
resources (i.e. links, images, etc.) in your pages. The Resource Validation
test can be run automatically after playback of a Visual Script. You can
also run the Resource Validation test manually at any time.

Running Resource Validation Manually


To run the Resource Validation test:
1.

Select Run Resource Validation or click the toolbar button. The


Resource Validation window opens:

Chapter 4: Working with Visual Scripts

85

Running Resource Validation

Resource List

2.

Click the Start button.

3.

Wait for the tests to finish and view the validation results.
Validation Test Status

4.

86

Internet Status Code

Close the Resource Validation window when finished.

e-Tester User Guide

Running Resource Validation

Exporting Resource Validation Results


You can export the Resource Validation results to an ASCII file either
before or after running the resource Validation test.
To export Resource Validation results to a file:
1.

Select Run Resource Validation or click the toolbar button. The


Resource Validation window opens.

2.

Start the Resource Validation.

3.

When the Resource Validation test finishes, click Export. e-Tester


opens a dialog box for saving the file.

4.

Enter a file name and click OK.

You can use any ASCII editor to view or print the file. The following is an
example of an exported Resource Validation file before running the
Resource Validation test:
Item 1 Host: www.empirix.com Resource: Internet Status:
Item 1. 1 Host: www.empirix.com Resource:
Item 1. 2 Host: www.empirix.com Resource:
Item 1. 3 Host: www.empirix.com Resource:
Item 1. 4 Host: www.empirix.com Resource:
Item 1. 5 Host: www.empirix.com Resource:
Item 1. 6 Host: www.empirix.com Resource:

index.html
company.html
products.html
news.html
support.html
contact.html

The following is an example of an exported Resource Validation file after


running the Resource Validation test:
Item 1 Host: www.myweb.com Resource: Status:
Finished
Internet Status:
Item 1. 1 Host: www.myweb.com Resource: 'Default'
Status:
Passed
Resource Handle: 1180
Internet Status: 200
Item 2 Host: www.anotherweb.com Resource: Status:
Finished
Internet Status:
Item 2. 1 Host: www.anotherweb.com Resource: 'Default'
Status:
Failed - Internet Send Error
Error:
Internet Error: NAME_NOT_RESOLVED
Resource Handle: 1181
Wininet Error:
12007

The status and error information is listed after each item. The error
headings appear under an item only when an error occurred.
Chapter 4: Working with Visual Scripts

87

Running Resource Validation

Setting the Resource Validation Playback Option


The Resource Validation test runs automatically after playback of Visual
Scripts by default. You can turn on and off the automatic Resource
Validation test using the Playback Options.
To set the Resource Validation Playback option:
1.

Select Options Playback.

2.

Set or clear the Automatically Run Resource Validation After Playback


check box.

Set this Option to


Run Resource
Validation after
Playback

3.

Click OK.
The Playback Options setting affects the Resource Validation test for
the entire Visual Script.

88

e-Tester User Guide

Running Resource Validation

Turning Off Validation Tests for a Node


To turn off the validation test for a specific node:
1.

Select the node in the Visual Script.

2.

Select Edit Properties


Properties. The properties dialog box opens:

3.

Clear the Execute Validation Test check box.

4.

Click OK.
Notes: Validation tests are options only on Link nodes and Image nodes.

You can also press the F4 key to view properties, or click the right
mouse button and select Properties from the popup menu.

Setting Resource Validation Options


To set Resource Validation options:
Select Options Resource Validation. The Resource Validation dialog
box opens:

Chapter 4: Working with Visual Scripts

89

Working with Visual Script Properties

This dialog box lets you specify the default Resource Validation parameters.
Resource Validation the following option:
E Maximum Number of Threads the maximum number of threads

e-Tester uses to validate the existence of Web page resources (links,


images, etc.) Increasing the number of threads can improve performance.

E Perform After Each Iteration when selected, the Resource Validation

test runs after each playback iteration of the Visual Script.

For Every Host the following options:


E Maximum Number of Threads the maximum number of threads

e-Tester uses when accessing servers during resource validation tests.


Increasing the number of threads can improve performance.

E Timeout in Seconds the maximum amount of time e-Tester will wait

to receive a response from a server during the resource validation tests.

Working with Visual Script Properties


Each node of a Visual Script has a set of properties that define the baseline
information used to compare the Web site or application. This section
describes the various properties for the different types of Visual Script
nodes.

Viewing Visual Script Node Properties


To view Visual Script node properties:
1.

Select a node in the Visual Script.

2.

Select Edit Properties.


or:
Click the right mouse button and select Properties from the popup menu.
or:
Press the F4 key.
The dialog box that opens depends upon the type of node selected. The
following sections explain the options in each dialog box.

90

e-Tester User Guide

Working with Visual Script Properties

Basic Node Properties


All Visual Script nodes have a basic set of properties that provide
information about the node.

The dialog box shows the properties of the currently selected node of the
Visual Script. The properties are as follows:
Page the page number and title from the Visual Script.
Type the Visual Script node type: Frame, Scripts Collection, Image
Collection, Links Collection, Page, etc.
Name the page name assigned to this node.
Execute Existence Test when selected, the default existence test is run on

playback. The existence test verifies that the node exists in the current
version of the Web page or application during playback of the Visual Script.
When cleared, the test is ignored for the node. Clearing this check box is the
same as clicking the right mouse button and selecting Ignore Test.
Result the result of the existence test: passed or failed.

Chapter 4: Working with Visual Scripts

91

Working with Visual Script Properties

ActiveX Properties
This dialog box shows the properties of the currently selected ActiveX
node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: ActiveX.
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Attribute Name the name of the ActiveX attribute.
Attribute Value the value of the ActiveX attribute.

92

e-Tester User Guide

Working with Visual Script Properties

Address Node Properties


This dialog box shows the properties of the currently selected Address
node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Address.
Title the title of the page from the HTML source (<TITLE> </TITLE>

tag set).
URL the Uniform Resource Locator of the page.
Actions lists the Dynamic HTML and/or Java events to be played back.
The associated check box lets you include or exclude specific events in the
Visual Script playback. When selected, the event is included in playback.
When cleared, the event is not included.

Chapter 4: Working with Visual Scripts

93

Working with Visual Script Properties

Transition Criteria lists the criteria that must be met before allowing a

manual Page Snapshot that records state changes (i.e. user clicks, data
entered into forms, etc.) of a page. This relates to Java event transitions
and the automatic pacing setting within Options Java.
Attributes the duration and delay times as follows:
E Recorded Duration the amount of time in seconds required to record

the page.

E Tested Duration the amount of time in seconds required to test the

page.

E Delay Before Playback the amount of time in seconds e-Tester

delayed before playback of the page.

Base Final Event on Index when selected, e-Tester navigates pages using

the zero-based index of the event that occurred on the page (for
example, a click on Link[0], Link[1], etc.) and ignores any text related to
the event. When cleared, e-Tester navigates pages using the text for the
click events from the HTML source (for example, the text Link Text
within the HTML: <A HREF="nextpage.html">Link Text</A>). The
default setting is cleared.

Cookies Properties
This dialog box shows the properties of the currently selected Cookies
node of the Visual Script.

94

e-Tester User Guide

Working with Visual Script Properties

The properties are as follows:


Client Requests shows cookie information set during a client request to

the server.
E Cookie the cookie name.
E Comparison shows the comparison results between the Master Value

and the Tested Value.

E Master Value shows the cookie value when the page was recorded to

the Visual Script.

E Tested Value shows the cookie value when the page was played back

by the Visual Script.

Server Responses shows cookie information returned by the server.


E Cookie the cookie name.
E Comparison shows the comparison results between the Master

Response Value and the Tested Response Value.

E Master Value shows the comparison results between the Master Value

and the Master Response Value.

E Tested Value shows the comparison results between the Tested Value

and the Tested Response Value.

E Master Response Value the cookie from the server response when the

page was recorded to the Visual Script.

E Tested Response Value the cookie from the server response when the

page was played back by the Visual Script.

Chapter 4: Working with Visual Scripts

95

Working with Visual Script Properties

Custom Page Programmability Properties


This dialog box shows the properties of the currently selected Custom
Page Programmability node and Custom Test nodes of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: VBA Programmability.
Name a page name assigned to this node.
Result the result of the existence test: passed of failed.
Executes in specifies the product in which the custom test executes.
E e-Tester select this option if the Visual Script will be played back in

e-Tester for regression testing. e-Tester uses a full-featured browser


control that includes access to the Document Object Model (DOM) of
the Web page or application.

E e-Load Thick Client select this option if the Visual Script will be

played back in e-Load Thick Client mode for limited load testing.
e-Load Thick Client mode uses a full-featured browser control that
includes access to the Document Object Model (DOM) of the Web

96

e-Tester User Guide

Working with Visual Script Properties

page or application. e-Load Thick Client mode requires more system


resources and is less scalable than Thin Client mode.
E e-Load Thin Client select this option if the Visual Script will be played

back in e-Load Thin Client mode for full load and scalability testing.
e-Load Thin Client mode uses a browser control emulator that does
not include the Document Object Model (DOM). e-Load Thin Client
mode requires fewer system resources and is more scalable than Thick
Client mode.

Errors any error values returned by the custom VBA code for the Visual

Script page.
E Event Name the name of the playback event in which the error

occurred.

E Error Description any text description of the error returned from the VBA

code.

E Error Number any error number returned from the VBA code.

External Callout Test Properties


This dialog box shows the properties of the currently selected External
Callout test case node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Chapter 4: Working with Visual Scripts

97

Working with Visual Script Properties

Type the Visual Script node type: External Callout Test.


Page Identifier The title of the page from the HTML source (<TITLE>
</TITLE> tag set).
Execute
Execute Test when selected, e-Tester performs the external callout test on

playback.
Result the result of the External Callout test: passed or failed.
Invoke External Callout indicates when the External Callout test should

be invoked by e-Tester.
E Before Playback of Page when selected, the External Callout test is

performed before e-Tester plays back the Visual Script for the page.
e-Tester waits for a return value from the External Callout Server
before running default tests on the Web page.

E After Playback of Page when selected, the External Callout test is

performed after e-Tester plays back the Visual Script for the page.
e-Tester waits for a return value from the External Callout Server
before running default tests on next Web page in the Visual Script.

Return Values any return codes returned by the External Callout Server.
E Error Number from Server an error number returned from the

external the External Callout Server test.

E Error String from Server


Server a text description of the error returned from

the External Callout Server test.

98

e-Tester User Guide

Working with Visual Script Properties

Form Element Properties


This dialog box shows the properties of the currently selected Form
Element node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Element.
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Properties the list of the form element properties in the HTML source.
E Test when selected, the property and value are tested on playback.
E Property the form element attribute (i.e. type, name, value, etc.).
E Current Value the value of the property of the HTML Form element.

Chapter 4: Working with Visual Scripts

99

Working with Visual Script Properties

Form Element Test Properties


This dialog box shows the properties of the currently selected Form
Element Test node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Form Element Test.
Name a name attribute of the Form element in the HTML source.
Execute Test when selected, the Form element test case is executed on

playback.
Result the result of the Form element test: passed or failed.
Expression an expression to evaluate that tests the Form element.
Test Result shows if the expression evaluates True or False when you click
the Test button.
Test tests the expression entered in the Expression text box.

100

e-Tester User Guide

Working with Visual Script Properties

Form Node Properties


This dialog box shows the properties of the currently selected Form node
of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Form.
Name a name assigned to the Visual Script node.
Execute Existenc
Existence
e Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Attributes attributes of the <FORM> HTML source.
E Action the Action attribute of the <FORM> tag in the HTML source.
E Method the Method attribute of the <FORM> tag in the HTML source.
E Encoding the encoding scheme specified by the form in the HTML source.
E Target the target frame to go to in a Frames-based Web Site specified

by the form in the HTML source.

Chapter 4: Working with Visual Scripts

101

Working with Visual Script Properties

HTML Node Properties


This dialog box shows the properties of the currently selected HTML
node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: HTML.
Name a name assigned to the Visual Script node (<None> for HTML).
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
HTML Source the HTML source of the page.

102

e-Tester User Guide

Working with Visual Script Properties

Image Node Properties


This dialog box shows the properties of the currently selected Image node
of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Image.
Name the name and location of the image file.
Execute Existence Test
Test when selected, the default existence test is run on

playback.
Result the result of the existence test:

passed or failed.

Execute Validation Test when selected, the Resource Validation test is

run on playback. The Resource Validation verifies that the image exists in
the current version of the Web page or application during playback of the
Visual Script.
Result the result of the validation test:

passed or failed.

Details the status of the page resource during playback of the Visual

Script, as follows:
E Available the resource was found during playback of the Visual Script.
E Host not reachable e-Tester was unable to reach the host of this

resource during playback of the Visual Script.

Chapter 4: Working with Visual Scripts

103

Working with Visual Script Properties

e-Tester was unable to reach the link of this


resource during playback of the Visual Script.

E Link not reachable

E Unknown the resource status could not be validated during playback

of the Visual Script.

Java Applet Properties


This dialog box shows the properties of the currently selected Java Applet
node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Java Applet. Java Applet nodes can

also include subnodes for the classes used in the applet. The node types
vary depending upon the applet but may include Panel, Button, Label,
TextArea, etc. The subnode properties dialog box is the same as the Java
Applet node.
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Attribute Name the name of the Java Applet attribute.

The list of
Attribute Names will vary depending upon the type of node.

Attribute Value the value of the Java Applet attribute.

104

e-Tester User Guide

Working with Visual Script Properties

Link Node Properties


This dialog box shows the properties of the currently selected Link node
of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Link.
Name the name and location of the linked page.
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Execute Valida
Validation
tion Test when selected, the Resource Validation test is

run on playback. The Resource Validation verifies that the image exists in
the current version of the Web page or application during playback of the
Visual Script.
Result the result of the validation test: passed or failed.
Details the status of the page resource during playback of the Visual

Script, as follows:
E Available the resource was found during playback of the Visual Script.
E Host not reachable e-Tester was unable to reach the host of this

resource during playback of the Visual Script.

Chapter 4: Working with Visual Scripts

105

Working with Visual Script Properties

e-Tester was unable to reach the link of this


resource during playback of the Visual Script.

E Link not reachable

E Unknown the resource status could not be validated during playback

of the Visual Script.

Page Node Properties


All Visual Script nodes have a basic set of properties that provide
information about the node.

The dialog box shows the properties of the currently selected node of the
Visual Script. The properties are as follows:
Page the page number and title from the Visual Script.
Type the Visual Script node type: Page.
Name the page name assigned to this node.
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Advanced opens a dialog box for specifying advanced settings for Visual
Script playback. The advance settings are provided for special-case
circumstances involving URLs that are changed dynamically.

106

e-Tester User Guide

Working with Visual Script Properties

Panel Properties
This dialog box shows the properties of the currently selected Java Applet
Panel node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Panel.
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Attribute Name the name of the Java Applet Panel attribute.
Attribute Value the value of the Java Applet Panel attribute.

Chapter 4: Working with Visual Scripts

107

Working with Visual Script Properties

Parameter Properties
This dialog box shows the properties of the currently selected Form
element of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Parameter.
Name a name attribute to the form element in the HTML source.
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Attributes the attributes of the Parameter node in the Visual Script.
E Recorded Value the data value captured from a form in a Web page

or application during recording of the Visual Script.

E Tested Value the data value captured from a form in a Web page or

application during playback of the Visual Script.

E Mapped to Variable the name of the variable mapped to the

Parameter node of the Visual Script using the Data Bank Wizard.

Use Default value on play back when selected, the Visual Script plays
back using the value defined with the value= attribute of a name/value

pair in the page source. When cleared, the Visual Script plays back using
the recorded value or the value from a Data Bank.
108

e-Tester User Guide

Working with Visual Script Properties

Script Node Properties


This dialog box shows the properties of the currently selected Script node
of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Script.
Name a name assigned to the Visual Script node (<None> for Scripts).
Execute Existence Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Script Source the JavaScript or VBScript source from the Web page or

application.

Chapter 4: Working with Visual Scripts

109

Working with Visual Script Properties

Server Response Test Properties


This dialog box shows the properties of the currently selected Server
Response test case inserted into the Visual Script.

The properties are as follows:


Default Tests the basic node properties for the Server Response Test.
E Page the page number and title from the Visual Script.
E Type the Visual Script node type: Server Response Test.
E Name the user-assigned name for the Server Response Test.
E Execute Test when selected, the Server Response test case is executed

on playback.

E Result the result of the Server Response test case: passed or failed.

110

e-Tester User Guide

Working with Visual Script Properties

Page Specification the start and stop settings for the Server Response

Test. These settings are useful for testing Server Response time across
multiple pages.

E Start test on this page when selected, the Server Response test starts

on this page.

E End test on this page when selected, the Server Response test ends on

this page.

Time Specifications the time attributes of the Server Response test case.

E Elapsed Time During Recording actual time required to receive a

response from the server during recording of the Visual Script.

E Minimum Time Allowed for Playback the minimum amount of time

e-Tester will wait to receive a response from the server during playback.

E Maximum
Maximum Time Allowed for Playback the maximum amount of time

e-Tester will wait to receive a response from the server during playback.

E Elapsed Time During Playback the actual amount of time required to

receive a response from the server during playback.

Chapter 4: Working with Visual Scripts

111

Working with Visual Script Properties

Test Scriptlet Properties


This dialog box shows the properties of the currently selected Test
Scriptlet node of the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Test Scriptlet.
Execute Existen
Existence
ce Test when selected, the default existence test is run on

playback.
Result the result of the existence test: passed or failed.
Return Values any return codes returned by the Test Scriptlet.
E Error Number from Server
Server an error number returned from the Test

Scriptlet.

E Error String from Server a text description of the error returned from

the Test Scriptlet.

112

e-Tester User Guide

Working with Visual Script Properties

Text Matching Test Properties


This dialog box shows the properties of the currently selected Text
Matching test case inserted into the Visual Script.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: Text Matching Test.
Name the user-assigned name of the Text Matching test case.
Execute Test when selected, the Text Matching test case is executed on

playback.
Result the result of the Text Matching test: passed or failed.
Test For the type of text matching performed by the test case (presence
or absence of selected text).
Selected Text the text string to test for in the Web page or application.

Chapter 4: Working with Visual Scripts

113

Working with Visual Script Properties

WML Properties
This dialog box shows the properties of the currently selected WML node
of the Visual Script. WML nodes are recorded by Visual Scripts that
e-Tester records against Web applications designed for Wireless
Application Protocol (WAP) devices.

The properties are as follows:


Page the page number and title from the Visual Script.
Type the Visual Script node type: WML. WML nodes can also include

subnodes for the cards, decks, and other content in the WML file. The
node types vary depending upon the contents of the WML file.
Execute Existence Test when selected, the default test for Existence test is

run on playback.
Result the result of the existence test: passed of failed.
Attribute Name the name of the WML attribute. The list of Attribute

Names will vary depending upon the type of node.


Attribute Value the value of the WML attribute.

114

e-Tester User Guide

Chapter 5

Using Test Cases


In addition to the automatic existence and resource validation tests,
e-Tester lets you add specialized test cases to the pages of your Visual
Scripts. e-Tester includes the following types of test cases:
E Text matching
E Server response
E Form element
E Test Scriptlet test before or after playback
E External callout
E Custom VBA test
The following sections of this chapter explain each of the test cases and
how to use them with Visual Scripts.

115

Using Text Matching Tests

Using Text Matching Tests


Text Matching test cases let you detect the presence or absence of
complex phrases within the source of your Web pages. Text Matching
test cases can also be stored in a test case library for reuse.
When you insert a Text Matching test, e-Tester opens a dialog box for
setting the test attributes.

The dialog box has the following options:


Name enter a name for this test case. A test case name is required.
Pass When selects the type of test:
E Selected text is present the test case passes if the Selected Text is found

in the current Web page or application source.

E Selected text is absent the test case passes if the Selected Text is not

found in the current Web page or application source.

Selected Text specifies the text string to match in the Web page or

application source. You can capture text directly from the Web page or
application by highlighting a text string with the mouse before opening
the Text Matching test case dialog box. You can also enter or edit the text
manually, or reference Data Bank variables for verifying data-driven tests.
Test Result shows the current status of the test case.
Select From Test Library opens the test library to select a previously

defined Text Matching test case.


116

e-Tester User Guide

Using Text Matching Tests

Add to Test Library stores this test case in the test library.
Test on HTML performs the Text Matching test case interactively on the

current HTML. This button is active only if you edited or entered the
Selected Text manually.
Accept adds the test case to the selected page in the Visual Script.

The following sections explain how to use the Text Matching test case.

Adding a Text Matching Test Case


To add a Text Matching test case:
1.

Be sure the page you want to test is the current page in the Browser
pane. (Right-click the mouse and select Goto Page.)

2.

Highlight the text (in the Browser) that you want to match using the
mouse.

3.

Select Tests Insert Text Matching Test or click the toolbar button.
The highlighted text automatically appears in the Selected Text box of
the Insert Text Matching Test dialog box.
Note: You can enter any text to compare in the Selected Text box,

including references to variable names that get values from a Data


Bank file. The next section explains how to use variables with Text
Matching test cases.
4.

Enter a test case name.

5.

Select the Pass When option:


E Selected text is present the test case passes if the Selected Text is

found in the current Web page or application source.

E Selected text is absent the test case passes if the Selected Text is

not found in the current Web page or application source.

6.

Click Accept. The Text Matching test case is added under the Frame
node of the Visual Script page.

Chapter 5: Using Test Cases

117

Using Text Matching Tests

Using a Text Matching Test Case to Verify a DataDriven Test


The Text Matching test cases, combined with Data Banks, provide a
convenient way to verify the results of a data-driven test. Visual Scripts let
you map external data to script parameters using the Data Bank Wizard
so that a single script can play back using multiple data items. Text
Matching test cases let you compare the results returned by data-driven
tests to a Data Bank of expected results.
Performing a search using multiple data items is an example of a datadriven test. There are three categories of data for this type of test:
E the input data used to perform the search;
E the expected results data to use for comparison;
E the actual results data returned by the search.
When planning a Text Matching data-driven test, you must define the
input data and the expected results data. Once you set up the Data Bank
and the Text Matching test case in the Visual Script, e-Tester
automatically compares the actual data returned to the expected results
data during playback and returns pass or fail for the test.
Example 7 - Using the Data Bank Wizard on a Registration Form in the
Getting Started manual shows an example of creating a data-driven test
using Text Matching for verification against static text. The following
example provides a step-by-step explanation of how to create a data-driven
test using variables in Text Matching test cases and Data Bank data for
expected results verification.

Define the Input Data and Expected Results


Before creating the Visual Script to perform the test, you should define
the input data and the expected result for each input. For example, the
Home SuperStores example in the Getting Started tutorial includes a
search page for product data. The example in the tutorial uses the search
text Lamps, which returns a list of lamp products including the following:
Econ, 30 Inch Crusader with Light, 5 year warranty

118

e-Tester User Guide

Using Text Matching Tests

Making the assumption that if the text 30 Inch Crusader with Light is in the
page returned by the search for Lamps, the search was successful. With
known input data and expected results, you can build a Data Bank file
with multiple values to use for data-driven testing and verification, as in
the following example:
Input,Expected
Lamps,30 Inch Crusader with Light
Paints,Exterior Flat House Latex Paint
Plants,1 gallon Hosta assorted 1 quart

Searches for the products Lamps, Paints, and Plants are expected to return
the associated text string for a successful search.
The input data and expected results are not limited to single fields. For
example, you could set up a test where the input data is a username and
password, and the expected result is the first and last name of the user. In
this case, the Data Bank file would contain four fields, as follows:
username,password,firstname,lastname

The username and password fields are the input data fields and the
firstname and lastname fields are the expected result fields. Each record
in the Data Bank file would contain the actual data for each of the fields.
The following example shows a Data Bank file with multiple input data
fields and expected results fields:
username,password,firstname,lastname
jsmith,jms04P,John,Smith
mmcmillin,mmc46a,Mary,Mcmillin
jalexander,jda2a4,Jason,Alexander
rromano,rorFX2,Ray,Romano
jpurdue,jfp9vs,Jillian,Purdue

The Data Bank file with the input data and expected results should be
saved as a .csv file to the DataBank subdirectory of the installation
directory (C:\Empirix\eTEST is the default).

Record the Visual Script


Once you have created a Data Bank file with the input data and expected
results data, you can record a Visual Script that will use the data.
1.

Load the data input page for your application into the Browser (for
example the search or login page).

Chapter 5: Using Test Cases

119

Using Text Matching Tests

2.

Start recording a Visual Script.

3.

Enter and submit the input data. You can use any representative
input data for script recording purposes.

4.

Wait for the results page to return.

5.

Stop recording the Visual Script.

Map and Bind the Data Bank to the Visual Script


Once you have the Data Bank file and the Visual Script, you use the Data
Bank Wizard to connect the two.
1.

Start the Data Bank Wizard.

2.

Add new variable names for each field in the Data Bank file. Specify
each variable as External - Map to External Data Source.
Click to Add New Variables
Define Variable
For Each Data
Bank Field
Parameters in
Visual Script

3.

120

Map the variables for the input data fields to the corresponding
Visual Script parameters.

e-Tester User Guide

Using Text Matching Tests

Click to Add Mapping


Select Variable
for Input Data
Select Script
Parameter

Input Data
Variables
Mapped to
Parameters

4.

Click the Data Binding tab.

5.

Select the Data Bank file containing the input data and the expected
results data.

6.

Bind each input data field and each expected results data field to the
corresponding variable name in the wizard.
Select Data Bank File

Click to Add Binding

Select Data
Bank Field
Select
Variable

Variables
Mapped to
Data Bank
Field Names

Chapter 5: Using Test Cases

121

Using Text Matching Tests

7.

Click Fetch Record to cycle through the records in the Data Bank file.

8.

Click OK to close the Data Bank Wizard.

Insert a Text Matching Test Case


After mapping and binding the Data Bank file to the Visual Script, you
insert a Text Matching test case into the Visual Script to perform a test
for the expected results data. e-Tester lets you specify a variable name as
part of the Selected Text attribute of the Text Matching test case.
1.

Select the results page in the Visual Script.

2.

Select Tests Insert Text Matching Test.

3.

Enter a name for the test case.

4.

Select the Pass When option (typically set to Selected text is pr


present
esent
for data-driven tests).

5.

Type the variable names for the expected results fields into the
Selected Text box in the form <<var_name>>. You can also enter
static text that you expect to be part of the results page, as shown
below:

Enter Static
Text and
Variable
Names

6.

Click Accept to finish the test case.

7.

Save the Visual Script.

Play Back the Visual Script with Iterations


Once the Data Bank file, Visual Script, mapping and binding, and Text
Matching test case are set up, you can play back the Visual Script to
perform the test. The e-Tester Iterate feature is used to cycle through data
in a Data Bank file on playback.
122

e-Tester User Guide

Using Text Matching Tests

1.

Select Run Playback Iterate.

2.

Select Playback with Data Bank and Use All Records.

3.

Click Iterate.

The Visual Script plays back once for each record in the Data Bank file.
On each playback, the Visual Script passes the input data to the Web
application, and then the Text Matching test case compares the results
page with the data in the expected results fields. Any failures are
indicated by a red flag on the Text Matching node of the Visual Script.

Editing Text Matching Test Cases


To edit a Text Matching test case:
1.

Select the test case to edit in the Visual Script.

2.

Double-click to open the Modify Text Matching Test dialog box.


or:
Select Admin Test Library, select a test case and click Modify.

3.

Enter changes.

4.

Click OK.

Adding Text Matching Test Cases to the Library


To add Text Matching test cases to the library:
1.

Select Admin Test Library.

2.

Click Add.

3.

Enter a test case name.

4.

Select the Pass When option.

5.

Enter the text to match in the Selected Text edit box.

6.

Click Accept in the Text Matching Test dialog box.

7.

Click OK in the Administer Test Library dialog box.

or:
1.

Insert a new test or edit an existing Text Matching test.

Chapter 5: Using Test Cases

123

Using Text Matching Tests

2.

Click the Add Test to Library button.

3.

Click Accept in the Add Test to Library dialog box.

4.

Click Accept in the Text Matching test case dialog box.

Using Text Matching Test Cases from the Library


To use a Text Matching test case from the library:
1.

Select the page in the Visual Script.

2.

Select Tests Insert Text Matching Test.

3.

Click Select From Test Library.

4.

Select the test case name.

5.

Click OK.

6.

Click Accept.
The Text Matching test case is added under the Frame node of the
Visual Script page.

Deleting Text Matching Test Cases from the Library


To delete a Text Matching test case from the library:
1.

Select Admin Test Library.

2.

Select the test case to remove.

3.

Click Remove.

4.

Click OK.

Deleting Text Matching Test Cases from the Script


To delete a Text Matching test case from the Visual Script:

124

1.

Select the test case node in the Visual Scripts.

2.

Select Edit Delete Text Matching Test or click the toolbar button.

3.

Click Yes to confirm or No to cancel.

e-Tester User Guide

Using Server Response Tests

Using Server Response Tests


Server Response test cases measure the response time of a server access of
one or more pages in a Visual Script. You can use Server Response test
cases to determine how long it takes for the server to return a specific page
or a set of pages.
When you insert a Server Response test, e-Tester opens a tabbed dialog
box for setting the test attributes.
Server Response test cases can be run across multiple pages within the
current Visual Script and across multiple Visual Scripts when the scripts
are run in e-Monitor and e-Load.
The Page tab contains the following options:

Current Page shows the page in the Visual Script where the test case will

be added.
Page Specification defines the page specifications, as follows:
E Name specifies the name of the Server Response test.
E Start test o
on
n this page when selected, starts the Server Response test

on this page.

E End test on this page when selected, ends the Server Response test on

this page.

Chapter 5: Using Test Cases

125

Using Server Response Tests

The Time tab is available when End test on this page is selected. The Time
tab contains the following options:

Page Retrieval defines the time values, as follows:


E Elapsed Time During Recording shows the time required to receive a

response from the server during recording of the Visual Script.

E Minimum Time Allowed for Playback sets the minimum amount of

time e-Tester will wait to receive a response from the server during
playback.

E Maximum Time Allowed for Playback sets the maximum amount of

time e-Tester will wait to receive a response from the server during
playback.

Adding a Server Response Test Case


To add a Server Response test case:

126

1.

Select the page where you want to start (or end) a Server Response
test in the Visual Script.

2.

Select Tests
Tests Insert Server Response Test or click the toolbar button.

3.

On the Page tab, enter a name for the Server Response test in the
Name field.

4.

Select the Start test on this page checkbox if you want to start the
Server Response test on the current page.
- or e-Tester User Guide

Using Server Response Tests

Clear the Start test on this page checkbox if you started the Server
Response test on a different page.
5.

Select the End test on this page checkbox if you want to end the
Server Response test on the current page.
- or Clear the End test on this page checkbox if you want to end the Server
Response test on a different page.

6.

Click the Time tab if End test on this page is selected.

7.

Enter the minimum and maximum amount of time allowed for


playback.

8.

Click OK.
e-Tester adds the test case to the Visual Script between the Address
and Frame nodes.

Editing Server Response Test Cases


To edit a Server Response test case:
1.

Select the test case to edit in the Visual Script.

2.

Double-click to open the Modify Server Response Test dialog box.

3.

Enter changes on the Page and Time tabs.

4.

Click OK.

Deleting Server Response Test Cases from the Script


To delete a Server Response test case from the Visual Script:
1.

Select the test case node in the Visual Scripts.

2.

Select Edit Delete Server Response or click the toolbar button.

3.

Click Yes to confirm or No to cancel.

Chapter 5: Using Test Cases

127

Using Form Element Test Cases

Using Form Element Test Cases


Form Element test cases compare attributes and values for the elements in
HTML forms.
When you insert a Form Element test, e-Tester opens a dialog box for
setting the test attributes.

This dialog box lets you specify the comparison options for a form
element of a page.
Name enter a name for this test case. A test case name is required.
Specify Comparison Condition specifies the comparison condition to use

for the test.


E Select Property specifies the property to test for the selected Form

element. Select the property to test.

E Current Value shows the value of the Form element property when

the Visual Script was recorded.

E Select Test Criteria specifies the type of comparison to perform on

playback of the Visual Script, as follows:

'
Property Must Always be Empty verifies that the selected property

is empty.

'
Property
Property Must Always be a Number verifies that the selected

property contains a number.

128

e-Tester User Guide

Using Form Element Test Cases

'
Property Must Always be a String verifies that the selected

property contains a text string.

'
Property Must Always be in Range verifies that the selected

property contains a numeric value that falls within a specified


range. You must specify the range expression.

'
Property Must Satisfy Expression verifies that the selected
property contains a value that evaluates True. You must specify the

expression to evaluate.
'
Property Must Equal Vari
Variable
able verifies that the selected property

contains a value that equals a Data Bank variable value. You must
specify the variable in an expression.

E Specify Expression enter an expression to evaluate.


E Test Result shows if the expression evaluates True or False when you
click the Test button.
E Test tests the expression entered in the Specify Expression text box.

Adding a Form Element Test Case


To add a Form Element test:
1.

Expand the Visual Script page that contains recorded Form


Elements.

2.

Select the Form Element to test.

3.

Select Test Insert Form Element Test.

4.

Enter a test case name.

5.

Select the Property to compare.

6.

Select the Test Criteria.

7.

If necessary, enter a comparison expression. The following criteria


require an expression:
E Property Must Always be in Range
E Property Must Satisfy Expression
E Property Must Equal Variable

8.

Test the result.

Chapter 5: Using Test Cases

129

Using Form Element Test Cases

9.

Click OK.
The Form Element test case is added under the Element node of the
Form in the Visual Script.

Form Element Test Case Expressions


Expressions used in the Form Element test cases test properties of the
Form element. The following are examples of the valid Form Element
expressions:
Property Must Always be in Range:
Value >=LOWER_BOUND AND Value <= UPPER_BOUND
Value >=Cdate("10/10/00") AND Value<=Date

Property Must Satisfy Expression:


Type="text"
Name="string"
Value=Date
Disabled="False|True"

Property Must Equal Variable:


Value=DBVarValueOf("var_Search")

See Using Internal Variables in Chapter 8 for additional information


about using expressions.

130

e-Tester User Guide

Using Test Scriptlets

Using Test Scriptlets


Test Scriptlets are calls to your own VBScript code snippets that you add
to the e-Tester Visual Scripts. e-Tester includes two menu options for
adding Test Scriptlets to Visual Scripts.
E Selecting Tests Insert Test Scriptlet
Scriptlet Before adds a Test Scriptlet that

runs before playing back the Visual Script page.

E Selecting Tests Insert Test Scriptlet After adds a Test Scriptlet that

runs after playing back the Visual Script page.

When you add a Test Scriptlet to a Visual Script, the e-Tester browser
pane changes to a script-editing pane where you can define your own
VBScript code as a Test Scriptlet. The following illustration shows the
script-editing pane:
Script Editing Pane

Test Scriptlet
in Visual Script

When you first add a Test Scriptlet, the script-editing pane only contains
the text Your Script Here. You add your Test Scriptlet code and
comments to define the test.

Chapter 5: Using Test Cases

131

Using Test Scriptlets

The following illustration shows the script-editing pane with a VBScript


code snippet:
Test Scriptlet
in Script Editing Pane

Enter your VBScript code into the script-editing pane. Click Done and
Save the Visual Script when finished editing the Test Scriptlet.
The code for Test Scriptlet test cases can access the Document Object
Model of the Web page, evaluate and modify elements and properties,
access Data Bank values, and change Visual Script page navigation
programmatically based upon specific conditions.
e-Tester includes the e-Test Programming Interface (e-PI), which provides
several methods and properties that you can use when developing Test
Scriptlets. Chapter 10 of this manual explains how to use Test Scriptlets to
extend your Visual Script testing capabilities. Appendix B contains a
reference for the e-PI methods and properties that you can use in your
custom code.

132

e-Tester User Guide

Using External Callout Test Cases

Using External Callout Test Cases


External Callout tests are your own customized code in an external
ActiveX .dll that e-Tester can access. e-Tester includes the e-Test
Programming Interface (e-PI) that provides several methods and
properties that you can use when developing code for External Callout
tests. Chapter 10 of this manual explains the specific guidelines for
creating ActiveX .dll files for External Callout tests.
The following sections explain how to use External Callout tests.

External Callout Test Cases


When you insert an External Callout test, e-Tester opens a dialog box for
setting the test attributes.

This dialog box lets you define an External Callout test case. The
External Callout Test has the following options:
External Callout OLE Server information about the OLE server, as follows:
E Program Id the ProgID key under the CLSID entry of the Registry for

the OLE Server.

E Status the status of the OLE server. Either Available or Unavailable.


E Error shows an error string returned if the OLE server is Unavailable.
E Test Server tests for the OLE Server and returns the Status.

Chapter 5: Using Test Cases

133

Using External Callout Test Cases

Invoke Callout Function specifies when to invoke the external callout test.
E Before playback of page when selected, the tests are called before

e-Tester plays back the page.

E After playback of page when selected, the tests are called after

e-Tester plays back the page.

E Page Identifier shows the page title from the Visual Script.

Creating an External Callout Test


To create an External Callout test:
1.

Specify an external callout server. This is an ActiveX .dll that you can
build using Visual Basic, Visual C++, Visual J++ or any other
environment that offers support for building ActiveX .dll files.
Note: e-Tester contains a sample Visual Basic Project that you can
customize to create an ActiveX .dll to use for External Callout tests.
The filename is rswsample.vbp and is located in the RSWSource

directory under the installation directory. Look in the class


RSWServer included in the project. RSWSampl.cls is the source file.
2.

Add your testing logic in the two methods of the server. There are
two methods that your server must support.
E beforePagePlay
E afterPagePlay

The code for External Callout test cases can assess the Document
Object Model of the Web page, evaluate and modify elements and
properties, access Data Bank values, and change Visual Script page
navigation programmatically based upon specific conditions.
Chapter 10 explains the requirements for creating an ActiveX .dll to
use for External Callout tests. e-Tester also includes the e-Test
Programming Interface (e-PI) that provides several methods and
properties that you can use when developing External Callout tests to
extend your Visual Script testing capabilities. Appendix B contains a
reference for the e-PI methods and properties that you can use in your
custom code.

134

e-Tester User Guide

Using External Callout Test Cases

3.

Add an External Callout test case to the page in the Visual Script
where you want to perform your custom tests.

Determining the External Callout Server Program ID


When adding External Callout test cases to a Visual Script, you must
provide the Program ID for your external callout server.
To determine the external callout server program ID:
1.

Create, build, and register your Active X .dll.

2.

Run regedit or regedit32, located in your System directory.

3.

Search for the name of your .dll and determine its CLSID.

4.

Search for the CLSID in the registry.

5.

Under the CLSID entry, look for the ProgID key. The ProgID is the
name of the server to specify in the e-Tester External Callout test case.

Adding an External Callout Test Case


To insert an External Callout test case:
1.

Select the page you want to test in the Visual Script.

2.

Select Tests Insert External Callout Test or click the toolbar button.

3.

Enter the name of the External Callout OLE Server in the Program
Id field.

4.

Click the Test Server button and make sure the Status field returns
Available.

5.

Select the Before playback of page and After playback of page


checkboxes as appropriate.

6.

Click OK.

Chapter 5: Using Test Cases

135

Using External Callout Test Cases

Setting External Callout Options


The External Callout options let you specify the default External Callout
OLE Server and test its status.
Selecting Options External Callout opens the External Callout options
dialog box:

External Callout OLE Server specifies the default server and status, as

follows:
E Program Id enter the Program ID of the OLE Server to use as the

default server.

E Status shows the current status of the OLE server. Either Available or
Unavailable.
E Error an error string returned if the OLE server is Unavailable.
E Test Server tests for the OLE Server and returns the Status. The test

evaluates the Program ID and determines if the ID points to a valid

ProgID key in the registry for the OLE Server.

136

e-Tester User Guide

Using Custom Tests

Using Custom Tests


Visual Scripts recorded in e-Tester can be extended using Visual Basic for
Applications (VBA). VBA is a version of Microsoft Visual Basic that is
fully integrated into e-Tester. e-Tester Visual Scripts include default
Visual Basic projects that are automatically created when you record the
Visual Scripts.
The Visual Basic projects include pre-defined objects and procedures that
you can use to perform custom tests based upon Visual Script playback
events. The custom tests can be performed for the entire Visual Script or
on a page-by-page basis. Custom code can also be shared between Visual
Scripts.
In addition, e-Tester includes a Custom Test Wizard that provides a
convenient way to create custom Visual Basic tests for specific objects in
Web pages. The Custom Test Wizard provides point-and-click object
selection and lets you specify the text or property to test and the type of
test to perform. e-Tester generates the Visual Basic code for the test and
adds it to the Visual Scripts VBA project.
You can use all of the features and capabilities of the Visual Basic
environment to customize the e-Tester-generated code and expand your
testing capabilities.

Using the Custom Test Wizard


e-Test includes a Custom Test Wizard that lets you select Web page
objects, specify test options, and automatically generate Visual basic code.
The following sections explain how to use the Custom Test Wizard and
the available options.

Selecting the Page to Test


Before inserting a custom test using the Custom Test Wizard, the page
where you want to add the custom test must be the current page displayed
in the Browser pane.
1.

Select the page node of the Visual Script where you want to add the
custom test.

Chapter 5: Using Test Cases

137

Using Custom Tests

2.

Click the right mouse button and select Goto Page. e-Tester opens
the page in the Browser pane.

When you start the Custom Test Wizard, the wizard creates the custom
test for the page in the Browser pane.

Starting the Custom Test Wizard


The Custom Test Wizard creates Visual Basic tests based upon a selected
Web page object and the test options you define in the wizard.
Selecting Tests Insert Custom Test opens the first panel of the Custom
Test Wizard. The first panel is where you specify a name for the test, an
error string, and where the test should execute.

The Welcome panel has the following options:


Test Name specifies the name for the custom test. The name identifies

the custom test in the Visual Script node and in the VBA environment.
Test Error String
String specifies an error string to be returned to e-Tester if an

error occurs during a custom test. This error string will be included in the
Visual Script node for the custom test if an error occurs in the test. The
value of the errDescription property in the Visual Basic code also will
be included in the Visual Script node.
Where should the test execute? specifies the target Visual Script

playback mode. Select one of the following settings:


E e-Tester select this option if the Visual Script will be played back in

e-Tester for regression testing. e-Tester uses a full-featured browser

138

e-Tester User Guide

Using Custom Tests

control that includes access to the Document Object Model (DOM) of


the Web page or application.
E e-Load Thick Client select this option if the Visual Script will be

played back in e-Load Thick Client mode for limited load testing.
e-Load Thick Client mode uses a full-featured browser control that
includes access to the Document Object Model (DOM) of the Web
page or application. e-Load Thick Client mode requires more system
resources and is less scalable than Thin Client mode.

Click Next to select the Web page element to test.

Selecting a Web Page Object


After clicking Next in the Welcome screen, a window opens that shows
the path of the element below the mouse pointer.

The Current Path is the object model location of the Web page object
currently beneath the mouse cursor. The objects in the browser pane
change color to highlight the current Web page object.
The Visual Script pane shows the Web page hierarchy and shows the
location of the element, currently below the mouse pointer, in the page
source.
Chapter 5: Using Test Cases

139

Using Custom Tests

Select a Web page element in the Browser pane or the Visual Script pane
using the mouse. The object model path is added to the Select Object
Model Element window as the Selected Path. The selected element path
appears in the window in the form window[1].htmlTag[#].
Click Accept Selected in the Object Model Element window.

Specifying Test Details


After selecting an element from the Web page, the Custom Test Wizard
reopens with the element information. The following options are available:

The Select path and property panel options are as follows:


Selected Element
Element specifies the Web page element selected for testing. The
selected element is represented in the form window[1].htmlTag[#].
window[1] is the e-Tester browser window. htmlTag[#] is the HTML

tag and index number in the Web page in source order. For example, the
third image tag in the Web page source is represented as img[3].

Choose what you want to test specifies what part of the element you

want to test. Select one of the following options:


E Text when selected, the text of the selected Web page element appears

and is used for the test.

E Properties when selected, the Document Object Model properties of

the selected Web page element appear in the list. The Custom Test
Wizard lets you specify tests for specific Web page element properties.

140

e-Tester User Guide

Using Custom Tests

If you select Properties, select the property of the Web page element to test
from the list. The Property selection of the Select path and property panel
has the following options:

The options are as follows:


Name lists the names of the Web page element properties. The list of
properties is specific to the selected element object.
Value shows the values of the Web page element properties.

Select the element property to use for the test from the list.

Specifying Path Generation Rules


You can also specify path generation rules for the selected element using
the Select element and property panel. Path generation rules specify
additional detail about the location of the selected element.

Chapter 5: Using Test Cases

141

Using Custom Tests

Clicking the arrow button opens the Path Generation Rules options of the
Select path and property panel. The following options are available:

The options are as follows:


Path Generation Rules lists the defined path generation rules. Use the

following options to add, modify, or remove the rules.


E New opens a dialog box for adding a new rule.
E Modify opens a dialog box for modifying an existing rule.
E Remove removes the selected rule from the list.

Selecting New opens a dialog box for defining a new path generation rule:

142

e-Tester User Guide

Using Custom Tests

The options are as follows:


New Rule
Rule Settings specifies the parent tags and attributes to use for the

path generation rule.


E Choose Tagname of elements to which the rule applies selects the

HTML tag name.

E Select all acceptable


acceptable parent tags selects the HTML tags to use as the

parent tags for selected tag. Click the


to the list.

button to add the selected tags

E Select attributes used to locate the element within the parent selects

the HTML tags attribute to use to locate the selected tag within the
parent tag(s). Click the button to add the selected attribute to the list.

E Add Rule adds the rule to the Custom Test Wizard.

When you add a new rule, the Custom Test Wizard defines the rule in the
Path Generation Rules list.

The Selected Element is updated to include the parent tags and attribute.
The Selected Element path uses the following format:
window[index].parent.[index].element(attribute=
'value')[index]

A path of window[1].td[3].a(innerText='support')[1] indicates


the first A (anchor) element with the inner text support in the third TD
(table cell) in the HTML source in Window 1 in source order.
Chapter 5: Using Test Cases

143

Using Custom Tests

Specifying the Type of Test


After selecting the path and property options and clicking Next, the
Custom Test Wizard opens a panel for selecting the type of test to
perform. The available options depend upon the type of property to test:
String, Boolean, Date, or Numeric. The available options depend upon
the type of property. The following sections explain the options for each
type of property.
Boolean Properties
The Boolean options appears if you selected a Boolean property of the

selected Web page element. Set the following options:

Test Element shows the selected property and element path.


Choose Test Type specifies the type of test: [Bool | String].
Bool specifies the Boolean values and test options. Set the following

options:
E True when selected, the test passes if the property value is True during

playback of the Visual Script.

E False when selected, the test passes if the property value is False

during playback of the Visual Script.

144

e-Tester User Guide

Using Custom Tests

E Equal to the databank variable below when selected, the test passes if

the property value is equal to the Data Bank variable value during
playback of the Visual Script. Select a Data Bank variable name. Data
Bank variables must be defined using the Data Bank Wizard in
e-Tester before they are available for selection.

E [Data Bank Variable Name] lists the defined Data Bank variables

defined in the Data Bank Wizard.

Clicking Finish opens the Visual Basic environment and automatically


generates the Visual Basic code for the test.
Date Properties
The Date options appears if you selected a date property of the selected

Web page element. Set the following options:

Test Element shows the selected property and element path.


Choose Test Type specifies the type of test: [Date | String].
Date specifies the date values and test options. Set the following options:
E [Current Value] shows the current value of the selected date

property.

Chapter 5: Using Test Cases

145

Using Custom Tests

E [Operator] specifies the comparison operator to use for the test. The

following operators are available:


Operator

Description

>

Greater than

<=

Less than or equal to

Equal to

>=

Greater than or equal to

<

Less than

!=

Not equal to

From

Specifies a From-to range.

E [value] the value to use for the test.


E Use DataBank when selected, the test passes if the date value is equal

to the Data Bank variable value during playback of the Visual Script.
Select a Data Bank variable name. Data Bank variables must be
defined using the Data Bank Wizard in e-Tester before they are
available for selection.

E [Data Bank Variable Name] lists the Data Bank variables defined in

the Data Bank Wizard.

If you select the From operator, the Custom Test Wizard adds a field for
specifying the date range:

146

e-Tester User Guide

Using Custom Tests

Specify the from-to range.


Clicking Finish opens the Visual Basic environment and automatically
generates the Visual Basic code for the test.
Numeric Properties
The Numeric options appears if you selected a numeric property of the

selected Web page element. Set the following options:

Test Element shows the selected property and element path.


Choose Test Type specifies the type of test: [Numeric | String].
Numeric specifies the numeric value and test option. Set the following

options:
E [Current value] shows the current numeric value of the selected

property.

E [Operator] specifies the comparison operator to use for the test. The

following operators are available:


Operator

Description

>

Greater than

<=

Less than or equal to

Equal to

>=

Greater than or equal to

<

Less than

Chapter 5: Using Test Cases

147

Using Custom Tests

Operator

Description

!=

Not equal to

From

Specifies a From-to range.

E [value] specifies the value to use for the test.

If you select the From operator, the Custom Test Wizard adds a field for
specifying the numeric range:

Specify the from-to range.


Clicking Finish opens the Visual Basic environment and automatically
generates the Visual Basic code for the test.

148

e-Tester User Guide

Using Custom Tests

String Properties
The String options appears if you selected a string property of the selected

Web page element. Set the following options:

Test Element shows the selected property and element path.


Choose Test Type specifies the type of test: String.
String specifies the string value and test option. Set the following option:
E [Current Value] shows the current value of the selected text or

property.

matches the following specifies the type of match to use for the test. The

following options are available:


E Exact the test passes if the text or property value matches exactly the

current value of the text string during playback of the Visual Script.

E Wildcard the test passes if the text or property value matches the
current value of the Visual Basic Like operator pattern during playback

of the Visual Script.


E Regular Expression the test passes if the text or property value matches

the current value of the Regular Expression pattern during playback of the
Visual Script.

E [Value] specifies the text string, wildcard, or Regular Expression to

match on playback of the Visual Script.

Clicking Finish opens the Visual Basic environment and automatically


generates the Visual Basic code for the test.
Chapter 5: Using Test Cases

149

Using Custom Tests

Using Wizard-Generated Code


Once you finish selecting options in the Custom Test Wizard, the Wizard
automatically opens the Visual Basic Development Environment and
generates a custom test in the Visual Script project.

Wizard Generated
Code
Project Explorer
Window

The Visual Basic Project Explorer window contains the default project for
the Visual Script. The project name is the same name as the Visual Script.
The Custom Test Wizard also generates Visual Basic code based upon
your selections and the type of Web page element property. The wizardgenerated code is added to the Visual Script VBA project as a new
document. The document name is the name defined in the Welcome
panel of the Custom Test Wizard.

150

e-Tester User Guide

Using Custom Tests

The code for custom tests is added to the performTest event of the
RSWVBATest object. Each custom test created by the Custom test Wizard
includes the RSWVBATest object with the following events and properties:
Property/Event

Description

errDescription

Specifies an error description to pass to


e-Tester.

errNumber

Sets an error number to pass to


e-Tester or gets an error number from
e-Tester.

performTest

Executes code for Custom VBA tests.

RSWApp

Property reference to the RSWApp class


of the VBADLL type library.

Appendix B provides a complete reference for the events and properties.


You can customize the Wizard generated code using all of the features
and capabilities available in Visual Basic. See the Microsoft Visual Basic
online help for additional information about using the features and
capabilities.
The Project Explorer window also includes a shared code project. The
shared code project can contain code that will be used by all Visual
Scripts. You can write your own custom Visual Basic code in any of the
Visual Script page documents or in the shared code project.
The code for custom tests can access the Document Object Model of the
Web page, evaluate and modify elements and properties, access Data
Bank values, and change Visual Script page navigation programmatically
based upon specific conditions.
e-Tester includes the e-Test Programming Interface (e-PI) that provides
several methods and properties that you can use when developing custom
tests. See Chapter 10 and Appendix B for more information about using
e-PI to extend your Visual Script testing capabilities.

Chapter 5: Using Test Cases

151

Using Custom Tests

Capturing Page Elements


The Wizard generated code uses the GetElementByPath method of the
e-PI to locate Web page elements. e-Tester includes an option for
selecting Web page elements and copying the path to the Windows
clipboard.
Clicking the Get Path to Element button on the e-Tester toolbar opens
the Select Object Model Element window over e-Tester.

The Current Path is the object model location of the Web page object
currently beneath the mouse cursor. The objects in the browser pane
change color to highlight the current Web page object.
The Visual Script pane shows the Web page hierarchy and shows the location
of the element, currently below the mouse pointer, in the page source.
Select a Web page element in the Browser pane or the Visual Script pane
using the mouse. The selected element path appears in the window in the
form window[1].htmlTag[#].
Select Copy El
Element
ement Path in the Select Object Model Element window.
The object model path is copied to the Windows clipboard. You can paste
the element path into Visual Basic code to use with the
GetElementByPath method.

Closing the Visual Basic Window


When finished with the wizard-generated code, select File Close and

Return to ee-Tester.

The custom test is added as a node below the Custom Page


Programmability node.

152

e-Tester User Guide

Chapter 6

Working with Test Results


Playing back Visual Scripts compares the recorded baseline (master) of
the Web site or application and compares the baseline to the current
version (tested version). Test results appear as flags in the Visual Script
and in the Results log pane. e-Tester provides the following options for
working with test results:
E Locating and viewing test results
E Accepting or discarding tested pages
E Ignoring specific differences and test cases
E Using the Results log

Locating and Viewing Test Results


After playing back a Visual Script, you need to evaluate any differences
that e-Tester detects between the baseline and the tested pages.
Visual Scripts nodes with failures are identified with a red flag (
to the node.

) next

153

Locating and Viewing Test Results

Locating Failures in Visual Scripts


To locate failures in the Visual Script:
1.

Select Results Find Next Failure or press the F3 key.


or:

2.

Select Results Find Previous Failure or press the Shift-F3 keys.


You can also expand Visual Script pages manually to locate failure flags.

Viewing HTML Differences


To view HTML differences:
1.

Double-click a Different HTML node in the Visual Script.

2.

Use the scroll bars to examine the HTML source.

The HTML from the recorded Web page (master) is shown in blue text.
The HTML from the Web page used for playback (tested) is shown in
red text.
e-Tester uses a heuristic program to determine and exclude machinegenerated components of Web page source that can change dynamically
(i.e. session IDs) when visiting a site. The machine-generated components
will not be tested and will not cause red flags to be generated in the Visual
154

e-Tester User Guide

Locating and Viewing Test Results

Script during playback. Any HTML that is excluded from the playback
comparison is shown in purple text.
The Different HTML node only appears in the Visual Script after playback
if there are differences found in the HTML for a Web page.

Viewing JavaScript/VBScript Differences


To view JavaScript/VBScript differences:
1.

Double-click a Different Script node in the Visual Script.

2.

Use the scroll bars to examine the Script source.

The Script from the recorded Web page (master) is shown in blue text.
The Script from the Web page used for playback (tested) is shown in red text.
The Different Script node only appears in the Visual Script after playback if
there are differences found in the JavaScript or VBScript for a Web page.
Any JavaScript/VBScript that is excluded from the playback comparison
is shown in purple text.

Chapter 6: Working with Test Results

155

Accepting and Discarding Tested Pages

Accepting and Discarding Tested Pages


When you play back a Visual Script against a new version of a Web page
or application, e-Tester compares the baseline Visual Script to the Web
page or application. If there are differences, e-Tester creates a tested
version of the Visual Script and flags those differences in the Visual
Script pane.

Accepting Tested Pages


Accepting tested pages means that the tested version of the Visual Script is
used as the new baseline (master) Visual Script for future testing of the
Web page or application.
You can accept the tested version of the Visual Script on a page-by-page
basis or for the entire Visual Script.
To accept tested pages:
1.

Select Results Accept Tested Page.


or:
Select Results Accept
Accept All Tested Pages.

Discarding Tested Pages


Discarding tested pages means that the tested version of the Visual Script
is deleted and the original baseline (master) Visual Script will be used for
future testing of the Web page or application.
You can discard the tested version of the Visual Script on a page-by-page
basis or for the entire Visual Script.
To discard tested pages:
1.

156

Select Results Discard Tested Page.


or:
Select Results Discard All Tested Pages.
e-Tester User Guide

Ignoring Specific Failures and Test Cases

Ignoring Specific Failures and Test Cases


In some cases, you may want to ignore specific failures or test cases. For
example, when testing search results pages, you know the HTML source
for the page will be different each time. In this case, you can have the
Visual Script ignore comparison failures on the HTML node of the script.

Ignoring Specific Failures on Playback


To ignore a specific failure on playback:
1.

Select the node with a failure in the Visual Script.

2.

Click the right mouse button and select Ignore (type) Test Failure
from the popup menu.
Nodes with ignored test failures are identified with red and yellow
flags ( ) next to the node.
Nodes with striped flags (
the Visual Script tree.

) are ignored by a higher level node in

Ignoring a Specific Test Case on Playback


To ignore a specific test case on playback:
1.

Select the test case node in the Visual Script.

2.

Click the right mouse button and select Ignore (type) Test from the
popup menu.
Nodes with ignored tests are identified with a yellow flag (
to the node.

Chapter 6: Working with Test Results

) next

157

Using the Results Log

Using the Results Log


In addition to the flags used in the Visual Scripts, the Results log shows
the following additional details about playback results.
Drag to Adjust Width

Playback Results Summary

Test # the test number within an e-Tester session. Each playback of the
Visual Script increments the Test #.
Time the time and date of the test action.
Iteration the iteration number if playback iterations were used.
Action the playback action. The Action column always shows the

beginning and ending time and date of the Visual Script playback. Other
information can be listed in the Action column depending upon the
settings in the result log options and playback options. You can set the
options in the Report section of Options Results Log to show failures
only or all details. You can also set the playback options to automatically
run the Resource Validation test after playback. The Action column also
shows the results of the Resource Validation test.
Elapsed Time the amount of time required to initiate a request (for

example, user input) and receive a response from the server and display
the page components (HTML, images, links, etc.).
Result the test result: passed or failed.
Summary shows additional information about failed tests.

See the next section, Analyzing Results Log Timelines, for additional
information about the Time and Elapsed Time information.

158

e-Tester User Guide

Using the Results Log

Analyzing Results Log Timelines


The result log Time and Elapsed Time columns provide a way for you to
analyze and measure the efficiency of your Web pages or application. The
following are guidelines for analyzing the start/stop times for Visual
Scripts and the elapsed time for individual pages.
Visual Script page playback includes the following basic timeline components:
Visual Script
Playback
Timelines

Request
Action Initiated
through Browser
(User Input)

Response
Display Page
Components
(HTML, Images
Links, etc. )

Test Cases
Automatic Tests
Cases (HTML
Validation, Forms
Links, Images, etc.)

Timeline 1

Elapsed Time

Timeline 2

Elapsed Time + Test Case Time

Timeline 3

Elapsed Time + Test Case Time + Recorded Delay

Think Time
Time Spent Between
Actions Intiated
through Browser
(Recorded Delay)

The Request component is the moment a user action is initiated from within
the browser to the server. This can be a click on a link to another page, a
form submission, or other action that requires a response from the server.
The Response component is the amount of time it takes for the server to
process the request and return all components of the requested page.
The Test Cases component is the amount of time it takes to perform the
default existence and validation tests of the Visual Script plus the time it
takes to complete any user inserted test cases (for example text matching
or server response test cases).
The Think Time component is the actual amount of time that occurred
between page navigation when the Visual Script was recorded. Visual
Scripts can be played back with or with out the recorded delay by setting
or clearing the Play with Recorded Delay Between Pages check box in the
Playback Options.

Chapter 6: Working with Test Results

159

Using the Results Log

When analyzing Results logs, you can use the timestamp to determine the
amount of time required to playback a specific page or the entire Visual Script.
Overall Visual Script Time (10:59:57 - 10:59:34 = 23 seconds)

Specific Page Time (10:59:52 - 10:59:47 = 5 seconds)

The timestamp times include the Request, Response, Test Case, and
Recorded Delay times of the playback run (either Timeline 2 or Timeline 3
on the previous page).
You can also evaluate the effects of the recorded delay on page playback.
The following example shows the log with the results from two different
playbacks of the same Visual Script. The first playback (Test# 1) did not
use the recorded delay for playback. The second playback (Test# 2) did
use the recorded delay (think time).
Without Recorded Delay (10:59:57 - 10:59:34 = 23 seconds)

With Recorded Delay (11:00:55 - 11:00:15 = 40 seconds)

160

e-Tester User Guide

Using the Results Log

Setting Results Log Options


The Results log options is where you specify the log file name, the logging
mode and the type of data to include in the log.
Select Options Results Log.

This dialog box lets you specify the Results log file name and mode.
Log File Name specifies how to name the Results log file, as follows:
E Default to Script Name when selected, the Results log file name is the

same name as the current Visual Script file with a .LOG extension.

E Default to Workspace Name when selected, the Results log file name

is the same name as the current Workspace with a .LOG extension.

E Use Specified Name when selected, you can specify any name. Enter

the name in the text box.

E Prepend Workstation Name to Log File Name when selected, the

name of the workstation is added to the beginning of the log file name.

Logging Mode specifies how to write to the log file, as follows:


E Overwrite
Overwrite Log when selected, e-Tester overwrites the Results log file

with new results data each time the Visual Script is played back.

E Append to Log when selected, e-Tester appends results data to the

end of current Results log file during Visual Script playback.

E Do Not Log when selected, e-Tester does not write results data to the

log file. The results data still appears in the Results log pane of e-Tester.

Chapter 6: Working with Test Results

161

Using the Results Log

Report specifies the type of data to include in the Results log, as follows:
E Failures Only when selected, e-Tester includes only failure indications

in the Results log.

E All Details when selected, e-Tester includes all testing details in the

Results log.

Showing and Hiding the Results log Pane


To show or hide the Results log pane:
Select Window Resize Output Log View or click the toolbar button.

Selecting a Visual Script Page from the Results Log


To select a Visual Script page from the Results log:
1.

Double click the corresponding number in the Test # column of the


Results log.

Double-Click Number to View Page

2.

Select Edit Expand Page to view the Visual Script for the page.
The Test # must be from the last playback cycle in the Results log.

Viewing Resource Validation Results from the


Results Log
To view Resource Validation from the Results log:
Double-click the corresponding number in the Test # column for the
Resource Validation entry of the Results log.

162

e-Tester User Guide

Using the Results Log

Resource Validation Log Entry


Double-Click to View Validation

e-Tester open the Resource Validation window with the results from the
last time the Resource Validation test was run.

Appending to the Results Log


To append to a Results log file:
1.

Select Options Results


Results Log.

2.

Select Append to Log.

3.

Play back the Visual Script.

Exporting the Results Log


To export the contents of the e-Tester Results log pane:
1.

Select File Export Output Log As. e-Tester opens a dialog box for
saving the file.

2.

Enter a file name and click OK.

You can use any ASCII editor to view or print the file. The following is an
example of a Results log exported to an ASCII file:
Test 1 Time:12:36:57PM 2/3/00 Action:BEGIN TESTING SCRIPT:Script2
Test 1 Time: 12:36:58 PM 2/3/00 Action: [1] Welcome
Elapsed Time: 0.07 secs
Result:
Failed
Summary:
Different HTML
Test 1 Time: 12:36:58 PM 2/3/00 Action:[2] Kitchens
Elapsed Time: 0.14 secs
Result:
Failed
Summary:
Different HTML
Test 1 Time: 12:36:58 PM 2/3/00 Action:[3] Lighting
Elapsed Time: 0.15 secs
Result:
Passed
Test 1 Time:12:36:58PM 2/3/00 Action:END TESTING SCRIPT:Script2

Chapter 6: Working with Test Results

163

Using the Results Log

Saving Results Log Files


To save a Results log file:
1.

Select File Save Output Log As.

2.

Enter a file name and click OK.


e-Tester saves Results log files to the current Workspace as the
default location. The Workspace is a user-specified subdirectory of
the installation directory (C:\Empirix\eTEST is the default).
The Results log file is save in an e-Tester format that can be viewed
or exported to an ASCII file using Results View Results Log.

Overwriting Results Logs


To overwrite a Results log:
1.

Select Options Results


Results Log.

2.

Select Overwrite Log.

3.

Play back the Visual Script.

Clearing the Results Log Window


To clear the Results log window:
1.

164

Select Edit Clear Output Window.

e-Tester User Guide

Using the Results Log

Viewing Saved Results Logs in e-Tester


To view a saved Results log file in e-Tester:
1.

Select Results View Results Log.

2.

Select the log file from the Select Results Log list. The Results log file
contains the following information:
Select Results Log specifies the name of the log file to view.
Session # shows the number of the e-Tester session..
Test # shows the test number within an e-Tester session. Each
playback of the Visual Script increments the Test #.
Time shows the start time and date for the test action.
Iteration shows the iteration number if playback iterations were

used.
Action shows the playback action.
Elapsed Time shows the amount of time required to test the page.
Result shows the test result: passed or failed.
Summary shows additional information about failed tests.
Chapter 6: Working with Test Results

165

Using the Results Log

Export exports the Results log to a file. Select the type of file (Text
or HTML).

Exporting Saved Results Logs


To export a saved Results log to an ASCII file or an HTML file:
1.

Select Results View Results Log.

2.

Select the log file from the Select Results Log list.

3.

Select the type of file (text or HTML).

3.

Click Export. e-Tester opens a dialog box for saving the file.

4.

Enter a file name and click OK.

Viewing Saved Results Logs in a Browser


To view a saved Results log file in HTML format in a Browser:

166

1.

Open and play back the Visual Script for which you want to view
results.

2.

Select Results View Results Log - HTML.

e-Tester User Guide

Using the Results Log

e-Tester opens the a new Web browser window containing the results.
e-Tester also saves the results into an HTML file using the name
VisualScriptName.htm.
The browser version of the results log contains the same information as in
the e-Tester Results Log Viewer plus a d-Tracker column. Log entries
that indicate Warning or Failure will include a Submit button for
transferring information into the d-Tracker issue management system.
d-Tracker is a separate product from the e-TEST suite, which you may or
may not have installed.

Deleting Results Logs


To delete a Results log file:
1.

Select Admin Delete Logs.

2.

Select the log file to delete and click OK.

3.

Click Yes to confirm.

Chapter 6: Working with Test Results

167

Setting Error Recovery Options

Setting Error Recovery Options


The error recovery options determine how e-Tester handles errors that
occur during playback of Visual Scripts.
Selecting Option Error Recovery opens the Error Recovery dialog box:

This dialog box lets you view the current error recovery settings and select
the error recovery options to change.
Test the test categories for error recovery:
E Default Page Test recovery options for pages that failed any of the

e-Tester default page tests.

E Server Response Test recovery options for Server Response test case

failures.

E Text Matching Test recovery options for Text Matching test case

failures.

E Form Element Test recovery options for Form Element test case

failures.

E External Callout Test recovery options for External Callout test case

failures.

E Resource
Resource Validation Test recovery options for Resource Validation test

failures.

E Page Timeout recovery options for a page timeout.


168

e-Tester User Guide

Setting Error Recovery Options

E New Content recovery options for pages that have new content.
E Missing Content recovery options for pages that are missing content.
E Browser Errors recovery options for errors that occur in the Browser.
E Severe Content Errors recovery options for pages that have had a large

amount of content changes.

E Navigation Failed recovery options for Web navigation failures.


Error Type the current setting for each type of test: Fatal or Non-Fatal.
Skip Remaining Pages the current setting for each type of test:
E True playback skips the remaining pages in the Visual Script if an error

occurs. If the Visual Script is playing back with iterations, playback


continues at the beginning of the Visual Script with the next iteration.

E False playback continues with the next page in the Visual Script if an

error occurs.

Skip Remaining Iterations the current setting for each type of test:
E True playback halts after the current iteration is finished if an error occurs.
E False playback continues the current and subsequent iterations if an

error occurs.

Notify Monitor the current setting for each type of test:


E True e-Tester provides notification to e-Monitor that the error

occurred in a Visual Script. e-Monitor Shell Scripts can include


additional error handling options.

E False e-Monitor is not notified that an error occurred in the Visual Script.

Chapter 6: Working with Test Results

169

Setting Error Recovery Options

Changing Error Recovery Settings


To change the error recovery settings for a specific type of test:
1.

Select Option Error Recovery.

2.

Select the type of test.

3.

Click the Modify Actions button to open the Modify Error Options
dialog box.

4.

Change the settings as necessary.

5.

Click OK.
You can change the settings for each type of test.

170

e-Tester User Guide

Chapter 7

Using e-Spider
The e-Spider automatically searches the HTML pages that make up your
Web site or Web application. The e-Spider allows you to quickly and
easily generate a Visual Script from a set of linked pages without having to
manually navigate the pages.
The e-Spider will not follow any links that use a protocol other than Http or
Https. It automatically ignores links such as News, Telnet, FTP, MailTo, etc.
The e-Spider automatically dismisses confirmation dialogs box that
appear for links to downloadable executables or documents and marks
these links with yellow flags. The e-Spider does not list links to
documents in other domains and will not follow them.
Note: If you have a very large site or application, it is not advisable to try

to spider the entire site from the home page due to time and system
resource issues. A more efficient approach is to identify related sections of
your site or application and create a set of modular Visual Scripts by first
manually navigating to a specific section and then starting e-Spider.

171

Main Window Features

Main Window Features


This section explains the main window, the menu options, and the
associated toolbar buttons. The e-Spider main window consists of the
menu bar, toolbar, address line, site map tree, and a status line.
Title Bar and Menu
Toolbar
Starting URL or File
Site Map Tree

Status Line

The Title bar of the window shows the program name followed by the
current Map file name and the status.

File Menu
The File menu options let you work with e-Spider Map files. The
following options are available:
New Site Map clears the e-Spider tree window for creating a new map file.
Open Site Map opens a dialog box for selecting the map file to open.
Save Site Map saves the current e-Spider tree to a file. If you have not

saved the file previously, a dialog box opens for specifying the name.
Save Site Map As saves the current e-Spider tree to a new file name. A

dialog box opens for specifying the name.


Export Site Map As exports the e-Spider map to an ASCII file.
Exit closes the e-Spider.

172

e-Tester User Guide

Main Window Features

Edit Menu
The Edit menu options let you specify the pages to include when
spidering a site. The following options are available:
Ignore Page the page and all pages linked below the page will not be

included when you run the e-Spider and/or generate a Visual Script.
Ignore All Other Pages all other pages in the e-Spider tree will not be

included when you generate a Visual Script.


Append Page to Tree appends a results page generated by a form page

to the e-Spider tree.


Delete Page removes the selected page from the e-Spider tree.
Exclude URLs the selected URLs will not be included when you run the

e-Spider and/or when you generate a Visual Script.

Run Menu
The Run menu options let you start, stop, and continue the e-Spider. You
can also generate Visual Scripts. The following options are available:
Start starts searching pages that make-up the Web site or application.
The starting point is the URL specified in the Address drop down list.
Continue continues searching the pages.
Generate Visual Script generates a Visual Script based upon the pages in

the e-Spider tree.


Stop stops the e-Spider.
Set Maximum Levels opens a dialog box for specifying the maximum

number of levels to spider.

Tools Menu
The Tools menu options let you access other tools in the e-TEST suite.
The following options are available:
e-Tester switches focus to the e-Tester window.

Chapter 7: Using e-Spider

173

Main Window Features

e-Load starts e-Load for running load and performance testing on Web

applications.
e-Monitor starts e-Monitor for creating defining jobs that can playback

multiple e-Tester Visual Scripts.

Help Menu
These options let you access the e-Spider on-line help.

Address Line
The Address line shows the top level URL where e-Spider starts scanning
Web pages. By default, e-Spider enters the URL of the page currently
displayed in the Browser pane of the e-Tester main window. However,
you can also type a URL manually.

Site Map Tree


The map tree shows the hierarchy of the Web pages under the top-level
page. The icons represent the following:
Icon

Description
Description

Plus icon node has lower level nodes.


Minus icon node fully expanded.
White with planet original.
Blue with planet completed.
White with red border stopped by user.
Yellow flag ignore page when generating Visual Script.
x flag child pages have been deleted from Spider tree.
F flag page with a form.
T flag page with a frame transition.
Yellow bar left of planet page did not complete
successfully or timed out.
174

e-Tester User Guide

Setting Maximum Navigation Depth

Status Bar
The status bar provides status and current progress information. The
mode determines the information that appears in the status bar. The status
bar panes from left to right are as follows:
Spider Status shows the current status of e-Spider.
Current Site shows the current location.
Count shows the number of pages navigated by e-Spider.

Setting Maximum Navigation Depth


The e-Spider allows you to specify the maximum depth to which it navigates
through your Web site or application. To set the maximum navigation
depth, select Run Set Maximum Levels. Enter the number of levels and
click OK.

Working with e-Spider


e-Spider provides a convenient way to map an entire Web site or application
with manual navigation. You can use e-Spider to do the following:
E Create a tree hierarchy of the site
E Append pages to the tree
E Delete pages from the tree
E Ignore pages in the tree
E Exclude specific URLs
E Generate a Visual Script from the tree
E Save the tree to a map file.

Starting e-Spider
To start the e-Spider:
1.

Load the Web page or application to start from into the e-Tester
Browser pane.

2.

Select Tools ee-Spider or click the toolbar button.

3.

In the e-Spider window, select Run Start or click the toolbar button.

Chapter 7: Using e-Spider

175

Working with e-Spider

4.

Wait for the e-Spider to finish or click the Stop button.


Note: The e-Spider does not navigate below Web pages that contain
forms. Pages with forms are shown with an F icon ( ) next to the

page node. The e-Spider provides an interactive capability so that you


can navigate to pages with forms, fill in the form, navigate to the
pages below, and then add the generated pages to the e-Spider.

Pausing and Resuming e-Spider


To pause and resume the e-Spider:
1.

Select Run Stop or click the toolbar button to pause.

2.

Select Run Continue or click the toolbar button to resume.

Stopping e-Spider
To stop the e-Spider:
1.

Select Run Stop or click the toolbar button.


The Run Stop option and toolbar button are only active while
e-Spider is actively searching through a Web site.

Appending Pages to the Tree


The e-Spider allows you to interactively add form results pages to the
e-Spider tree so that data input into the form will be captured with the
results page as Visual Script parameters.
To append a page to the e-Spider tree:

176

1.

Double-click a Web page with a form icon ( ) in the e-Spider tree


to load the page in the e-Tester Browser pane.

2.

Enter data into the form fields.

3.

Click the Web page Submit button. The Web page Submit button
can have any text label, such as Register, Search, or Finished.

4.

Wait for the Results page returned by the Web application


processing the form.

5.

Select Edit Append Page to Tree or click the toolbar button.


e-Tester User Guide

Working with e-Spider

The new page is appended one level below the form page in the
e-Spider tree.

After you generate a Visual Script from the e-Spider tree, the form
elements and data appear under the Parameters node of the Visual
Script page.

Deleting Pages from the Tree


To delete a page from the e-Spider tree:
1.

Select the page in the e-Spider tree.

2.

Select Edit Delete Page or click the toolbar button.


Deleted pages will not be included in the Visual Script when you
click the Generate Visual Script button in the e-Spider window.

Chapter 7: Using e-Spider

177

Working with e-Spider

Excluding URLs in e-Spider


Excluding URLs lets you define specific locations that e-Spider will
bypass when mapping Web sites or applications and generating Visual
Scripts.
To exclude URLs in e-Spider:
1.

Start e-Spider.

2.

Select Edit Exclude URLs or click the toolbar button.

3.

Click the Add button in the Exclude URLs dialog box.

4.

Type in the URL to be excluded. If you selected a node in the


e-Spider tree, the URL for that node automatically appears in the
dialog box.

5.

Click OK.
Exclude URLs will exclude locations relative to the URL of the starting
page. In order to exclude /subfolder/doc.htm, enter subfolder/doc.htm, not
http://www.mycompany.com/subfolder/doc.htm.

178

e-Tester User Guide

Working with e-Spider

Modifying an Excluded URL


To modify an excluded URL in e-Spider:
1.

Start e-Spider.

2.

Select Edit Exclude URLs or click the toolbar button.

3.

Select the URL in the URLs to Exclude list.

4.

Click the Modify button in the Exclude URLs dialog box.

5.

Edit the URL to be excluded.

6.

Click OK.

Ignoring a Page in the Tree


To ignore a page in the e-Spider tree:
1.

Select the page to ignore in the e-Spider tree.

2.

Select Edit Ignore


Ignore Page or click the toolbar button.
Ignored pages will not be included in the Visual Script when you
select Run Generate Visual Script in e-Spider.
Ignored pages will not be included when you run the e-Spider using
the Spider Site button.
Ignored pages are identified using a yellow flag (
page node.

) next to the

Ignoring All But the Current Page in the Tree


To ignore all but the current page in the e-Spider tree:
1.

Select the page in the e-Spider tree.

2.

Select Edit Ignore All Other Pages or click the toolbar button.
All pages except the current page are marked with yellow flags.

Chapter 7: Using e-Spider

179

Working with e-Spider

Generating a Visual Script from e-Spider


To generate a Visual Script using the e-Spider:
1.

Load the Web page or application to start from into the Browser
pane.

2.

Start the e-Spider.

3.

Select Run Start or click the toolbar button.

4.

Wait for the e-Spider to finish or click the Stop button.

5.

Make any edits to the e-Spider tree as necessary:


E Append form results pages.
E Ignore pages.
E Delete Pages.

6.

Select a node in the e-Spider tree, as follows:


E Topmost node: generate Visual Script for entire e-Spider tree.
E Any leaf node: generate Visual Script from top to this node (inclusive).
E Any middle node: generate Visual Script from top to this node and

all its child nodes.

180

7.

Select Run Generate Visual Script or click the toolbar button. The
new Visual Script appears in e-Tester.

8.

Save the map file.

9.

Close the e-Spider window.

e-Tester User Guide

Working with Map Files

Working with Map Files


Map files let you save the e-Spider tree for future use. If you modify the
e-Spider tree, saving the tree to a map file lets you save those modifications.
You can also export the tree to an ASCII file.

Saving Map Files


To save an e-Spider tree to a map file:
1.

Select File Save Site Map or click the toolbar button.

2.

If the tree has not been saved before, a dialog box opens for entering
a file name.

3.

If necessary, enter a file name and save the file.

Creating a New Map File


To clear the current e-Spider tree and start a new map:
1.

Select File New Site Map or click the toolbar button.

2.

If you have an unsaved e-Spider tree, a message appears asking if you


want to save the current tree to a map file.

3.

Click Yes to save the tree to a map file or No to discard the tree.

Opening an Existing Map File


To open a saved map file:
1.

Select File Open Site Map or click the toolbar button.

2.

Select the file and click OK.

Chapter 7: Using e-Spider

181

Working with Map Files

Exporting the Site Map Tree


To export the site map tree:
1.

Select File Export Site Map As. e-Spider opens a dialog box for
saving the file.

2.

Enter a file name and click OK.

You can use any ASCII editor to view or print the file. The following is an
example of a Site Map tree exported to an ASCII file:
- "EMPIRIX|HOME" - www.empirix.com/
"EMPIRIX|HOME" - index.html
"EMPIRIX|COMPANY|ABOUT EMPIRIX" - company/index.html
- "EMPIRIX|PRODUCTS|e-TEST SUITE" - products/index.html
- "EMPIRIX|PRODUCTS|e-TESTER" - products/etester.html
- products/etesterfeature.html
- products/tester.pdf
- "EMPIRIX|PRODUCTS|e-MONITOR"-products/emonitor.html
- products/emonitorfeature.html
- products/monitor.pdf
- "EMPIRIX|PRODUCTS|e-LOAD" - products/eload.html
- products/eloadfeature.html
- products/eload.pdf
"EMPIRIX|PRODUCTS|FEATURES" -products/feature.html
- products/t_suite.pdf
- "EMPIRIX|NEWS & EVENTS|NEWS" - news/index.html

182

e-Tester User Guide

Chapter 8

Using Data Banks


e-Tester lets you use data from a Data Bank file. Data Banks are used to
hold unlimited amounts of input data that can be automatically fed into
your Web application. During playback, the parameters in the Web page
are filled with values from the Data Bank file.

Using the Data Bank Wizard


The Data Bank Wizard provides a convenient way to use Data Banks
with Visual Scripts. The Data Bank Wizard lets you map parameters in a
Visual Script to variable names, and then bind the variable names to fields
in Data Bank files.
Visual Script
Parameters

e-Tester
Variables

Data Bank File

The Data Bank Wizard dialog box has two tabs:


E Variables tab
E Data Binding tab

The following sections explain the tab options.


183

Using the Data Bank Wizard

Data Bank Variables Tab


The Variables tab of the Data Bank Wizard dialog box lets you create
variables and map the variables to the parameters in the script.

Parameters lists the parameters recorded into the Visual Script from

forms, JavaScript, or other user input controls. The Parameters list has
two columns:
E Name lists the parameter name and Visual Script page number.
E Recorded Value shows the data value recorded to the Visual Script.
Variables specifies variable names to be mapped to the parameters from

the Visual Script. You can add variable names and mappings manually
using the Add Variable and Add Mapping buttons. You can also add
variables and parameters using the AutoAuto-Map button. Variable names are
used to bind to fields in a Data Bank file.
E Add Variable button opens a dialog box for defining a variable name.
Type in the name of a variable and click OK.

184

e-Tester User Guide

Using the Data Bank Wizard

E Delete Variable button deletes the selected variable. Select the name
to delete from the Variable list and click this button. A confirmation
dialog box appears. Click OK to delete the variable. Deleting a variable

also deletes any mapping that it may have with the parameters and any
binding with fields from the Data Bank file.
E Add Mapping button maps a variable to a parameter from the script.

All recorded parameters that are mapped will be replaced with the
values from the Data Bank files if the variable is bound to a field. If
variables are mapped but not bound to fields the recorded value will be
used during playback.

E Remove Mapping button removes the selected variable/parameter


mapping from the Mappings list.
Mappings lists the current mapping of Visual Script parameters to

variables and values.


E Parameter Name shows the parameter name from the Visual Script

and the Parameters list.

E Variable Name shows the variable name from the Variable list.
E Variable Value shows the value of the variable from the current

record if the variable is bound to a field from a Data Bank file.

E Recorded Value shows the value of the parameter as recorded into the

Visual Script.

E Tested Value shows the value of the parameter that was last supplied to

the parameter during playback. In most cases, this will be the variable
value.

E Current Record From Databank shows the current record that

e-Tester is using for playback from a Data Bank file.

E Fetch Record advances the record pointer to the next record in the

Data Bank file and updates the list view controls with the data from the
current record.

E Goto Record opens a dialog box for specifying the record to retrieve

from the Data Bank file and updates the list view controls with the data.

Chapter 8: Using Data Banks

185

Using the Data Bank Wizard

Data Binding Tab


The Data Binding tab of the Data Bank Wizard dialog box lets you bind
variables to fields in a Data Bank file.

Data Bank specifies the Data bank file containing data to use as

parameters during playback of the Visual Script.


E Select button opens the file selector dialog box for attaching a Data

Bank file. The default directory for e-Tester Data Bank files is the
\DataBank directory under the installation directory (C:\Empirix\eTEST
is the default).

E Clear button clears the Data Bank file selection, any fields in the Data
Bank Fields list, and any bindings that the variables may have to fields.
Variables lists the variable names mapped to the parameters nodes in the

Visual Script.
Data Bank Fields lists the field names from the Data Bank file.
Bindings shows which variables are bound to which fields from the Data
Bank file. The columns in the Bindings list view are as follows:
E Variable name shows the names of the variables mapped to

parameters in the Visual Script.

186

e-Tester User Guide

Using the Data Bank Wizard

E Field Name shows the name of the Data Bank field to which the

variable is bound.

E Field Value shows the current value of the field from the Data Bank

file for the current record.

E Field Number shows the number for the field (field1, field2, will have

numbers 1 and 2 respectively).

E Current
Current Record From Databank shows current record that e-Tester is

using for playback from a Data Bank file.

E Fetch Record advances the record pointer to the next record in the

Data Bank file and updates the list view controls with the data from the
current record.

E Goto Record opens a dialog box for specifying the record to retrieve

from the Data Bank file and updates the list view controls with the data.

Auto Map and Auto Bind


The Data Bank Wizard includes Auto Map and Auto Bind features that
let you quickly and easily use Data Banks with Visual Scripts.
AutoAuto-Map Automatically creates variables and mappings, as follows:
E analyzes the parameters list of the Visual Script;
E generates the minimum of variables;
E maps variables to the parameters;
E populates the mappings list view control.
AutoAuto-Bind automatically creates Data Bank files and bindings, as follows:
E generates a Data Bank file;
E creates the field definitions in the Data Bank file;
E creates one record of data using the data values recorded in the

parameters of the Visual Script;

E binds the Data Bank variables to the fields from the Data Bank file.

You can then add your own comma-delimited data to the Data Bank file.

Chapter 8: Using Data Banks

187

Working with Data Banks

Working with Data Banks


This section explains how to create Data Bank files, map variables to
script parameters, bind variables to Data Bank fields, and play back using
Data Banks.

Creating a Data Bank File


Data Bank files are comma-delimited ASCII files with the field names as
column headers on the first line of the file. Subsequent lines of the file
contain data. You can view the contents of any of the sample files in the
eTEST\DataBank directory using Notepad or any other ASCII editor.
You can create a new Data Bank file and bind all variables using the AutoAutoBind button. The new Data Bank file will contain the field names and one
record of data from the Visual Script parameters.
To create a Data Bank file:
1.

Open Notepad or any other ASCII editor.

2.

Enter field names on the first line of the file separated by commas (no
spaces).

3.

Enter field data on subsequent lines separated by commas (different


line for each record, no spaces around commas).

4.

Save the file as filename.csv.

Example:
FirstName,LastName,Mail,Phone
John,Smith,JohnS@empirix.com,x993
Mary,Ellen,MaryE@empirix.com,x742

e-Tester uses the eTEST\DataBank subdirectory of the installation


directory (C:\Empirix\eTEST is the default) as the default location for
Data Bank files.
If a data value contains a comma, place quotation marks around the value,
as follows:
John,Smith,"Anytown, MA","(781) 993-8500"

188

e-Tester User Guide

Working with Data Banks

Recording a Visual Script to Use with a Data Bank


Before you can use a Data Bank for testing your Web application, you
must record a Visual Script that contains parameters for passing data
values to the Web application.
To record a Visual Script to use with a Data Bank:
1.

Record a Web page with a form.

2.

Enter data into the form and click the Submit button.

3.

Wait for the Results page to load in the Browser pane.

4.

Stop Recording.

5.

Select the Results page in the Visual Script.

6.

Select Edit Data Bank Wizard or click the toolbar button.

7.

Map and bind variables in the Data Bank Wizard to the Visual
Script parameters and Data Bank fields.

Mapping Variables to Visual Script Parameters


Data from Data Banks files gets passed to Visual Script parameters using
variables. The first part of setting up a Visual Script to work with a Data
Bank is to specify which variable name to use with which Visual Script
parameter. The Data Bank Wizard lets you define variable names and
map specific variables to specific Visual Script parameters.
To map variables to Visual Script parameters:
1.

Select the page with Parameters in the Visual Script.

2.

Select Edit Data Bank Wizard or click the toolbar button.

3.

Select the Variables tab, if necessary.

4.

Click Add Variable.

Chapter 8: Using Data Banks

189

Working with Data Banks

The Data Bank Wizard opens a dialog box for defining a variable.

5.

Enter a variable name.

6.

Set the variable type as either External or Internal. External variables


are used to map to an external Data Bank file. Internal variables pass
the result of a calculated expression to the variable.

7.

Click OK.

8.

Select the variable name in the Variables list.

9.

Select the corresponding parameter in the Parameters list.


Select
Variable
Name
Select
Matching
Parameter
Add
Mapping

10.

190

Click Add Mapping.


e-Tester User Guide

Working with Data Banks

The Data Bank Wizard adds the mapping to the Mappings list.

Variable
Mapping
List

11.

Repeat 410 as necessary for any number of parameters from the


Visual Script.
External variables must also be bound to fields in a Data Bank file.
See the Binding External Variables to Data Bank Fields section later
in this chapter for details about binding variables to Data Bank fields.

Using Internal Variables


Internal variables can be used to pass the results from simple expressions
to Visual Script parameters. Rather that passing values from a Data Bank
file, you can use e-Tester functions to pass date and time values, specific
text values, or calculated values.
Internal variable expressions can have the following formats:
Expression

Description

"text"

Passes the text between the quotation marks.

function

Passes the return value of an e-Tester function.

variableName

Passes the value of an internal or external Visual


Script variable.

Chapter 8: Using Data Banks

191

Working with Data Banks

Expression

Description

"text" & "text"

Passes concatenated string of text.

"text" & function

Passes the text concatenated with the result


from an e-Tester function.

"text" & variable

Passes the text concatenated with the value of a


Visual Script variable.

formula

Passes the result from a mathematical formula.


Formulas can contain addition, multiplication,
division, and subtraction.

You can use the following e-Tester functions to return values to internal
Data Bank variables:
Function

Description

CurRecord

Returns the number of the current record from


the Data Bank file.

CurDatabank

Returns the path and name of the current Data


Bank file.

CurScript

Returns the name of the current Visual Script.

CurWorkspace

Returns the name of the current Workspace.

CStr(expression)

Converts expression to a string data type.


Use this function when concatenating text
strings with non-string data types, such as date
and time values.

Date

Returns the current date.

Day(string)

Returns the day of the month. string is a date


value in mm/dd/yyyy format.

DBVarValueOf

Returns the value of the specified Data Bank


variable. Use the following syntax:
DBVarValueOf("DBVar_Name$")

DBVar_Name$ is the name of a Data Bank

variable defined in the Variables list of the Data


Bank Wizard Variables tab.

192

e-Tester User Guide

Working with Data Banks

Function

Description
Description

ElementValueOf

Returns the value of the specified form element.


Use the following syntax:
ElementValueOf("formName$","elemName$")

formName$ is the name of the HTML Form

containing the element.

elemName$ is the name of an HTML Form

element.

Now

Returns the current date and time

Hour(string)

Returns the current hour of the day in 24hour


format. string is a time value in hh:mm:ss
AM|PM format.

IterationCount

Returns the count of the Visual Script playback


iterations.

Month(string)

Returns the month of the year. string is a date


value in mm/dd/yyyy format.

Time

Returns the time of day in hh:mm:ss AM|PM


format.

WeekDay(string)

Returns an integer value from 1 to 7


corresponding to the day of the week. string is
a date value in mm/dd/yyyy format.

Year(string)

Returns the current year. string is a date value


in mm/dd/yyyy format.

You can build an expression combining text and e-Tester functions to


generate unique values to pass to Web page forms without having to use a
Data Bank file. The following examples show some of the ways that you
can use the e-Tester functions with internal Data Bank variables.
Internal variables must be mapped to parameters in the Visual Script. See
the previous section for details about defining internal variables and
mapping the variables to Visual Script parameters.
Chapter 8: Using Data Banks

193

Working with Data Banks

Internal Variables Examples - Date and Time


You can use internal Data Bank variables to pass date and time values to
form field parameters. Define an internal variable name and enter one of
the e-Tester date or time functions into the expression text box. The
following are examples of expressions that pass the specified date or time
values:
"Time of Day " & Cstr(Time)
"Hour of Day " & Cstr(Hour(Time))
"Current Time and Date " & Cstr(Now)
"Today's Date " & Cstr(Date)
"Day of month " & CStr(Day(Date))
"Month of Year " & Cstr(Month(Date))
"Day of week " & CStr(Weekday(Date))
"Current Year " & Cstr(Year(Date))

The Cstr function is used to convert the time and date values to String
data types.

Internal Variables Examples - Calculations


You can use internal Data Bank variables to pass the results of
mathematical formulas to a parameter in a Visual Script. You can also add
the values of two fields and place the result into a third field. For example,
you can define an internal variable and specify the expression as follows:
iVar_field1 + iVar_field2

The following table shows additional examples of using expressions with


internal variables and Visual Script parameters.

194

Map to
Parameter

Variable Name

Expression

field1

iVar_field1

"login" & IterationCount +1

field2

iVar_field2

elementValueOf("form1","elm1")

field3

iVar_field3

iVar_field1 + iVar_field2

e-Tester User Guide

Working with Data Banks

Internal Variables Example - Incremented Values


If your Web page has a form and you want to supply incremented values
to use as data entry, you can use the e-Tester IterationCount function
to generate incremented values. Using the Data Bank Wizard, you add an
internal variable and enter an expression similar to the following
expression:
"login" & IterationCount +1
Note: The IterationCount function is zero-based. The +1 in the above

expression is used to start counting at 1.

You then map the internal variable to the Visual Script parameter for the
form field where you want to enter the incremented value.
Use the Iterate playback option when you play back the Visual Script. Set
the Iterate options to Use Current Record Only and set the Iterate Over
Record value to the number of times you want the Visual Script to play
back, as follows:
Playback
with
Data Bank

Set
Current
Only

Set
Iterations

The values passed to the form field over three iterations of the Visual
Script playback will be as follows:
login1
login2
login3

Chapter 8: Using Data Banks

195

Working with Data Banks

You can define and map multiple internal variables to pass values to more
than one form field. For example, you could define two internal variables
and map each variable to a different Visual Script parameter, as follows:
Map to
Parameter

Variable Name

Expression

login

iVar_login

"login" & IterationCount +1

pwd

iVar_pwd

"password" & IterationCount +1

The values passed to the form fields over three iterations of the Visual
Script playback will be as follows:
login1
password1
login2
password2
login3
password3

Using the above method, you do not need to bind the variables to fields in
a Data Bank file.
The following example expression concatenates a text string with the
record number from an attached Data Bank file to increment a value
passed to a Visual Script parameter:
"login" & Cstr(CurRecord)

Map the internal variable to the Visual Script Parameter


Bind the external variable to a Data Bank field.
Use the DBVarValueOf function to pass the value from the external
variable to the expression used by the internal variable, as follows:
DBVarValueOf("externalBoundToField") & Cstr(CurRecord)

The following table shows an example of the defined variable and the
expression used to pass a Data Bank value:

196

Variable Name

Type

Expression

eVar_login

external

N/A

iVar_login

internal

DBVarValueOf("eVar_login") &
Cstr(CurRecord)

e-Tester User Guide

Working with Data Banks

The following table shows an example of the Data Bank binding to the
field name in the Data Bank file (db_login):
Variable Name

Mapping

Binding

iVar_login

login

None

eVar_login

None

db_login

Binding External Variables to Data Bank Fields


The second part of setting up a Visual Script to work with a Data Bank is
to specify which Data Bank field to use with which variable. The Data
Bank Wizard lets you bind variables to specific Data Bank fields.
To bind variables to Data Bank fields:
1.

Make sure you have mapped variables to parameters in the Visual Script.

2.

If necessary, select Edit Data Bank Wizard or click the toolbar button.

3.

Select the Data Binding tab.

4.

Click Select to open a Data Bank file.


Select a
Data Bank
File

5.

Select a Data Bank file and click Open. A list of field names from the
Data Bank file appears in the Data Bank Fields list.

6.

Select a field name in the Data Bank Fields list.

Chapter 8: Using Data Banks

197

Working with Data Banks

7.

Select the corresponding variable in the Variables list.


Select
Data Bank
Field
Select
Variable
Name
Add
Binding

8.

Click Add Binding. The Data Bank Wizard adds the binding to the
Bindings list.

Variable
Binding
List

198

9.

Repeat 68 as necessary for any number of variables to bind to Data


Bank fields.

10.

Click OK to save the settings and close the Data Bank Wizard.
e-Tester User Guide

Working with Data Banks

Playing Back a Range of Data Bank Records


Data Banks, when used with the Iterate feature of e-Tester, let you
perform data-driven tests on a Web application.
To play back with a Data Bank:
1.

Use the Data Bank Wizard to map and bind Visual Script
parameters to fields in a Data Bank file.

2.

Select Run Playback Iterate.

3.

Select Playback with Data Banks.


Set to
Playback
Data Bank

Set Which
Data Bank
Records

Set #
of Iterations
Through
Range

4.

Select Use All Records.

5.

Specify the range of Data Bank records to use during playback of the
script in the Start at Record and End at Record fields. You can enter
First and Last, respectively, to iterate playback through the entire
Data Bank.

6.

Set the number of iterations through the Data Bank in the Iterate over
Range field.

7.

Click Iterate.
e-Tester plays back the entire Visual Script (all pages) using all of the
specified records for each iteration. If you have a Data Bank with 5
records and iterate over the range 2 times, e-Tester plays back the
Visual Script (all pages) a total of 10 times twice for each record.

Chapter 8: Using Data Banks

199

Working with Data Banks

Playing Back a Specific Data Bank Record


To play back a specific Data Bank record:
1.

Use the Data Bank Wizard to map and bind Visual Script
parameters to fields in a Data Bank file.

2.

Select Edit Data Bank Wizard or click the toolbar button.

3.

Click Goto Record.

4.

Enter a record number and click OK.

5.

Click OK to close the Data Bank Wizard.

6.

Select Run Playback Iterate.

7.

Select Playback with Data Banks.


Set to
Playback
Data Bank

Specific
Record
Set #
of Iterations
Over
Record

8.

Select Use Current Record Only.

9.

Set the number of iterations for the record in the Iterate Over Record
field.

10.

Click Iterate.
e-Tester plays back the entire Visual Script (all pages) using the
specified record for each iteration.

200

e-Tester User Guide

Working with Data Banks

Using Data Banks with Java Applet Text Fields


Before you can use a Data Bank for testing your Java applet, you must
record a Visual Script page that contains a Java applet with text change
events.
1.

Select Run Record Start or click the toolbar button to start


recording.

2.

Type the URL of the Web page with a Java applet in the Address line
and press Enter.

3.

Enter text into a Java applet text field.

4.

Select Run Record Page Snapshot. e-Tester records a new page


to the Visual Script.

5.

Select Run Record Stop when finished.

6.

Select the Address node of the Visual Script page.

7.

Click the right mouse button and select Properties.

8.

Double-click the (AWT_textchange +window}) item in the Action tab


of the Address Properties.

Chapter 8: Using Data Banks

201

Working with Data Banks

202

9.

Select the Textchange Data Bank Variable Name item in the Attributes
tab.

10.

Click the Data Bank button. e-Tester opens a dialog box for
specifying a variable name.

11.

Enter the name of the Data Bank variable to use. This variable name
should be the same name as the variable you specify in the Data Bank
Wizard to connect the text field to a Data Bank field.

e-Tester User Guide

Working with Data Banks

12.

Click OK to close the Specify Data Bank Variable Name dialog box.
The variable name appears in the Value column of the Attributes tab.

13.

Click OK to close the Event dialog box.

14.

Click OK to close the Address Properties dialog box.

15.

Select Edit Data Bank Wizard.

16.

Click Add Variable.

17.

Enter the name of the variable that you specified in the Attributes tab
and click OK.

Chapter 8: Using Data Banks

203

Working with Data Banks

204

18.

Click the Data Binding tab.

19.

Click Select.

20.

Select the Data Bank file and click Open.

21.

Select the name of the Data Bank field to bind to the variable.

e-Tester User Guide

Working with Data Banks

22.

Click Add Binding.

23.

Click Fetch Record to cycle through the Data Bank field values.

24.

Click OK to close the Data Bank.

25.

Play back the Visual Script with the Data Bank.

Using Data Banks with Java Applet KeyListener


Before you can use a Data Bank for testing your Java applet, you must
record a Visual Script page that contains a Java applet that implements
KeyListener.
1.

Select Run Record Start or click the toolbar button to start


recording.

2.

Type the URL of the Web page with a Java applet in the Address line
and press Enter.

3.

Enter text into a Java applet text field.

4.

Select Run Record Page Snapshot. e-Tester records a new page


to the Visual Script.

5.

Select Run Record Stop when finished.

6.

Select the Address node of the Visual Script page.

Chapter 8: Using Data Banks

205

Working with Data Banks

206

7.

Click the right mouse button and select Properties.

8.

Double-click the (AWT_keys +window}) item in the Action tab of


the Address Properties.

9.

Select the Key Data Bank Variable Name item in the Attributes tab.

e-Tester User Guide

Working with Data Banks

10.

Click the Data Bank button. e-Tester opens a dialog box for
specifying a variable name.

11.

Enter the name of the Data Bank variable to use. This variable name
should be the same name as the variable you specify in the Data Bank
Wizard to connect the TextField to a Data Bank field.

12.

Click OK to close the Specify Data Bank Variable Name dialog box.
The variable name appears in the Value column of the Attributes tab.

13.

Click OK to close the Event dialog box.

14.

Click OK to close the Address Properties dialog box.

15.

Select Edit Data Bank Wizard.

Chapter 8: Using Data Banks

207

Working with Data Banks

208

16.

Click Add Variable.

17.

Enter the name of the variable that you specified in the Attributes tab
and click OK.

18.

Click the Data Binding tab.

19.

Click Select.

e-Tester User Guide

Working with Data Banks

20.

Select the Data Bank file and click Open.

21.

Select the name of the Data Bank field to bind to the variable.

22.

Click Add Binding.

23.

Click Fetch Record to cycle through the Data Bank field values.

24.

Click OK to close the Data Bank.

25.

Play back the Visual Script with the Data Bank.

Chapter 8: Using Data Banks

209

Working with Data Banks

The Difference Between Play and Iterate Using Data


Banks
Use All Records

Play

Iterate

Plays back the Visual


Script once using the
current record (as
specified in the Data
Bank Wizard) in the
Data Bank.

Plays back the Visual


Script for each record
in the specified range
of the Data Bank file.

The next playback


uses the next record in
the Data Bank, and so
on.
Use Current Record
Only

Plays back the Visual


Script once using the
current record (as
specified in the Data
Bank Wizard) in the
Data Bank.
The next playback
uses the same record
in the Data Bank.

210

If Iterate over Range is


set to more than one,
playback cycles
through the range of
records in the Data
Bank for each
iteration.
Plays back the Visual
Script using the
current record (as
specified in the Data
Bank Wizard or
Iterations dialog box)
in the Data Bank.
If Iterate over Record
is set to more than
one, the current record
is used for each
iteration.

e-Tester User Guide

Chapter 9

Using Admin Options


The Admin menu options let you manage the following types of
information stored by e-Tester:
E Manage the Text Matching test cases in the test library;
E Specify response actions for unexpected dialog boxes that appear

during playback of a Visual Script;

E Specify user name and password information for testing sites that

require a login for authenticating users;

E Create new workspaces;


E Delete workspaces, Visual Scripts and results logs.

The following sections explain the options.

Using the Test Library


The Test Library lets you perform administrative tasks on Text Matching
test cases stored in the library.

211

Using the Test Library

Test Library Options


Selecting Admin Test Library opens the Administer Test Library dialog
box. The dialog box has the following columns and options:
Name the name of the Text Matching test case.
Type the Pass
Pass Where setting for the Text Matching test case (either

Present or Absent).
Text the text string or variable name(s) to compare in the Web page or

application source.
Add opens the Modify Text Matching Test dialog box for creating a new
test case. The test case is added to the library, but not the Visual Script. You
can select Text Matching test cases from the library when you insert a test
case into the Visual Script.
Modify opens the Modify Text Matching Test dialog box for editing
the values of an existing test case. Select the test case to edit and click
Modify.
Remove removes a Text Matching test case from the library. Select the
test case to remove and click Remove.

Adding Text Matching Tests Case to the Library


To add Text Matching test cases to the library:
1.

Select Admin Test Library.

2.

Click Add.

3.

Enter a test case name.

4.

Select the Pass When option.

5.

Enter the text to match in the Selected Text edit box.

6.

Click OK in the Text Matching dialog box.

7.

Click OK in the Administer Test Library dialog box.


or:

1.

212

Insert a new test or edit an existing Text Matching test.


e-Tester User Guide

Using the Dialog Manager

2.

Click the Add to Test Library button.

3.

Click OK in the Add to Test Library dialog box.

4.

Click Accept in the Text Matching Test dialog box.

Removing Text Matching Test Cases from the Library


To delete a Test Matching test case from the library:
1.

Select Admin Test Library.

2.

Select the test case to remove.

3.

Click Remove.

4.

Click OK.

Using the Dialog Manager


The Dialog Manager lets you specify actions to perform if an unexpected
dialog box appears during playback of a Visual Script. You can define
specific properties of dialog boxes, the priority of dialog boxes, an action
to perform if a dialog box appears, and if the appearance of the dialog box
should cause a fatal error.
The Dialog Manager has the following sections:

Defined
Dialogs

Dialog
Information
Details

Chapter 9: Using Admin Options

213

Using the Dialog Manager

Overview of the Menu Options


The main menu provides options for specifying dialog box information
and saving the dialog information. The following sections explain the
options on each menu and show the corresponding toolbar button.

File Menu
These menu options let you save dialog information and exit the Dialog
Manager. The following options are available:
Save saves the dialog information.
Exit exits the Dialog Manager.

Edit Menu
The Edit menu options let you capture or delete dialog box information
and specify the priority of the dialog boxes listed in the Dialog Manager.
Delete deletes the selected dialog box information from the Dialog

Manager list.
Move Up moves the currently selected dialog box information up one

position in the Priority.


Move Down moves the currently selected dialog box information down

one position in the Priority.


Select Dialog opens a dialog box that shows the Class, Caption, and

Text information for the dialog box below the mouse cursor. Click the
mouse button on the selected dialog box to capture the information into
the Dialog Manager.

214

e-Tester User Guide

Using the Dialog Manager

Overview of the Dialog List


The dialog list shows the currently defined dialog box information and
the action to be performed if the dialog box appears during playback of a
Visual Script. The Dialog Manager contains several pre-defined dialog
boxes and actions for common Web dialog boxes. You can add your own
definitions for dialog boxes that may be specific to your Web application.
The dialog list has the following columns:
Dialog
Class
Information

Dialog
Caption

Dialog
Text

Action to
Perform

Dialog Appearance Causes


Fatal Error

Evaluation
Priority

Priority specifies the priority in which the Dialog Manager checks the

dialog list for an action to perform when an unexpected dialog box


appears during playback of a Visual Script.
Class shows the class of the dialog boxes specified in the Dialog
Manager. An asterisk indicates all characters.
Caption shows the caption text of the dialog boxes specified in the

Dialog Manager. An asterisk indicates all characters.


Text shows the text of the dialog box. An asterisk indicates all characters.
Action shows the action to perform if the dialog box appears during

playback of a Visual Script.


Chapter 9: Using Admin Options

215

Using the Dialog Manager

Fatal shows if the appearance of the dialog box should be considered a


fatal error. True indicates that the dialog box is considered a fatal error.
False indicates that the dialog box is not considered a fatal error.

Overview of the Dialog Information


The Dialog Information group is where you specify dialog information to
change or add to the dialog list of the Dialog Manager.
The Dialog Information group has the following options:

Dialog Class
Dialog Text
Action to
Perform
Dialog Caption

Dialog Appearance
Causes Fatal Error
When Checked

You specify the Class, Caption, Text, Action to perform, and if the dialog
box is considered a fatal error.
You can capture the Class, Caption, and Text information from any dialog
box that is currently displayed on the screen using Edit Select Dialog.
Class enter the class of the dialog box. An asterisk indicates all classes or

characters.
Caption enter the caption text of the dialog box. An asterisk indicates all

characters.
Text enter the text of the dialog box. An asterisk indicates all characters.
216

e-Tester User Guide

Using the Dialog Manager

Action select the action to perform if the dialog box appears during

playback of a Visual Script. You can enter Data Bank variable names and
special keyboard actions into the Action field. Enclose the Data Bank
variable names within double angle-brackets, for example
<<varUserName>> and <<varPassword>>. Enter keyboard actions
using the form {KEY}, for example {TAB}.
Fatal when selected, the appearance of the dialog box is considered a

fatal error.
Change Selected Item applies any changes to a currently defined dialog

box in the dialog list.


Add to List adds new dialog information to the list.

Starting the Dialog Manager


To start the Dialog Manager:
1.

Select Admin Dialog Manager.

2.

Use the Dialog Manager options to prioritized evaluation order,


specify new dialog boxes, or change existing dialog box information.

3.

Select File Save or click the toolbar button to save the changes.

Capturing Dialog Information


To capture dialog information:
1.

Select Admin Dialog Manager to start the Dialog Manager.

2.

Select Edit Select Dialog or click the toolbar button. The Dialog
Manager options a dialog box showing the Class, Caption, and Text
information of the dialog box beneath the mouse cursor.

Chapter 9: Using Admin Options

217

Using the Dialog Manager

3.

Click the left mouse button on the dialog box to capture. The Class,
Caption, and Text information is captured directly from the displayed
dialog box into the Dialog Manager.

4.

Select or enter the Action to perform if the dialog appears during


playback. You can enter Data Bank variable names and special
keyboard actions into the Action field. Enclose the Data Bank variable
names within double angle-brackets, for example <<varUserName>>
and <<varPassword>>. Enter keyboard actions using the form {KEY},
for example {TAB}.

5.

Select or clear the Fatal check box if the appearance of the dialog box
should indicate a fatal error.

6.

Click the Add To List button.

7.

Select File Save or click the toolbar button to save the changes.

Specifying Dialog Information


To specify dialog information:
1.

Select Admin Dialog Manager to start the Dialog Manager.

2.

Enter the dialog Class. An asterisk indicates all classes or characters.

3.

Enter the dialog Caption. An asterisk indicates all characters.

4.

Enter the dialog text. An asterisk indicates all characters.


You can capture Class, Caption, and Text information directly from a
displayed dialog box using Edit Select Dialog.

218

5.

Select or enter the Action to perform if the dialog appears during


playback. You can enter Data Bank variable names and special
keyboard actions into the Action field. Enclose the Data Bank variable
names within double angle brackets, for example <<varUserName>>
and <<varPassword>>. Enter keyboard actions using the form {KEY},
for example {TAB}.

6.

Select or clear the Fatal check box if the appearance of the dialog box
should indicate a fatal error.

7.

Click the Add To List button.


e-Tester User Guide

Using the Dialog Manager

8.

Select File Save or click the toolbar button to save the changes.

Editing Existing Dialog Information


To edit existing dialog information in the Dialog Manager:
1.

Select Admin Dialog Manager to start the Dialog Manager.

2.

Click the Priority number of the dialog box information to edit.

3.

Edit the dialog Class. An asterisk indicates all classes or characters.

4.

Edit the dialog Caption. An asterisk indicates all characters.

5.

Edit the dialog Text. An asterisk indicates all characters.

6.

Edit the Action to perform if the dialog appears during playback.


You can enter Data Bank variable names and special keyboard
actions into the Action field. Enclose the Data Bank variable names
within double angle brackets, for example <<varUserName>> and
<<varPassword>>. Enter keyboard actions using the form {KEY},
for example {TAB}.

7.

Select or clear the Fatal check box if the appearance of the dialog box
should indicate a fatal error.

8.

Click the Change Selected Item button.

9.

Select File Save or click the toolbar button to save the changes.

Changing Dialog Evaluation Priority


To change the dialog box evaluation priority:
1.

Select Admin Dialog Manager to start the Dialog Manager.

2.

Click the Priority number of the dialog box information to


re-prioritize.

3.

Select Edit Move Up or Edit Move Down or click the appropriate


toolbar button.

4.

Select File Save or click the toolbar button to save the changes.

Chapter 9: Using Admin Options

219

Using the Authentication Manager

Using the Authentication Manager


The Authentication Manager lets you define user name and password
information to allow automated testing of sites that require a login to
authenticate users. The Authentication Manager dialog box lists the
Authentication records available to Visual Scripts.
Selecting Admin Authentication Manager opens the Authentication
Manager dialog box:

The dialog box lists the currently defined user names and passwords and
has the following columns and options:
Realm the full Uniform Resource Locator (URL) for the Web
application that requires a user name and password.
User Name the user name value to pass to the Web application.
Password the password value to pass to the Web application.
Map UserName to Variable shows the name of the Data Bank variable,

if any, that maps the User Name value.


Map Password to Variable shows the name of the Data Bank variable, if
any, that maps the Password value.
Add opens a dialog box for adding new Authentication information.
Modify
Modify opens a dialog box for modifying the currently selected

Authentication information.
Remove removes the currently selected Authentication from the list.

220

e-Tester User Guide

Using the Authentication Manager

Adding a Record
To add a record to the Authentication Manager:
1.

Select Admin Authentication Manager.

2.

Click the Add button.

3.

Enter the Realm, User Name, and Password information.

4.

(Optional) Enter Data Bank variable names for the user name and
password. Enclose the Data Bank variable names within double angle
brackets, as in <<varUserName>> and <<varPassword>>.

5.

Click OK.

Modifying a Record
To modify a record in the Authentication Manager:
1.

Select Admin Authentication Manager.

2.

Select the record to modify (in the Realm column).

3.

Click the Modify button.

4.

Edit the Realm, User Name, and Password as necessary.

5.

(Optional) Edit Data Bank variable names for the User Name and
Password. Enclose the Data Bank variable names within double
angle brackets, as in <<varUserName>> and <<varPassword>>.

6.

Click OK.

Removing a Record
To remove a record from the Authentication Manager:
1.

Select Admin Authentication Manager.

2.

Select the record to remove (in the Realm column).

3.

Click the Remove button.

4.

Click OK.

Chapter 9: Using Admin Options

221

Working with Workspaces, Scripts, and Logs

Working with Workspaces, Scripts, and Logs


The Admin menu provides options for creating new workspaces and
deleting workspaces, Visual Scripts, and results logs. The following
sections explain each of the options.

Creating New Workspaces


Selecting Admin New Workspace opens the New Workspace dialog
box:

This dialog box lets you create a new workspace.


Workspaces store project-related Visual Script files and results log files.
You can use workspaces to organize these files.
Name enter a name for the new workspace. Click OK to create the

workspace.
Existing Workspaces lists the currently defined workspaces.

222

e-Tester User Guide

Working with Workspaces, Scripts, and Logs

Deleting Workspaces
Selecting Admin Delete Workspace opens the Workspace dialog box:

This dialog box lets you delete a workspace.


CAUTION: Deleting a workspace has the potential of erasing a large amount

of data including Visual Script files and results logs. Be sure you really want
to do this before proceeding.
Select the workspace to delete and click OK.
e-Tester prompts you to confirm the deletion. Click Yes in the confirmation
dialog box to delete the workspace and associated files or click No or Cancel
to cancel.

Deleting Visual Scripts


Selecting Admin Delete Scripts opens the Script dialog box:

This dialog box lets you delete a Visual Script from the current workspace.
Select the Visual Script file to delete and click OK.
e-Tester prompts you to confirm the deletion. Click Yes in the confirmation
dialog box to delete the Visual Script or click No or Cancel to cancel.
Chapter 9: Using Admin Options

223

Working with Workspaces, Scripts, and Logs

Deleting Logs
Selecting Admin Delete Log opens the Delete Log dialog box:

This dialog box lets you delete a Results log from the current workspace.
Select the Results log to delete and click OK.
e-Tester prompts you to confirm the deletion. Click Yes in the confirmation
dialog box to delete the Results log or click No or Cancel to cancel.

224

e-Tester User Guide

Chapter 10

Using the Programming Interface


This chapter explains how to extend your Visual Scripts using the e-PI.
The chapter contains the following sections:
Overview of Testing Extensibility provides an overview of the six levels of

the testing extensibility capabilities of e-Tester.


Visual Script Programming explains how e-Tester executes code in Test

Scriptlets, Custom VBA tests, and External callout test.


About Visual Script Navigation explains the underlying structure of how

Visual Scripts record and playback pages and how the e-PI can access the
navigation between Visual Script pages.
About Thick Client and Thin Client
Client explains the differences between

regression and load testing client modes in e-Tester and e-Load.


Working with the Document Objects explains how the e-PI uses the

Document Object Model of the HTML pages to access collections,


elements, and properties that define a Web page.
How the e-PI Accesses Web Page Objects explains how the e-PI accesses

document objects.
Getting Data Bank Values explains how the e-PI works with Data Banks.
Using Tests Scriptlets explains how to use VBScript from within an

e-Tester Visual Script to access and change internal elements and


properties of the Web page being played back by a Visual Script.
Debugging Tests Scriptlets explains how to use debuggers with Test Scriptlets.
Creating Custom Visual Basic Tests explains how to add custom Visual Basic

code to Visual Scripts using the Visual Basic Integrated Development


Environment.

225

Overview of Testing Extensibility

Creating External Callout Tests explains how to use the e-PI to create

custom programs to access and change internal elements and properties of


the Web page being played back by a Visual Script.
External Program Control explains the available COM objects provided

with the e-Test suite for using external programs to control e-Tester.

Overview of Testing Extensibility


e-Tester provides full flexibility and extensibility to match your Web testing
needs. e-Tester provides six levels of extensibility, from the simplicity of
Visual Scripts, to your own fully customized external application that
controls e-Tester. Each user of e-Tester can define the type of tests needed
for a specific Web application.
The six levels of e-Tester extensibility let you choose the level that fits a
particular testing requirement without being burdened by unnecessary
advanced features.
e-Tester does not requires the use of any programming language for most of
the common tests that a Web application requires.
When programming is required for more advanced testing, the e-Tester
extensibility options use industry-standard languages, such as VBScript,
Visual Basic, C++, or Java. At no point is the use of any proprietary
programming language required.

226

e-Tester User Guide

Overview of Testing Extensibility

Extensibility Levels Overview


This section provides an overview of the six levels of the testing
extensibility capabilities of e-Tester. The following illustration shows the
six levels of extensibility of the e-Tester:
Six Levels of
Extensibility

6
5
4

3
2

Custom External Program that Controls e-Tester

Visual Scripts with Callout Tests in an Active X.dll

Visual Scripts with Custom Visual Basic

Visual Scripts with Test Scriptlets

Visual Scripts with UI


Test Cases &
e-Tester
Data Banks
Visual Scripts

VBScript

Code
VBA IDE

VB
C++
Java

VB
C++
Java

The levels are as follows:


1. Visual Scripts with their built-in, default tests
2. User Defined Test Cases in the Visual Scripts
3. Test Scriptlets executed within the Visual Scripts
4. Visual Basic code in the Integrated Development Environment
5. External Callout Test Cases called from the Visual Scripts
6. External program controlling e-Tester
The following sections explain each level.

Chapter 10: Using the Programming Interface

227

Overview of Testing Extensibility

Level 1: Visual Scripts


Visual Scripts are the first and most basic of the six levels of extensibility
of e-Tester. e-Tester uses an object-level recorder and Visual Scripts that
represent test scripts graphically as objects in a hierarchical tree diagram.
Nodes of the tree represent Web pages and objects that comprise the pages,
such as HTML, forms, anchors, images, links, scripts, etc. The following
illustration shows a sample of a recorded page in a Visual Script:
1
e-Tester
Visual Scripts

Visual Scripts include default tests that automatically compare recorded


pages and objects when the Visual Scripts are played back against current
versions of the Web pages. The default tests verify the existence of the
following types of page items:
E Anchors
E ActiveX Controls
E Elements
E HTML
E Forms
E Frames
E Images
E Image Maps
E Links
E Java Applets
E Scripts
You can modify the default existence tests for a specific page, for all pages
in a Visual Script, or a specific node in a Visual Script. You can turn off
(or turn on again) default tests for specific nodes to indicate which areas
of the Web application are expected to change and do not need precise
comparison to the recorded baseline.
When a Web page or application changes, e-Tester lets you update the
recorded Visual Script to the new baseline with a single mouse click. Chapters
3 and 4 in this manual explain how to record and work with Visual Scripts.
228

e-Tester User Guide

Overview of Testing Extensibility

Level 2: User-Defined Test Cases & Data Banks


Visual Scripts can be edited visually to augment the default tests with
additional tests, such as text matching tests, form element tests, and server
response time tests. These additional tests are one part of the second level
of extensibility of the e-Tester. The following illustration shows a sample
Visual Script with a user-inserted text matching test case:
2
Visual Scripts
with UI Based
Test Cases &
Data Banks

User-defined test cases can be added to Visual Scripts with a few mouse
clicks. e-Tester includes the following types of user-defined test cases that
can be inserted quickly and easily into Visual Scripts:
E Text matching verifies that specific text is either present or absent in a

page. For example, you may want a test that verifies a search result
page contains the text Your search returned the following matches, or
that another page does not contain the message Server Error.

E Form element verifies a specific parameter of a form element. For

example, you may want a test that checks the content of a Web page
form field.

E Server response time checks the server response time for a specific

part of a transaction. For example, you may want a test that measures
and verifies the server response time for a specific Web transaction as
seen by an end user.

Visual Scripts can also mask tests that are not important or are expected to
indicate changes to the Web page or application.
Chapter 10: Using the Programming Interface

229

Overview of Testing Extensibility

Another feature of the second level of extensibility of e-Tester is the ability


to connect Data Banks to Visual Script parameters. When you need to test
a Web application using various sets of input data, the e-Tester Data
Bank Wizard provides a convenient way to connect data sources to Visual
Scripts and perform data-driven testing. The following illustration shows a
sample Visual Script Parameter node with defined variables and an external
Data Bank file:
2
Visual Scripts
with UI Based
Test Cases &
Data Banks

FirstName,LastName,Mail,Phone
Bush,George,GHWB@,x1989
Carter,James,JEC@,x1977
Clinton,William,WJC@,x1993
Ford,Gerald,GRF@,x1974
Nixon,Richard,RMN@,x1969
Johnson,Lyndon,LBJ@,x1963
Kennedy,John,JFK@,x1961
Reagan,Ronald,RWR@,x1981

Data Banks allow the test to run through several iterations with different
sets of data, and optionally to perform result comparisons based also on
variable data. Like the first level of extensibility, adding user-defined Test
Cases and connecting Data Banks to the Visual Script are done without
the need for programming.

Extending Visual Script Capabilities with


Programming
As powerful as Visual Scripts are, there may be circumstances where Web
testing requires specialized capabilities to achieve specific test objectives.
Some examples are communicating with external programs or databases,
performing tests that use custom algorithms to verify page content, and
performing conditional navigation of a Web site based upon dynamically
changing data.
230

e-Tester User Guide

Overview of Testing Extensibility

e-Tester provides additional testing flexibility and extensibility through


the e-Test Programming Interface (e-PI). The e-PI can be used with
standard programming languages, such as VBScript, Visual Basic, Java,
and C++ to extend the capabilities of Visual Scripts. The e-PI has
procedures and methods that let you access Web page objects, get Data
Bank values, and change Visual Script navigation.
e-Tester provides four ways to extend Visual Script testing capabilities
using the e-PI: Test Scriptlets, Custom VBA tests, External Callout
Tests, and External Programs. The following sections explain the
programming extensibility capabilities of e-Tester.

Level 3: Test Scriptlets


The third level of extensibility of e-Tester uses Test Scriptlets. Test
Scriptlets are VBScript code snippets that can be added as an internal part
of the e-Tester Visual Scripts. You create custom Test Scriptlets using
e-Tester and its built-in scripting environment.
Test Scriptlets are inserted into the Visual Script and are executed before
playback of a Visual Script page or executed after playback of a Visual
Script page.
The following illustration shows a sample Visual Script with a Test Scriptlet:
3
Visual Scripts
with
Test Scriptlets
(VBScript)
Dim topDoc, numLinks
Dim hrefVal, i
Set topDoc=om.GetTopDocument()
numLinks=topdoc.links.length
if numLinks<>0 then
for i=0 to numLinks-1
hrefVal=topdoc.links(i).href
next
end if

Chapter 10: Using the Programming Interface

231

Overview of Testing Extensibility

Test Scriptlets use the Visual Basic Scripting Edition (VBScript)


scripting language, one of the scripting languages supported for Web
pages. It is not necessary to learn a proprietary development language.
VBScript is very similar to Visual Basic and will be familiar to anyone
with prior programming experience.

Level 4: Custom Code in Visual Basic


The fourth level of extensibility of e-Tester uses the Microsoft Visual
Basic for Applications Integrated Development Environment (VBA IDE)
to add custom code to Visual Scripts. VBA is a version of Visual Basic that
is fully integrated into e-Tester. e-Tester Visual Scripts include default
Visual Basic projects that are automatically created when you record the
Visual Scripts.
The Visual Basic projects include pre-defined objects and procedures that
you can use to perform custom tests based upon Visual Script playback
events. The custom tests can be performed for the entire Visual Script or
on a page-by-page basis. Custom code can also be shared between Visual
Scripts.

232

e-Tester User Guide

Overview of Testing Extensibility

The following illustration shows a sample Visual Script with Visual Basic
code added to the Custom Programmability node:
4
Visual Scripts
with Custom
Visual Basic
Code
(VBA IDE)

Private Sub RSWVBAPage_afterPlay()


Dim topdoc, numlinks, hrefVal
Dim lIndex, iVal
Set topdoc
numlinks =
For lIndex
hrefVal =

= RSWApp.om.getTopDocument(0)
topdoc.links.Length
= 0 To numlinks - 1
topdoc.links(lIndex).href

iVal = "Link(" + CStr(lIndex) + ")"


Call RSWApp.WriteToLog(iVal, "", hrefVal)
Next
End Sub

Custom Visual Basic Tests provide a similar programming capability as


Test Scriptlets with the added capabilities of the Visual Basic development
environment, including debugging features.
You can add your own Visual Basic code to the Visual Basic projects or use
the e-Tester Custom Test Wizard. The Custom Test Wizard provides a
convenient way to create custom Visual Basic tests for specific objects in
Web pages. The Custom Test Wizard provides point-and-click object
selection and lets you specify the text or property to test and the type of
test to perform. The Wizard then generates Visual Basic code for you.

Chapter 10: Using the Programming Interface

233

Overview of Testing Extensibility

The following illustration shows sample e-Tester-generated Visual Basic


code added to a Custom Test node:
4
Visual Scripts
with e-Tester
Generated
Visual Basic
Code
(VBA IDE)

Private Sub RSWVBATest_performTest()


On Error GoTo ERRLBL
Dim element As HTMLAnchorElement
Dim valueStr As String
RSWApp.om.GetElementByPath
"window[1].a[2]", element
If element Is Nothing Then
errDescription = "html object not found!"
errNumber = -1
Exit Sub
End If
valueStr = element.innerText
If valueStr <> "FREE Download" Then
errDescription = "string comparison failure!"
errNumber = -1
Exit Sub
End If
errDescription = ""
errNumber = 0
Exit Sub
End Sub

You can use the Wizard-generated code as is or add your own customized
code to perform additional specialized tests.

234

e-Tester User Guide

Overview of Testing Extensibility

Level 5: External Callout Tests


The External Callout Tests are the fifth level of extensibility of the e-Tester.
External Callout tests are calls to a custom external ActiveX .dll that you
create using a standard programming language and development
environment that supports ActiveX.
The following illustration shows a sample Visual Script with a Callout test
case and Visual Basic code:
5
Visual Scripts
with Callout
Tests in an
ActiveX .dll
(VB, C++, Java)
Public Sub beforePagePlay(
rswObject as Object)
Dim PNames as New Colleciton
Dim PValues as New Collection
rswObject.GetParameters PNames,
PValues
Dim i%
For i=1 to PNames.Count
'process parameters
Next i

External Callout Test Cases can be inserted into the Visual Script and can
be executed before playback of a Visual Script page or executed after
playback of a Visual Script page.
External Callout Tests provide the same level of testing extensibility as
Test Scriptlets and integrated Visual Basic with the added flexibility of the
choice of the development language and environment. The e-PI methods
provided let you access document objects, find and manipulate Web page
elements and properties, access Data Banks, and change page navigation.
Custom ActiveX .dlls that you create as Callout tests must support two
e-Tester methods, BeforePagePlay and AfterPagePlay, which are explained
later in this chapter. e-Tester comes with a sample Visual Basic Project
that you can use as a starting point for creating your own tests.
Chapter 10: Using the Programming Interface

235

Overview of Testing Extensibility

Level 6: External Programs


The sixth level of extensibility of the e-Test suite allows custom external
programs to control e-Tester and drive functionality. This feature lets you
integrate e-Tester in a broader testing suite.
External programs that call the e-Test suite products can be written with
any Component Object Model (COM)-enabled programming language
or development environment. Typical development languages include
Visual C/C++, Visual Basic, Java, etc.
e-Tester is instantiated as COM server and the properties, methods, and
events are available to any COM client program. The following illustration
shows sample Visual Basic code playing back a Visual Script:
6
Custom External
Program that
Controls
e-Tester
(VB, C++, Java)

Option Explicit
Dim WithEvents m_tester As mint.ProgX
Private Sub Main()
Call Initialize
End Sub
Private Sub Initialize()
Set m_tester As New mint.ProgX
End Sub
Private Sub cmdStartMint_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
End Sub

236

e-Tester User Guide

Overview of Testing Extensibility

The following e-Tester methods are available to custom programs:


E Initialize instances of the full or minimum e-Tester
E Open Workspaces
E Run Visual Scripts
E Execute code on Visual Script play back events
E Stop Visual Scripts
E Terminate the instance of e-Tester

See the External Program Control section of this chapter for more
information about creating external programs to drive e-Tester. See the
Command Reference in Appendix B for more information about the
available properties, methods, and events in the e-PI to control e-Tester.

Chapter 10: Using the Programming Interface

237

Visual Script Programming

Visual Script Programming


When you record a Visual Script, e-Tester records the Web page source
and the navigation between pages as part of the Visual Script. In addition
to the default tests, you can insert Test Scriptlets, Custom VBA tests, and
External Callout test cases into Visual Scripts.

Test Scriptlets
Test Scriptlets are VBScript code snippets that are an internal part of the
e-Tester Visual Scripts. You create custom Test Scriptlets using e-Tester.
Test Scriptlets can be inserted into the Visual Script as tests that get
executed before playback of a Visual Script page or executed after
playback of a Visual Script page.
Test Scriptlets use the rswObject object of the e-PI. Variables are variants.

Custom VBA Tests


Custom VBA tests are Visual Basic for Applications objects and
procedures that are integrated with e-Tester Visual Scripts. You create
Custom VBA tests using the e-Tester Custom Test Wizard and the
Integrated Visual Basic for Applications Development Environment.
e-Tester automatically creates the Visual Basic project and documents.
e-Tester also includes objects and procedures to execute code before or
after playback of Visual Script and pages in a Visual Script. Visual Basic
code can also be shared by all Visual Scripts.
Custom VBA tests use the RSWApp object of the e-PI. Variables are typed.

External Callout Tests


External Callout tests are calls to a custom external ActiveX .dlls that you
create using a standard programming language and development
environment. These test cases let you programmatically access the Web
page source and the Visual Script navigation through two e-Tester
methods: BeforePagePlay and AfterPagePlay.
External Callouts use the rswObject object of the e-PI. Variables are typed.
238

e-Tester User Guide

About Visual Script Navigation

About Visual Script Navigation


Before you start working with the e-PI, it is important to understand how
Visual Scripts play back Web pages. The following illustration shows the
internal and visual components of a Visual Script and the playback
sequence.
BeforePagePlay Method (Test Scriptlets/VBA/Callout Tests)

Execute BeforePagePlay

Internal Recorded Navigation - Previous Page to Current

Navigate to Page
Load Page into Browser
Compare Differences
Perform Existence Tests
Perform Validation Tests
Perform User Test Cases

AfterPagePlay Method (Test Scriptlets/VBA/Callout Tests)

Execute AfterPagePlay

During playback, the Visual Script executes the BeforePagePlay method


before loading the Web page into the browser and before the previous
Visual Script page navigation occurs. Custom code inserted into the
BeforePagePlay method affects the navigation of the previous page of the
Visual Script.
The Visual Script playback then compares the differences between the
recorded page (Master page) and current page in the browser (Tested page).
The AfterPagePlay method executes after the page is loaded into the
browser and after all default Existence test, Validation tests, and userinserted test cases are executed. Custom code inserted into the
AfterPagePlay method affects the navigation of the current page of the
Visual Script. The navigation to the next page occurs after the
AfterPlagePlay method executes.
With Test Scriptlets, you create your own VBScript code using a script
editor in e-Tester. A Test Scriptlet Before accesses the BeforePagePlay
method and a Test Scriptlet After accesses the AfterPagePlay method.

Chapter 10: Using the Programming Interface

239

About Thick Client and Thin Client

With Custom VBA test, each page in the Visual Basic project includes a
BeforePlay event that accesses the BeforePagePlay method and an
AfterPlay event that accesses the AfterPagePlay method.
With External Callout test cases, you add the BeforePagePlay and
AfterPagePlay methods to your own ActiveX .dll that you can create using
standard programming languages, such as Visual Basic, Java, or C++.
You then insert an External Callout test case into the Visual Script that
references the Callout Server of the ActiveX .dll.
The code used for Test Scriptlets, Custom VBA tests, and External
Callout test cases can assess the Document Object Model of the Web
page, evaluate and modify elements and properties, access Data Bank
values, and change Visual Script page navigation programmatically based
upon specific conditions.

About Thick Client and Thin Client


Thick Client and Thin Client refer to the capabilities of the Web Browser
control used to play back Visual Scripts. Thick Client is a fully functional
browser control used for performing regression testing on Web applications.
The Visual Scripts are played back using full browser capabilities. Thick
Client mode requires more resources and is less scalable than Thin Client,
and should be used for regression testing and for special cases in load
testing. One reason for using Thick client in load testing is for Web pages
that include scripts requiring large amounts of client-side processing.

240

e-Tester User Guide

Working with Document Objects

Thin Client is a browser-control emulator that is used for load testing of a


Web application. Thin Client is a less resource (i.e. CPU usage and
memory consumption per process) intensive method that provides a high
level of Web compatibility and Visual Script verification. Thin client
mode consumes fewer system resources per process than Thick Client,
and is able to run more virtual users on a given agent workstation.
When creating custom Test Scriptlets, Custom VBA tests, or ActiveX
.dlls for External Callout Tests, it is important to know if the Visual
Script will be played back in Thick Client (regression testing) or Thin
Client (load testing). The e-PI reference specifies which methods,
properties, and procedures can be used with Thick Client and/or Thin
Client modes.

Working with Document Objects


The e-PI lets you access HTML Document Objects using Test Scriptlets,
Custom VBA tests, and External Callout test cases in a Visual Script. The
e-PI provides methods that let you get document objects, find and
manipulate Web page elements and properties, access Data Banks, and
change page navigation.
To use the Test Scriptlets, Custom VBA tests, and External Callout test
cases, it is important to be familiar with HTML, Dynamic HTML, the
Document Object Model, and Web page scripting using VBScript or
JavaScript. This section provides a brief overview of document objects
and the object hierarchy. See Appendix C for a list of Web resources
where you can find more information about Dynamic HTML, the
Document Object Model, and Web page scripting.

About the Document Object Hierarchy


Web page documents are represented as a hierarchy of parent, child, and
sibling objects. Objects are items that make up a Web page. The top-level
object is the parent document. The parent document contains child
objects, which in turn can also contain child objects. Objects on the same
level of the hierarchy are sibling objects.

Chapter 10: Using the Programming Interface

241

Working with Document Objects

The following HTML sample shows how a page is defined in the HTML
source.
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
</HEAD>
<BODY>
<DIV>
<P><A HREF="contents.html">Contents</A></P>
</DIV>
<IMG SRC="contents.gif">
</BODY>
</HTML>

The parent-child-sibling structure of the HTML elements can be


represented in the following hierarchy:
Document Object Hierarchy
HTML
HEAD
TITLE

BODY
IMG

DIV
P
A

HTML represents the top-level document with the child objects HEAD
and BODY. The HEAD object is a child of HTML and contains the child
property TITLE. The BODY object is the child of HTML and contains
the child objects IMG and DIV, which are sibling objects. The DIV object
is the child of BODY and contains the child P, which in turn is the parent
of A.

The HTML hierarchy can also be represented using dot notation, as


follows:
documentObject.child.property

For example, in the above hierarchy, the inner HTML of the document
object can be represented as follows:
document.body.innerhtml

242

e-Tester User Guide

Working with Document Objects

Multiple objects of the same type in a Web page are grouped into
collections. Objects within a collection can also be represented using dot
notation and a zero-based index value, as follows:
document.images(0)

This represents the first image in the collection of images on the Web
page in source order. When developing custom tests for use with e-Tester
Visual Scripts, you can use the object references to locate individual
objects within a Web page. For example, you can use the object model to
determine the number of links on a page.
Document objects contains a variety of collections, elements, methods,
and properties that can be accessed and manipulated using the Document
Object Model and e-Tester e-PI. The e-PI provides methods for getting
the Document Object Model of Web pages recorded to a Visual Script.
However, not all objects have defined collections in the Dynamic HTML
Object Model. See Appendix C for lists of collections, elements, and
properties that can be used with HTML and Dynamic HTML.

About Document Object Methods


Document objects have methods associated with them. Methods define
the actions that can be performed on document objects. For example links
can be clicked and forms can be submitted or reset.
When developing custom tests for use with e-Tester Visual Scripts, you can
use the methods to perform actions on a Web page in the Visual Script. For
example, you can access and click links programmatically, as follows:
documentObject.links(0).click

This represents a mouse click on the first HREF link on the Web page in
source order.

About Document Object Properties


Document objects also have properties associated with them. Properties
provide specific details about the attributes of particular Web page
element. For example, links have a destination URL as an HREF
attribute. Other elements have a variety of properties, such as a name,
colors, values, or inner text.
Chapter 10: Using the Programming Interface

243

Working with Document Objects

When developing custom tests for use with e-Tester Visual Scripts, you can
access the properties to query or set attributes of a Web pages elements in
the Visual Script. The properties are useful for checking various aspects of
the Web page. You can query an element property using the following dot
notation and a script variable:
varname = documentObject.child.property

You can set an element property using the following dot notations:
documentObject.child.property = value
documentObject.Collection[("name")](index).property =
value

For example, you can query links programmatically, as follows:


myval=documentObject.links(0).href

This gets the value of the HREF property of the first link on the page, in
source order, and assigns it to the script variable myval. The following
example custom VBA code displays a list of all of the links in a recorded
Web page in the e-Tester results log pane:
'setup the variables
Dim topdoc As Object
Dim numlinks As Long, linkIndex As Long
Dim hrefVal As String, indexVal As String
'get the document object using e-PI
Set topdoc = RSWApp.om.getTopDocument(0)
'determine how many links on the page
'from the "length" property of the object model
numlinks = topdoc.links.length
'loop through the links and display link index and
'HREF value in e-Tester results log pane
If numlinks <> 0 Then
For linkIndex = 0 To numlinks - 1
hrefVal = topdoc.links(linkIndex).href
indexVal = "Link(" + Cstr(linkIndex) + ")"
Call RSWApp.WriteToLog(indexVal, "", hrefVal)
Next
End If

244

e-Tester User Guide

Working with Document Objects

About Dynamic HTML Events


Events are actions that occur when a user interacts with a Web page in a
browser. These include clicks on page, submitting a form, or moving the
mouse over specific object. Dynamic HTML events fire handlers that
provide some type of programmatic response in VBScript or JavaScript
when the Web page is viewed in a browser. Examples of events in
Dynamic HTML are onclick, onsubmit, and onmouseover. The
events fire the user-defined handlers referenced by the events in the inline
HTML. User defined handlers can be VBScript or JavaScript functions
or inline property settings. e-Tester records event handler actions based
upon the settings you define in Options Event Recording. You can also
use the FireEvent method of the e-PI to fire event handlers
programmatically.
When developing custom tests for use with e-Tester Visual Scripts, you can
perform validation tests on client side JavaScript functions on a Web page.
Use the parentwindow property of the document object to specify the
function name and parameters, as follows:
varname =
documentObject.parentwindow.functionName(params)

The following example VBA code gets a value from a Data Bank and
passes it to the Web page Java function validdate. If the validdate
function returns True, the date value is valid, otherwise an error number
and description are passed to e-Tester.
Dim doc As Object, retval As Boolean, mydate
Set doc = RSWApp.om.GetTopDocument(0)
Call RSWApp.GetDatabankValue("datevariable", mydate)
retval = doc.parentwindow.validdate(mydate)
If Not retval Then
err.number=9999
err.description="not a valid date"
End If

Chapter 10: Using the Programming Interface

245

How the e-PI Accesses Web Page Objects

How the e-PI Accesses Web Page Objects


The e-PI provides methods for getting document objects of Web pages
recorded to Visual Scripts. You can also use the Document Object Model to
access collections, elements, and properties that are part of the Web pages.
Visual Script Test Scriptlets, Custom VBA tests, and External Callout test
cases use the e-PI and the Document Object Model to access Web page
objects, collections, and properties. The code executed by the Test
Scriptlet or External Callout is not part of the Web page and are not
executed by the browser like scripts in the Web page source. The Test
Scriptlets, Custom VBA tests, and External Callout tests are part of the
Visual Script and are executed by e-Tester.
Test Scriptlets use the rswObject object of the e-PI. Variables are variants.
Custom VBA tests use the RSWApp object of the e-PI. Variables are typed.
External Callouts use the rswObject object of the e-PI. Variables are typed.

Getting the Document Object


The e-PI includes the following methods that get the document object of
a Web page recorded to a Visual Script:
Method

Description

FindDoc

Find an HTML document by frame name,


title, URL, or parent document.

FindElement

Find an HTML element in the current Visual


Script page by property, tag name, element
range, or root element.

GetTopDocument

Get the top document object of the current


page of the Visual Script.

Once an object variable has been set in the Test Scriptlet or External
Callout program, you can query or change HTML element properties
programmatically.

246

e-Tester User Guide

How the e-PI Accesses Web Page Objects

Getting the Top Document Object


You can use the GetTopDocument method of the e-PI to get the
document object. The following code snippet sets the document object to
the variable topdoc.
Dim topdoc As Object
Set topdoc = RSWApp.om.GetTopDocument(0)
GetTopDocument gets the document object for Web pages that are not in

a Frameset and the top document object of Web pages in a Frameset.

You can use dot notation programming to access specific properties, such
as the page title, Uniform Resource Locator, and the length of links or
forms collections. For example the following code snippet sets the
document title, URL, and links collection length to the variables
docTitle, docUrl, and linksLength, respectively:
Dim topdoc As Object, docTitle As String
Dim docUrl As String, linksLength As Long
Set topdoc = RSWApp.om.GetTopDocument(0)
docTitle = topdoc.title
docUrl = topdoc.url
linksLength = topdoc.links.length

See Appendix C for lists of collections, elements, and properties that can
be used with HTML and Dynamic HTML document objects.

Getting Document Objects in a Frameset


You can use the FindDoc method of the e-PI to get the document object
of an HTML document in a Frameset. The FindDoc method lets you
specify which document by the frame Name value, the document title, or
by the document URL. You can specify the name, title, or URL using
Visual Basic Like operator pattern matching. The name, title, and URL
parameters are case sensitive.
If the Visual Script page using the Test Scriptlet, Custom VBA test, or
Callout test is part of a Frameset, and you want to get the document
object of a page in another frame, you also have to specify the top
document of the Frameset. The following code snippet gets the parent
document object of the Frameset and then gets the document located in
the Frame named Contents and sets it to the variable framedoc:
Chapter 10: Using the Programming Interface

247

How the e-PI Accesses Web Page Objects

Dim parentdoc As Object, framedoc As Object


Set parentdoc = RSWApp.om.GetTopDocument(0)
Set framedoc=RSWApp.om.FindDoc("Con*","*","*",parentdoc)

You can leave out the optional parameters specified as any value using
"*", as follows:
Set framedoc=RSWApp.om.FindDoc("Cont*",,,parentdoc)

If the Visual Script page using the Test Scriptlet or Callout test was
recorded from a sub frame and you want to get the document object of the
current Visual Script page in a sub frame, you do not need to specify the
parent document object. The following code snippet gets the document
object of the document with the <TITLE> "Introduction" to the
variable framedoc:
Dim framedoc As Object
Set framedoc=RSWApp.om.FindDoc(,"Intro*")

Finding HTML Elements


You can use the FindElement method of the e-PI to find a specific
elements with the HTML source of a recorded Visual Script page. You
can use the object model to query or change HTML element properties
programmatically. The following code snippet finds the INPUT element of
name="FirstName" and sets the document object to the variable
myElement:
Dim myElement As Object, myElementVal As String
Set myElement=RSWApp.om.Findelement("FirstName",
"INPUT","name")

You can use the object model to set the value of Form INPUT elements.
For example, the following code snippet sets the value of the FirstName
INPUT element to Chris:
myElement.value="Chris"

You can also use the object model to get the outer HTML value. For
example, the following code snippet sets the outerhtml property to the
variable myElementval:
myElementVal=myElement.innerhtml

You can also use the object model to perform mouse clicks on HTML
elements. The following code snippet finds the INPUT element of
248

e-Tester User Guide

How the e-PI Accesses Web Page Objects

type="submit" and sets the document object to the variable


myElement, and then performs a mouse click:
Dim myElement
Set myElement = RSWApp.om.Findelement("submit",
"INPUT","type")
myElement.click

Finding an Element Within a Specific Range


You can also use the FindElement and FindElementValue methods to
find elements within a specific range of the HTML source of a recorded
Visual Script page. The following code snippet finds the value of the first
OPTION element between INPUT NAME="email" and INPUT
NAME="Submit":
Dim parentDoc As Object, propPattern As String
Dim elementValue
Dim fromElement As Object, toElement As Object
Set parentDoc = RSWApp.om.getTopDocument(0)
propPattern="*"
'set the "from element" as <INPUT NAME="email">
Set fromElement=RSWApp.om.findelement("email*","INPUT",
"NAME","","",parentDoc)
'set the "to element" as <INPUT NAME="Submit">
Set toElement=RSWApp.om.findelement("Submit","INPUT",
"NAME","","",parentDoc)
'find the first OPTION value between "from-to" elements
elementValue=RSWApp.om.findelementValue(propPattern,
"OPTION","VALUE",fromElement,toElement,parentDoc)
'display the value in the Summary column of e-Tester
Call RSWApp.WriteToLog("","",elementValue)

Matching Patterns in the HTML Source


You can use the MatchHtml method of the e-PI to find specific string
patterns within the HTML source of a page recorded to a Visual Script.
With the MatchHtml method, you specify left and right text string
patterns to search for and the method returns the text string between the
specified patterns. The following code snippet finds the text string
between the first instance of <A href= and >. The WriteToLog
procedure displays the results in the e-Tester Results log pane.
Chapter 10: Using the Programming Interface

249

How the e-PI Accesses Web Page Objects

Dim topdoc As Object, myMatch As String


Dim resultb As Boolean
resultb=RSWApp.matchHtml(myMatch, "<A href=",">","")
Call RswApp.WriteToLog(,resultb,myMatch)
resultb is a Boolean that returns True or False. The myMatch variable

is used to store the text string returned from the HTML source.

You can find pattern matches in the HTML source of a specific frame by
including the frame name in the MatchHtml method, as follows:
resultb=RSWApp.matchHtml(myMatch, "<A href=",">","main")

When specifying the left and right string patterns to match, you can use
the question mark (?) and asterisk (*) wildcard characters. The question
mark matches zero or one character. The asterisk matches zero or more
characters. You use the wildcard character in place of character patterns
that are part of the HTML source. The following example shows how the
question mark and asterisk can be used to search for strings containing
quotation marks in the HTML source:
resultb=RSWApp.matchHtml(myMatch, "href=?index*",">","")

Setting Properties Using the Object Model


You can use the document object model to query or change HTML
element properties programmatically. The following code snippet gets the
top level document object and sets the values of the first and second check
boxes of the first form of the Web page:
Set topdoc=RSWApp.om.GetTopDocument()
topdoc.forms(0).elements("Interest")(0).checked=True
topdoc.forms(0).elements("Interest")(1).checked=False
.forms(0) represents the first forms collection of the Web page.
.elements("Interest")(0) and .elements("Interest")(1)
represent the first and second elements, named "Interest", of the
elements collection of forms(0). .checked is the checked property of
the elements. The forms and elements collections use a zero-based

index to locate forms on a page and elements within the forms. The index
is based on the source order of the FORM elements and each child
INPUT element of each form in the Web page.
250

e-Tester User Guide

Getting Data Bank Values

Getting Data Bank Values


The e-PI provides the following methods for getting and setting Data
Bank values that you can use to change HTML attributes, Form values,
and other properties of a Web page:
Method

Description

GetDatabankValue

Get a value from a Data Bank file.

SetDatabankValue

Set a value in a Data Bank variable.

Before you can access Data Bank values (from a file) using the e-PI, you
must create a Data Bank file containing the data you plan to use as part of
testing. Data Bank files are comma-delimited ASCII files with the field
names as column headers on the first line of the file. Subsequent lines of
the file contain data. e-Tester uses the \DataBank subdirectory of the
installation directory (C:\Empirix\eTEST is the default) as the default
location for Data Bank files.
After you create a Data Bank file, you must also map and bind the Data
Bank field names to Visual Script variables using the Data Bank Wizard.
You can set Data Bank internal variables using the SetDatabankValue
method. Internal Data Bank variables are mapped to Visual Script
parameters.

Setting Up Data Bank Files


The content of the Data Bank files that you use with the e-PI depends
upon the results you want to achieve in testing your Web pages. You can
set up a simple Data Bank file to populate a single Web page Form field,
as follows:
Search
Lamps
Plants
Paints
Search is the name of the Data Bank field. Lamps, Plants, and Paints
are the actual data values.

Chapter 10: Using the Programming Interface

251

Getting Data Bank Values

You can set up a Data Bank file to populate multiple Web page Form
fields, as follows:
FirstName,LastName,Mail,Phone
John,Smith,JohnS@empirix.com,(781) 993-8500
Mary,Ellen,MaryE@empirix.com,(781) 993-8501

If a data value contains a comma, place quotation marks around the value,
as follows:
John,Smith,"Anytown, MA",(781) 993-8500

You can also combine Form field input values with multiple check box or
option button settings, as follows:
Search,Option1,Option2,Option3
Lamps,True,False,False
Lamps,False,True,False
Lamps,False,False,True
Plants,True,False,False
Plants,False,True,False
Plants,False,False,True
Paints,True,False,False
Paints,False,True,False
Paints,False,False,True

After you create a Data Bank file, you must map and bind the Data Bank
field names to Visual Script variables.

Setting Up Visual Script Variables


To access Data Bank values using the e-PI, you need to map and bind
Visual Script variables to field names in the Data Bank file. The
procedure is the same as using Data Bank files with Visual Script
parameters. The Working with Data Banks section of Chapter 8 in this
manual explains how to map and bind Data Banks to Visual Scripts.
The names you use to define Visual Script variables in the Data Bank
Wizard are the names you will reference using the GetDataBankValue
and SetDataBankValue methods of the e-PI.

252

e-Tester User Guide

Getting Data Bank Values

Getting Data Bank Values Using the e-PI


Once you have created a Data Bank file and mapped and bound the Field
names to Visual Script variables, you can use the GetDataBankValue
method of the e-PI to access the Data Bank values. You can use Data
Bank values to change Web page attributes programmatically.
The following VBA code snippet finds the INPUT element of
name="search", sets the value using the Data Bank value, and then
clicks the Form INPUT button of type=Submit. "var_Search" is the

name of the Visual Script variable that is mapped and bound to the Data
Bank field name using the Data Bank Wizard. The "var_Search"
variable is defined as an external variable in the Data Bank Wizard.

Dim searchField As Object, submitButton As Object


Dim searchText As String
'Indicate that we will replace the navigation
'for the previous page
RSWApp.replaceNav
'Map and bind the Visual Script variable "var_Search"
'to the "Search" field in the Data Bank file using
'the Data Bank wizard
'Get the Data Bank value from the Visual Script
"var_Search" and store the value in "searchText"
call RSWApp.getdatabankvalue("var_Search",searchText)
'Get the Search Input Element Object using FindElement
Set searchField=RSWAPP.om.Findelement("Search",
"INPUT","name")
'Set the Data Bank value to the Form field value
searchField.value=searchtext
'Get the Submit button Element Object using FindElement
Set submitButton=RSWApp.om.Findelement("submit",
"INPUT","type")
'Click the Submit button
submitButton.click

The above code snippet uses the FindElement method of the e-PI to
locate the Form INPUT elements. You can also use the object model and
dot notation programming to set the values explicitly. The following code
snippet gets the Data Bank value for a form field and three option
Chapter 10: Using the Programming Interface

253

Getting Data Bank Values

buttons. The code then sets the form element value, the option button
values and clicks the Submit button using the object model.
Dim topdoc As Object, searchText As String
Dim radio1, radio2, radio3
'Indicate that we will replace the navigation
'for the previous page
RSWApp.replaceNav
'Get
Call
Call
Call
Call

the Data Bank values


RSWApp.GetDataBankValue("var_option1",radio1)
RSWApp.GetDataBankValue("var_option2",radio2)
RSWApp.GetDataBankValue("var_option3",radio3)
RSWApp.GetDataBankValue("var_Search",searchtext)

'Get my Document Object Model through GetTopDocument()


Set topdoc=RSWApp.om.GetTopDocument(0)
'Use VBScript Object Model navigation to set
'the form value explicitly.
topdoc.forms(0).elements("Interest")(0).checked=radio1
topdoc.forms(0).elements("Interest")(1).checked=radio2
topdoc.forms(0).elements("Interest")(2).checked=radio3
topdoc.forms(0).elements("Search").value=searchText
'Submit the form to generate a navigation
topdoc.forms(0).elements("Submmit").click

How e-Tester Gets Data Bank Records


The current Data Bank record is determined by the record pointer of
e-Tester. The current record can be set using the Data Bank Wizard or
the Iterate options.
When you play back a Visual Script, e-Tester increments the current
record pointer on each playback. After playing back the last record of the
Data Bank file, the record pointer returns to the first record of the Data
Bank file.
When you Iterate a Visual Script, e-Tester plays back the Visual Script
once for each record specified in the Iterate settings. If you set Iterations
from the First to Last records in the Data Bank file, playback
iterations stop after the last record in the Data Bank file.

254

e-Tester User Guide

Getting Data Bank Values

Setting Data Bank Values Using the e-PI


You can set the value of internal variables defined in the Data Bank Wizard.
Internal Data Bank variable values can be passed to Visual Script parameters.
You can use the SetDataBankValue method of the e-PI to set the Data Bank
variables to change Web page attributes programmatically.
The following code snippet sets text plus a random number as a login
value and submits the value to a Web page form. The var_myValue
variable is defined as an internal variable in the Data Bank Wizard.
Dim loginField As Object, submitButton As Object
Dim loginText As String, setDb As String
'Map the Visual Script variable "var_myValue"
'as an Internal variable using the Data Bank wizard
'Specify any Expression as the internal
'variable value
'Define a random login value to set to the Visual
'Script variable
Randomize
setDb="Mylogin" & CStr(FormatNumber(Rnd*10,0))
'Set the value
Call RSWApp.SetDataBankValue("var_myValue",setDb)
'Get the Data Bank value from the Visual
'Script variable "var_myValue"
'and store the value in "loginText"
Call RSWApp.GetDataBankValue("var_myValue",loginText)
'Get the Login Input Element Object using FindElement
Set loginField=RSWApp.om.FindElement("Login",
"INPUT","name")
'Set the Data Bank value to the Form field value
loginField.value=loginText
'Get the Submit button Element Object using FindElement
Set submitButton=RSWApp.om.FindElement("submit",
"INPUT","type")
'Click the Submit button
submitButton.click

Chapter 10: Using the Programming Interface

255

Using Test Scriptlets

Using Test Scriptlets


e-Tester includes the following two menu options for adding Test
Scriptlets to Visual Scripts:
E Selecting Tests Insert Test Scriptlet Before adds a Test Scriptlet that

will run before playing back the Visual Script page.

E Selecting Tests Insert Test Scriptlet After adds a Test Scriptlet that will

run after playing back the Visual Script page.

When you add a Test Scriptlet to a Visual Script, the e-Tester browser
pane changes to a script-editing pane where you can define your own
VBScript code. The following illustration shows the script-editing pane:
Script Editing Pane

Test Scriptlet
in Visual Script

When you first add a Test Scriptlet test, the script-editing pane only
contains the text Your Script Here. You enter your Test Scriptlet code
and comments to define the test.

256

e-Tester User Guide

Using Test Scriptlets

The following illustration shows the script-editing pane with a VBScript


code snippet:
Test Scriptlet
in Script Editing Pane

Enter your VBScript code into the script-editing pane. Test Scriptlets use
the rswObject object of the e-PI. Variables are variants. Click Done and
Save the Visual Script when finished editing the Test Scriptlet.
Appendix B contains a reference for the e-PI methods and properties that
you can use in your custom code. The following section provides
additional information about creating and debugging Test Scriptlets.

Web Page Scripting vs. Test Scriptlets


Test Scriptlets use the Visual Basic Scripting Edition (VBScript)
scripting language, one of the scripting languages supported for Web
pages. However, the Test Scriptlet code is not part of the Web page and
is not executed by the browser like scripts in the Web page source. The
Test Scriptlets are part of the Visual Script and are executed by e-Tester.
The Test Scriptlet code is executed by e-Tester as in-line code. Function
Procedures and Sub Procedures are not supported.
When writing code for Test Scriptlets, do not include Web page
<SCRIPT> </SCRIPT> tags around the Test Scriptlet code.
Chapter 10: Using the Programming Interface

257

Using Test Scriptlets

Variables and Error Handling


When creating Test Scriptlets, the following statements are automatically
defined for the Test Scriptlet internally within e-Tester by default.
Option Explicit
on error resume next

It is not necessary to include these statements in your Test Scriptlets.


All variables are variants and must be declared. Variables can be shared
between Tests Scriptlets.
e-Tester displays compiler and run-time error messages in the Visual
Script node and the Script editing pane. By default, Test Scriptlet
execution continues even if a run-time error occurs. You can have
e-Tester halt execution on run-time errors by selecting Options
Playback, and then selecting Always
Always Invoke Script Debugger on Scripting
Errors. The on error resume next statement will not be added for the
Test Scriptlet. Run-time errors that occur during playback of a Test
Scriptlet will invoke the installed script debugger.
You can also build in error reporting for the custom tests you create for
your Web application using the errNumber and errDescription
properties of the e-PI. The errNumber provides a way to indicate to eTester that your custom test passed or failed.

Editing Test Scriptlets


After you add a Test Scriptlet to a Visual Script, you can edit the code at any
time by double-clicking the Test Scriptlet Before or Test Scriptlet After node
of the Visual Script. The Test Scriptlet opens in the Script editing pane.

258

e-Tester User Guide

Debugging Test Scriptlets

Debugging Test Scriptlets


You can invoke the debugger manually by inserting a Stop command
into the Test Scriptlet code.
You can also enable the debugger in e-Tester by selecting Options
Playback, and then selecting Always Invoke Script Debugger on Scripting
Errors.
If you have Microsoft Visual Studio installed, e-Tester uses the
Microsoft Development Environment for Test Scriptlet debugging. If
you do not have Visual Studio installed, you can install the Microsoft
Internet Explorer Script Debugger from Microsoft and e-Tester will use
that debugger. e-Tester uses whichever debugging tool was last installed.

Debugging With the Microsoft Script Debugger


With Microsoft Script Debugger, if a Run-time exception error (or Stop
command) occurs in a Test Scriptlet when playing back a Visual Script,
the debugger opens the Test Scriptlet as a VBScript script block with
e-Tester as an attached process:

Chapter 10: Using the Programming Interface

259

Debugging Test Scriptlets

You can use the available features of the debugger to evaluate the Test
Scriptlet code.
Note: Any edits you make to fix problems in Test Scriptlet code must be

made in the e-Tester script-editing pane. The Test Scriptlets are saved as an
internal part of the e-Tester Visual Scripts, which the debugger cannot save.
The debugger provides options for stepping through code. The following
sections provide basic information about using the step and view local
variable capabilities. For additional information about using the
Microsoft Script Debugger, refer to the Microsoft online help topics for
the debugger.

Stepping Through Scripts


You can use the step options of the debugger to view the execution of
individual lines of code in a Test Scriptlet. The following options are
available:
Step Into steps into the function or sub procedure. Since Tests Scriptlets

in e-Tester do not support functions or sub procedures, this command


simply executes the current script command.
Step Over steps over the current command and executes the next

command in the script.


Step Out steps out of a function or sub procedure. Since Tests Scriptlets

in e-Tester do not support functions or sub procedures, this command


simply executes the current script command.

Stopping Debugging
While debugging in the Microsoft Script Debugger, e-Tester is in a
suspended state. The current Visual Script playback is halted at the point
where the Test Scriptlet started the debugger. You must stop the
Microsoft Script Debugger to restore e-Tester to a running state and
continue the Visual Script playback.

260

e-Tester User Guide

Debugging Test Scriptlets

Debugging with the Microsoft Development


Environment
With Microsoft Visual Studio installed, if a Run-time exception error (or
Stop command) occurs in a Test Scriptlet when playing back a Visual
Script, the following message appears:

Click Yes to debug the Test Scriptlet. The debugger then displays a
message asking if you would like to open a project for debugging:

Click No. The debugger opens the Test Scriptlet as a VBScript script
block with e-Tester as an attached process:

Chapter 10: Using the Programming Interface

261

Debugging Test Scriptlets

You can use the available features of the debugger to evaluate the Test
Scriptlet code.
Note: Any edits you make to fix problems in Test Scriptlet code must be

made in the e-Tester script-editing pane. The Test Scriptlets are saved as an
internal part of the e-Tester Visual Scripts, which the debugger cannot save.
The debugger provides options for stepping through code, viewing
variable values, setting watches, and viewing threads and processes. The
following sections provide basic information about using the step and
view local variable capabilities. For additional information about using the
Microsoft Development Environment, refer to the Microsoft online help
topics for the debugger.

262

e-Tester User Guide

Debugging Test Scriptlets

Viewing Local Variable Values


The View Locals option of the debugger lets you view the values of local
variables. You can also use the Locals window view the hierarchy of
objects. The following illustration shows the Locals window with two
objects and four variables.

e-Tester automatically creates the RswObject when you playback a Visual


Script. RswObject is part of the e-PI and has several properties that you
can access programmatically using Test Scriptlets. The following
illustration shows the expanded RswObject tree.

See the e-PI Command Reference in Appendix B for more information


about using the RswObject properties.
The e-PI provides methods for accessing document objects of Web pages
recorded to a Visual Script. You can use the Locals window to view the
hierarchy of the document object and the values of various properties of
the Web page. The following illustration shows the object model of a
Chapter 10: Using the Programming Interface

263

Debugging Test Scriptlets

Web page document that was accessed using the GetTopDocument


method of the e-PI:

Stepping Through Scripts


You can use the step options of the debugger to view the execution of
individual lines of code in a Test Scriptlet. The following options are
available:
Run to Cursor
Cursor executes the script to the current cursor location. Place the

cursor on the line where you want execution to halt and select this option.
Step Into steps into the function or sub procedure. Since Tests Scriptlets
in e-Tester do not support functions or sub procedures, this command
simply executes the current script command.
Step Over steps over the current command and executes the next

command in the script.


Step Out steps out of a function or sub procedure. Since Tests Scriptlets

in e-Tester do not support functions or sub procedures, this command


simply executes the current script command.

Detaching the Process


While debugging in the Microsoft Development Environment, e-Tester
is in a suspended state. The current Visual Script playback is halted at the
point where the Test Scriptlet started the debugger. You must detach the
e-Tester process from the Microsoft Development Environment before
closing the debugger. Detaching the process restores e-Tester to a
running state and continues the Visual Script playback.
264

e-Tester User Guide

Creating Custom Visual Basic Tests

Creating Custom Visual Basic Tests


e-Tester includes options for inserting custom Visual Basic code into
Visual Scripts. The custom Visual Basic code can perform specialized
tests based upon Visual Script page and script events. Custom VBA tests
are integrated with the e-Tester Visual Scripts and code can be shared
across multiple Visual Scripts.
Each page of e-Tester Visual Scripts has a Custom Programmability node
where you can add custom Visual Basic code to perform specialized tests.
e-Tester also includes a Custom Test Wizard that you can use to select
Web page objects and define specific tests for the object. The Wizard
automatically generates the Visual Basic code in the Microsoft Visual
Basic Integrated Development Environment. You can customize the
Wizard generated code using all of the features and capabilities of the
Microsoft IDE.

Using Custom Programmability


When you record a Visual Script using e-Tester, each page recorded to
the Visual Script includes a Custom Page Programmability node that
provides an interface to the Visual Basic for Applications environment.
Custom Page
Programmability
Node Opens
Default VBA
Project for the
Visual Script

Chapter 10: Using the Programming Interface

265

Creating Custom Visual Basic Tests

Right-click the Custom Page Programmability node and select Edit VBA
Code to open the default Visual Basic project for the Visual Script in the
VBA environment.
Code Window

Project Explorer
Window

Properties
Window

Locals Window

The Visual Script project contains a document for each Web page
recorded to the Visual Script and a document for the entire script
The Project Explorer window also includes a Shared Code project. The
Shared Code project can contain code that will be used by all Visual
Scripts. You can write your own custom Visual Basic code in any of the
Visual Script page documents or in the Shared Code project.
The Custom Test Wizard also creates documents in the project specific to
settings selected in the Wizard. The document name is the same name as
the name defined in the Custom Test Wizard Welcome screen.

266

e-Tester User Guide

Creating Custom Visual Basic Tests

Visual Script Projects


The Visual Basic Project Explorer window contains the default projects
for the Visual Script. The project name is the same name as the Visual
Script. The Project Explorer window also includes a Shared Code project.

Visual Script Objects


The Visual Script project, by default, includes an e-Tester document for
each page recorded to the Visual Script and a document for the entire
Visual Script. The Visual Script project also includes a reference to the
Shared Code project.
The Visual Script project will also contain an e-Tester document for each
Custom Test added to the Visual Script using the Custom Test Wizard.

Shared Project
The Shared Workspace project lets you create custom Visual Basic code
that is shared by all e-Tester Visual Scripts. Each Visual Script project
automatically includes a reference to the Shared Workspace project. Any
code in the Shared Workspace project is automatically available for use by
all new Visual Scripts.

Chapter 10: Using the Programming Interface

267

Creating Custom Visual Basic Tests

Visual Script Page Object


Each Web page recorded to the Visual Script has a corresponding page
document in the Visual Script project in Visual Basic. Each page
document includes the RSWVBAPage object with the following events and
properties:
Property/Event

Description

afterPlay

Executes custom Visual Basic code


after playback of a Visual Script page.

beforeAction

Executes custom Visual Basic code


before an action occurs on a Visual
Script page.

beforePlay

Executes custom Visual Basic code before


playback of a Visual Script page.

errDescription

Specifies an error description to pass to


e-Tester.

errNumber

Sets an error number to pass to


e-Tester or gets an error number from
e-Tester.

RSWApp

Property reference to the RSWApp class


of the VBADLL type library.

Appendix B provides a complete reference for the events and properties.

268

e-Tester User Guide

Creating Custom Visual Basic Tests

Visual Script Object


Each Visual Script has a corresponding page document in the Visual
Script project in Visual Basic. Each script document includes the
RSWVBAScript object with the following events and properties:
Property/Event

Description

endPlay

Executes custom Visual Basic code


after the end of Visual Script playback.

errDescription

Specifies an error description to pass to


e-Tester.

errNumber

Sets an error number to pass to


e-Tester or gets an error number from
e-Tester.

RSWApp

Property reference to the RSWApp class


of the VBADLL type library.

scriptClose

Executes custom Visual Basic code


after closing a Visual Script.

scriptOpen

Executes custom Visual Basic code


upon opening a Visual Script.

scriptRename

Executes custom Visual Basic code


upon renaming a Visual Script.

scriptSave

Executes custom Visual Basic code


upon saving a Visual Script.

startPlay

Executes custom Visual Basic code


before starting Visual Script playback.

Appendix B provides a complete reference for the events and properties.

Chapter 10: Using the Programming Interface

269

Creating Custom Visual Basic Tests

Variables and Error Handling


Variables and error handling follow the Visual Basic conventions. The
following sections provide a brief overview of how to use variables and
error handling. See the Microsoft Visual Basic online help topics in the
VBA IDE for additional information.

Variables
Variables are typed and must be declared. Variables can be procedure-

level, module-level, or global declarations.

Declare procedure-level variables using the Dim statement in the


procedure, as follows:
Private Sub RSWVBATest_afterPlay()
Dim myProcedureVar as String
'Other procedure code
End Sub

Declare module-level variables using the Dim statement in the


(Declarations) procedure of the (General) object of the Page_xxx,
ThisScript, or name (Custom_Test_On_Page_xxx) module, as follows:
Dim myModuleVar as String
Private Sub RSWVBATest_afterPlay()
'Other procedure code
End Sub

Variables can also be shared between Visual Scripts. Declare the variable
using the Public statement in the (Declarations) procedure of the
(General) object of SharedModule, as follows:
Public myGlobalVar As String
Public Function MySharedFunc (ret As String)
'
'Procedure code
End Function

270

e-Tester User Guide

Creating Custom Visual Basic Tests

Error Handling
When creating Custom VBA tests, you can add custom error handling to
procedures using the On Error statement, Visual Basic Err object, and
e-PI errDescription and errNumber properties, as follows:
Private Sub RSWVBATest_afterPlay()
On Error GoTo ERRLBL
'Code for Sub procedure
ERRLBL:
'Some Error Handling Code
'and the following return values
errDescription = Err.Description
errNumber = Err.Number
End Sub

By default, run-time errors that occur during playback of a Custom VBA


test will invoke the Visual Basic for Application IDE. You can disable
runtime error handling by selecting Options Playback, and then
clearing Always Invoke VBA IDE on VBA Errors.

Editing Custom VBA Tests


After you add a Custom VBA test to a Visual Script, you can edit the code at
any time by right-clicking the Custom Page Programmability or Custom Test
name node of the Visual Script and selecting Edit VBA Code. The Visual
Basic code opens in the VBA IDE.

Inheriting VBA Code from a Saved Visual Script


You can inherit Visual Basic code from a saved Visual Script to a new
Visual Script in e-Tester.
To inherit VBA code from another Visual Script:
1.

Select File Inherit VBA From. A dialog box opens for selecting the
Visual Script from which to inherit the saved VBA code.

2.

Select the Visual Script and click Open.

When you inherit VBA code from a saved Visual Script, the VBA code
from the saved Visual Script completely replaces any VBA code in the
current Visual Script.
Chapter 10: Using the Programming Interface

271

Creating Custom Visual Basic Tests

Sharing Code Between Visual Scripts


Custom VBA tests in Visual Scripts can access a shared code module that
is available to all Visual Scripts. You can create you own custom
procedures in the shared code module and then call the procedures from
the page or script objects in any Visual Script VBA project.
To add shared code:
1.
2.

Record a Visual Script


Right-click the Custom Page Programmability node and select Edit VBA
Code.

3.

Double-click the SharedModule in the SharedProject project.

4.

Create your own Function or Sub procedures in the SharedModule.

5.

Close the Visual Basic environment.

6.

Save the Visual Script.


Note: The shared code is saved in the rsw.vba file in the installation

directory. If your Visual Scripts use shared code and you move Visual
Scripts between workstations, you should also make sure to move the
code in the rsw.vba file. You can either export the code or copy the
rsw.vba file.

Debugging with the VBA Development Environment


You can use all of the features and capabilities of the VBA IDE to debug
custom VBA code. If a run-time exception error occurs in a Custom VBA
test when playing back a Visual Script, a run-time message appears:

272

e-Tester User Guide

Creating Custom Visual Basic Tests

Click Debug. The debugger opens the Custom VBA code in break mode
in the VBA IDE:

You can use the available features of the VBA IDE to evaluate the Custom
VBA test code.
Note: Any edits you make to fix problems in Custom VBA code are

automatically saved as part of the Visual Script.


The debugger provides options for stepping through code, viewing
variable values, and setting watches. The following sections provide basic
information about using the step and view local variable capabilities. For
additional information about using the VBA IDE, refer to the Microsoft
online help topics.

Chapter 10: Using the Programming Interface

273

Creating Custom Visual Basic Tests

Viewing Local Variable Values


The View Locals option of the debugger lets you view the values of local
variables. You can also use the Locals window to view the hierarchy of
objects. The following illustration shows the Locals window with two
objects and four variables.

The RSWApp object is part of the e-PI and has several properties that you
can access programmatically using Custom VBA tests. The following
illustration shows the expanded RSWApp tree.

See the e-PI Command Reference in Appendix B for more information


about using the RSWApp methods and properties.
The e-PI provides methods for accessing document objects of Web pages
recorded to a Visual Script. You can use the Locals window to view the
hierarchy of the document object and the values of various properties of
the Web page. The following illustration shows the object model of a
Web page document that was accessed using the GetTopDocument
method of the e-PI:
274

e-Tester User Guide

Creating Custom Visual Basic Tests

Using Breakpoints
You can set breakpoints in Custom VBA tests to halt execution at specific
points in the Visual Basic code. When you set breakpoints and play back a
Visual Script in e-Tester, e-Tester automatically opens the VBA IDE at the
breakpoint location.

Stepping Through Code


You can use the step options of the debugger to view the execution of
individual lines of code in a Custom VBA test. The following options are
available:
Run to Cursor executes the script to the current cursor location. Place the

cursor on the line where you want execution to halt and select this option.
Step Into steps into the function or sub procedure.
Step Over steps over the current command and executes the next

command in the code.


Step Out steps out of a function or sub procedure.

Chapter 10: Using the Programming Interface

275

Creating External Callout Tests

Creating External Callout Tests


e-Tester provides full testing flexibility and extensibility using an External
Callout test cases. External Callout test case let you embed your own
testing logic at strategic points in the Visual Script to suit your specialized
testing needs. External Callout test cases provide access to an OLE
enabled facility of e-Tester that supports many programming
environments, including Microsoft Visual C++ and Microsoft Visual
Basic. This section explains how to extend your testing using External
Callout tests in e-Tester. Appendix B provides a reference to the
properties and methods available in the e-PI.

Basic Procedure
There are three steps to perform to create external callout tests, as follows:
1.

Specify an external callout server. This is an ActiveX .dll that you can
build using Visual Basic, Visual C++, Visual J++ or any other
environment that offers support for building ActiveX .dll files.

2.

Add your testing logic in two methods of the server as explained below.

3.

Add an e-Tester External Callout test case to the pages in the Visual
Script where you want to perform your custom tests.

Using the Sample Visual Basic Project


e-Tester includes a sample Visual Basic Project where you can add your
own custom logic to create an ActiveX .dll that the External Callout test
case call.
The sample project is locate in the RSWSource subdirectory of the
installation directory (C:\Empirix is the default). Copy the RswSample.vbp
to a different name. Edit the properties of the project to create your own dll
name. Edit the RSWServer class module in the project and add your own
testing logic in the BeforePagePlay and AfterPagePlay methods.

276

e-Tester User Guide

Creating External Callout Tests

Using the RSWServer Class Module


There are two methods that your External Callout server must support, as
follows:
E beforePagePlay
E afterPagePlay

The RSWServer class module in the sample project includes two the
methods beforePagePlay and afterPagePlay, which you can modify
to add your own testing logic.

Sample BeforePagePlay Method


The following is the sample code provided in the BeforePagePlay
method of the RSWServer class module:
Option Explicit
Public Sub beforePagePlay(rswObject As Object)
' Get parameters
Dim paramNames As New Collection, paramValues
As New Collection
rswObject.GetParameters paramNames, paramValues
' Put parameters into the common area
'(so that they can be accessed by the html)
Dim i%
For i = 1 To paramNames.Count
''######### You can process the parameters here
Next i
Dim dscr$
' Get url, scriptName, and scriptInfo
dscr = "Before PagePlayback called from " + _
rswObject.scriptName + " for page identified by " + _
rswObject.pageUId() + Chr(13) + "URL: " + _
rswObject.url
MsgBox dscr, vbOK, "RSW SAMPLE DLL"
'ADD ADDITIONAL LOGIC HERE
End Sub

You can edit the code to add your own testing logic using Visual Basic
and the e-PI.

Chapter 10: Using the Programming Interface

277

Creating External Callout Tests

Sample AfterPagePlay Method


The following is the sample code provided in the AfterPagePlay
method of the RSWServer class module:
Public Function afterPagePlay(rswObject As Object,
errorDescription$) As Long
Dim dscr$
'Get url, scriptName, and scriptInfo
dscr = "After PagePlayback called from " + _
rswObject.scriptName + Chr(13) + "for page
identified by " + _ rswObject.pageUId() _
+ "URL: " + rswObject.url
MsgBox dscr, vbOK, "SAMPLE DLL"
' Get parameters
dscr = ""
'collect all the parameters and values in dscr
Dim paramNames As New Collection, paramValues
As New Collection
rswObject.GetParameters paramNames, paramValues
Dim i%
For i = 1 To paramNames.Count
If i > 1 Then dscr = dscr + 1
dscr = paramNames(i) + "=" + paramValues(i)
Next i
' Get Html
Dim html As String
Call rswObject.gethtml(html, "", True, False)
If Len(html) > 200 Then html = Left(html, 200) + " ..."
'MsgBox html, vbOK, "SAMPLE DLL"
MsgBox "Return values from AfterPagePlay:" + Chr(13) +
_ "Error number 123, Error String: Fatal Error
from Server", _ vbOK, "SAMPLE DLL"
' Pretend that error exists
errorDescription = "Error From Server"
afterPagePlay = 123
End Function

You can edit the code to add your own testing logic using Visual Basic
and the e-PI.

278

e-Tester User Guide

Creating External Callout Tests

Using the RswIProgsLib Type Library


e-Tester includes a type library that you must reference in your Visual
Basic Project. The RswIProgsLib.dll is installed and registered by the
e-Test suite setup procedure. The RswIProgsLib.dll is installed in the
installation directory (C:\Empirix\eTEST is the default).
To use the type library, create a project in Visual Basic, select Project

References, and then select the Rsw IProgs Lib check box.

When creating code for External Callout tests, you must explicitly
reference the rswObject for each e-PI property or method, as follows:
Dim pageNum Long
pageNum = rswObject.play.currentPageNumber

or:
Dim topdoc As Object
Set topdoc = rswObject.om.GetTopDocument

Determining the Name of the External Callout


Server
Assuming you are building an ActiveX dll, if you use Visual Basic as is in
the sample that is provided, your .dll gets automatically registered when
you build it.
1.

Determine its ClassID by running regedit or regedt32, located


in your System directory.

2.

Search for the name of your dll. The regedit or regedt32 program
will provide you with its ClassID.

3.

Once you have the ClassID, search for the classid in the registry.

4.

Under the ClassID entry, look for the ProgID key. The ProgID is the
name of the server to specify in the e-Tester External Callout test case.

Chapter 10: Using the Programming Interface

279

Creating External Callout Tests

Specifying the External Callout Server in e-Tester?


Select Options External Callout and specify the external callout server in
the Program Id field. This is the entry in the registry called ProgID and
specifies the name to be used to communicate with this server (as
explained above).

Testing External Callout Server Communication with


e-Tester
Select the Test Server button in the Options External Callout dialog box.
If the Status field returns with Available, the server is available for use
from e-Tester. If the Status field returns with Not Available, verify that
the ActiveX .dll is properly registered and check that the correct Program
Id is specified in the e-Tester External Callout Test dialog box.

How External Callout Servers Get Called


The external callout server gets called for every page that has an External
Callout test case added to the page. The callout server can be called before
and after playback of a page and performs the tests that you have created
in the external server. You have to add the External Callout test case to
the Visual Script page(s) individually for the external tests to be
performed. When you add the External Callout test case, you select the
Before playback of page or After playback of page check box(s) to specify
when the External callout test is executed.

Identifying Pages in the External Callout Server


The external callout test case has a provision for every page to have a
unique identifier. It is defaulted to the title of the page but you may wish
to provide your own identifier.
Using page numbers for the unique identifier is not advisable as page
numbers can change with the insertion or deletion of pages in the script.
If you want to perform tests for a specific page, use the page identifier.

280

e-Tester User Guide

External Program Control

Return Values to e-Tester


The beforepageplay does not return any values.
The afterpageplay returns a long and an error string.
If the number returned from the afterPagePlay method is not equal to
0, then e-Tester considers the External Callout test to have failed and a
red flag will appear in the Visual script. The string can elaborate on the
details of the failure. The Properties dialog box of the External Callout
test case will show all the information for this node.
If the return value is 0, e-Tester considers the External Callout test to
have passed.

External Program Control


This section explains how to extend your testing using External programs
to control e-Tester. Appendix B provides a reference to the properties,
methods, and events available in the e-PI.
e-Tester includes two COM applications and a type library that you can use
for programmatic play back of Visual Scripts:
RswMint.Exe the minimum tester used as the e-Load thick client agent.
Webanlst.Exe the full e-Tester application.
RswIProgsLib.dll the e-Tester programming interface type library.

The following sections explain how to create e-Tester objects and start the
applications using Visual Basic.

Webanlst.Exe COM Server


Webanlst.Exe is the application that contains the properties, methods, and

events available for accessing the full e-Tester application from an


external program. Webanlst.Exe contains the following class:
ProgT
Webanlst.Exe is installed and registered by the e-Test suite setup procedure
in the installation directory (C:\Empirix\eTEST is the default). The following
sections show a basic example of how to create and set an object instance,
Chapter 10: Using the Programming Interface

281

External Program Control

open a workspace, and playback a Visual Script. You can use the features
and capabilities of your development environment to drive e-Tester
functionality. Appendix B lists the properties, methods, and events available
in the e-PI that you can use to access e-Tester features.

RSWMint.Exe COM Server


RswMint.Exe is the application that contains the events, methods, and

properties available for accessing the e-Tester Minimum Tester (mint)


from an external program. RswMint.Exe contains the following class:
ProgX
RswMint.Exe is installed and registered by the e-Test suite setup procedure
in the e-TEST suite installation directory (C:\Empirix\eTEST is the default).

Appendix B lists the available properties, methods, and events.

RswIProgsLib Type Library


e-Tester includes a type library that you must reference in your application.
RswIProgslib.dll library is installed and registered by the e-Test suite setup
procedure in the installation directory (C:\Empirix\eTEST is the default).
The RswIProgsLib type library contains the properties and methods for the
following properties of the ProgT and ProgX classes, as follows:

282

ProgT/ProgX Property

Class

Gen

IProg

Om

IProgOm

Play

IProgPlay

e-Tester User Guide

External Program Control

Referencing the Object


To use the e-TEST suite COM server applications and type library, create
a project in Visual Basic, select Project References, and then select the
appropriate check boxes. The following table lists the Visual Basic project
reference names for the e-TEST suite applications and type library:
COM Server/Type Library

VB Project Reference

Webanlyst.exe

RSW Web Analyst 4.0

RSWMint.exe

mint

RswIprogLib.dll

Rsw IProgs Lib

Defining Object Variables


When creating an external program to drive the full e-Tester application,
you must create an object with events from the Webanlst.ProgT class or
mint.ProgX class, as follows:
Option Explicit
Dim WithEvents objectName As server.class

Where:
objectName is any user defined object name.
server is the name of the e-Tester COM server application. The server
name for the full e-Tester application is webanlst. The server name for
the minimum e-Tester application is mint.
class is the name of the object. The class name for the full e-Tester
application is ProgT. The class name for the minimum e-Tester
application is ProgX.

The following example creates the object variable f_tester as the object
name for the full e-Tester:
Option Explicit
Dim WithEvents f_tester As webanlst.ProgT

The following example creates the object variable m_tester as the object
name for the minimum e-Tester:
Option Explicit
Dim WithEvents m_tester As mint.ProgX
Chapter 10: Using the Programming Interface

283

External Program Control

Assigning the Object Reference


Create a procedure and assign the object reference to the variable using
the Set statement, as follows:
Private Sub Form_Load()
Call Initialize
End Sub
Private Sub Initialize()
'Assign full e-Tester
Set f_tester = New webanlst.progT
'Assign minimum e-Tester
Set m_tester = New mint.progX
End Sub

Opening Workspaces
Once you create and set the object, you can use the features of the e-PI
and your development environment to open a workspace. The following
sample code opens the RSWDemo workspace on the button click:
Private Sub cmdOpenWorkspace_Click()
f_tester.play.openWorkspace "RSWDemo"
End Sub

Playing Back a Visual Script


Once you open a workspace you can playback Visual Scripts. The
following sample code opens and plays back the tutor1 Visual Script on
the button click:
Private Sub cmdPlayback_Click()
List1.AddItem "Playback Started " & Time
f_tester.play.openScript "tutor1"
f_tester.play.doScript
End Sub

284

e-Tester User Guide

External Program Control

Monitoring Script Events


You can monitor page and Visual Script play back events using the Event
procedures in the progT and progX classes. The following sample code
writes the Visual Script name, page number, result, and play back
duration to a list box using the PageEnd event:
Private Sub f_tester_PageEnd(ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem
End Sub

"played page: " + CStr(playIndex)


"Script name: " + currentScriptName
"Result: " + playOutcomeDescription
"Time (Sec): " + CStr(lastDuration/1000)

Closing e-Tester
You can use the Quit method of RswIProgslib.IProg to close the full
e-Tester application, as follows:
objectName.gen.quit

Where:
objectName is the user defined object name for the webanlst.ProgT

object.

The following example closes the full e-Tester:


f_tester.gen.quit

Releasing the Object Variables


When finished using the object variables for testing, clear the variables
that reference the minimum tester or the full e-Tester objects. Use the
Set statement and the Nothing keywords, as follows:
Set objectName = Nothing
Chapter 10: Using the Programming Interface

285

External Program Control

Where:
objectName is the user defined object name for the mint.ProgX or
webanlst.ProgT objects.

The following example clears the object variable f_tester as the object
name for the full e-Tester:
Set f_tester = Nothing

The following example clears the object variable m_tester as the object
name for the minimum e-Tester:
Set m_tester = Nothing

About Minimum e-Tester


The minimum e-Tester is an Agent running in Thick Client mode. The
agent runs the Visual Script in a browser window that appears after you
perform some e-Tester action programmatically.
The Agent appears as a taskbar icon when you create the mint.ProgX
object. The browser window appears when you open a workspace and
playback a Visual Script.
The Agent and browser window automatically close when you clear the
mint.ProgX object variable programmatically.

About Full e-Tester


The full e-Tester is the e-Tester application and user interface. The full
e-Tester appears as a task bar icon when you perform some e-Tester
action programmatically, such as open a workspace and play back a Visual
Script.
You can use the Quit method of RswIProgslib.IProg to close the full
e-Tester application before you clear the Webanlst.ProgT object variable
and close your custom application.

286

e-Tester User Guide

Appendix A

Internet Status Codes

Server Status Codes


The following are the numeric codes that may be returned as Internet
Status and error codes in the e-Load Autopilot and the e-Tester Resource
Validation test.

Information Codes
100

Continue

101

Switching Protocols

The client can continue the request to the server.


The server has changed the application protocol being used on
this connection at the request of the client via the Upgrade
message header field.

Success Codes
200

OK

201

Created

202

Accepted

203

The request completed successfully.

The request has been fulfilled and resulted in the a new


resource being created.
The request has been accepted for processing, but the
processing has not been completed.

NonNon-Authoritative Information

The returned meta information in the entity-header is not the


definitive set as available from the origin server, but is gathered
from a local or a third-party copy.

287

Server Status Codes

204

205

206

No Content

The server has fulfilled the request but does not need to return
new information.

Reset Content

The server has fulfilled the request and the client should reset
the document view which caused the request to be sent to allow
the user to initiate another input action.
Partial Content

The server has fulfilled the partial GET request for the
resource.

Redirection Codes
300

Multiple
Multiple Choices

301

Moved Permanently

302

303

The requested resource has been assigned a new permanent


Uniform Resource Identifier (URI) and any future references
to the resource should use one of the returned URIs.
Moved Temporarily

The requested resource resides temporarily under a different


Uniform Resource Identifier (URI).
See Other

The response to the request can be found under a different


Uniform Resource Identifier (URI) and should be retrieved
using a GET method on that resource.

304

Not Modified

305

Use Proxy

306

288

The requested resource corresponds to ambiguous or multiple


choices.

The client requested a resource that has not been modified.


The requested resource must be accessed through the proxy
given by the Location field.

Not Used

Used in a previous version of the HTTP specification but is no


longer used and the code is reserved.

e-Tester User Guide

Server Status Codes

307

Temporary Redirect

The requested resource resides temporarily under a different


Uniform Resource Identifier (URI).

Failure Codes
400

Bad Request

The request could not be understood by the server due to


invalid syntax.
401

Unauthorized

402

Payment Required

403

Forbidden

404

Not Found

405

406

407

The requested resource requires user authentication.


Not implemented. Reserved for future use.
The server understood the request, but is refusing to fulfill it.

The server has not found anything matching the Request-URI


(Uniform Resource Identifier).
Method Not Allowed

The method in the Request-Line is not allowed for the resource


identified by the Request-URI.
Not Acceptable

The response from the request has content characteristics that


are not acceptable to the accept headers sent by the client.

Proxy Authentication Required

The client must first authenticate itself with the proxy.

408

Request TimeTime-out

409

Conflict

410

Gone

The client did not produce a request within server timeout


limit.
The request could not be completed due to a conflict with the
current state of the resource. The user should resolve the
conflict and resubmit the request.

The requested resource is no longer available at the server and


no forwarding address is known.

Appendix A: Internet Status Codes

289

Server Status Codes

411

412

Length Required

The server refuses to accept the request without a defined


Content-Length.

Precondition Failed

The precondition given in one or more of the request-header


fields evaluated False when tested on the server.

413

Request Entity Too Large

414

RequestRequest-URI Too Long

415

416

The server is refusing to process a request because the request


entity is larger than the server is willing or able to process.
The server is refusing to service the request because the
Request-URI is longer than the server is willing to interpret.

Unsupported Media Type

The server is refusing to service the request because the entity


of the request is in a format not supported by the requested
resource for the requested method.
Requested Range Not Satisfiable
A request included a Range request-header field, and none of

the range-specifier values in this field overlap the current extent


of the selected resource, and the request did not include an IfRange request-header field.
417

Expectation Failed

The expectation given in an Expect request-header field could


not be met by this server, or, if the server is a proxy, the server
has unambiguous evidence that the request could not be met by
the next-hop server.

Server Error Codes


500

501

290

Internal Server Error

The server encountered an unexpected condition that


prevented it from fulfilling the request.

Not Implemented
Implemented

The server does not support the functionality required to fulfill


the request.

e-Tester User Guide

Internet Codes

502

503

504

505

Bad Gateway

The server, while acting as a gateway or proxy, received an


invalid response from the upstream server it accessed in
attempting to fulfill the request.

Service Unavailable

The server is currently unable to handle the request due to a


temporary overloading or maintenance of the server.
Gateway TimeTime-out

The server, while acting as a gateway or proxy, did not receive a


time-out while waiting for a response from the upstream server
specified by the URI (e.g. HTTP, FTP, LDAP) or some other
auxiliary server (e.g. DNS) it needed to access in attempting to
complete the request.
HTTP Version not supported

The server does not support, or refuses to support, the HTTP


protocol version that was used in the request message.

Internet Codes
Internet Error Codes
12001

Out of Handles

12002

Timeout

12003

Extended Error

12004

Internal Error

12005

Invalid URL

12006

Unrecognized Scheme

No more Internet handles could be generated at this time.

The request has timed out.


An extended error was returned from the server. This is
typically a string or buffer containing a verbose error message.

An internal error has occurred.


The Uniform Resource Locator (URL) is invalid.

The Uniform Resource Locator (URL) scheme could not be


recognized or is not supported.

Appendix A: Internet Status Codes

291

Internet Codes

12007

Name Not Resolved

12008

Protocol Not Found

12009

Invalid Option
A request to InternetQueryOption or InternetSetOption specified

The server name could not be resolved.

The requested protocol could not be located.

an invalid option value.


12010

Bad Option Length

12011

Option Not Settable

12012

Shutdown

12013

Incorrect User Name

12014

12015

292

The length of an option supplied to InternetQueryOption or


InternetSetOption is incorrect for the type of option specified.
The request option cannot be set, only queried.

The Win32 Internet function support is being shut down or


unloaded.
The request to connect and log on to an FTP server could not
be completed because the supplied user name is incorrect.

Incorrect Password

The request to connect and log on to an FTP server could not


be completed because the supplied password is incorrect.
Login Failure

The request to connect to and log on to an FTP server failed.

12016

Invalid Operation

12017

Operation Canceled

12018

Incorrect Handle Type

12019

Incorrect Handle State

The requested operation is invalid.

The operation was canceled, usually because the handle on


which the request was operating was closed before the operation
completed.
The type of handle supplied is incorrect for this operation.

The requested operation cannot be carried out because the


handle supplied is not in the correct state.
e-Tester User Guide

Internet Codes

12020

Not Pro
Proxy
xy Request

12021

Registry Value Not Found

12022

The request cannot be made via a proxy.


A required registry value could not be located.

Bad Registry Parameter

A required registry value was located but is an incorrect type or


has an invalid value.

12023

No Direct Access

12024

No Context

12025

No Callback

12026

Request Pending

12027

Direct network access cannot be made at this time.

An asynchronous request could not be made because a zero


context value was supplied.

An asynchronous request could not be made because a callback


function has not been set.
The required operation could not be completed because one or
more requests are pending.

Incorrect Format

The format of the request is invalid.

12028

Item Not Found

12029

Cannot Connect

12030

Connection Aborted

12031

Connection Reset

12032

Force Retry

12033

Invalid Proxy Request

The requested item could not be located.


The attempt to connect to the server failed.
The connection with the server has been terminated.

The connection with the server has been reset.


Calls for the Win32 Internet function to redo the request.

The request to the proxy was invalid.

Appendix A: Internet Status Codes

293

Internet Codes

12034

Need UI

12035

Not Defined
This error code is not defined in WININET.

12036

Handle Exists

12037

Sec Cert Date Invalid

A user interface or other blocking operation has been


requested.

The request failed because the handle already exists.


SSL certificate date that was received from the server is bad.

The certificate is expired.


12038

Sec Cert CN Invalid

12039

HTTP to HTTPS on Redir

12040

HTTPS to HTTP on Redir

12041

Mixed Security

12042

294

SSL certificate common name (host name field) is incorrect.

The application is moving from a non-SSL (Secure Socket


Layer) to an SSL connection because of a redirect.
The application is moving from an SSL (Secure Socket Layer)
to a non-SSL connection because of a redirect.

Indicates that the content is not entirely secure. Some of the


content being viewed may have come from unsecured servers.

Chg Post is Non Secure

The application is posting and attempting to change multiple


lines of text on a server that is not secure.

12043

Post is Non Secure

12044

Client Auth Cert Needed

The application is posting data to a server that is not secure.

An SSL protected resource on a Web server requires a valid


client certificate.

12045

Invalid CA

12046

Client Auth Not Setup

A server SSL certificate was issued by an unknown or invalid


certificate authority.

Client authorization is not setup up on this computer.


e-Tester User Guide

Internet Codes

12047

Async Thread Failed

12048

Redirect Scheme Change

12049

Dialog Pending

12050

Retry Dialog

12051

Not Defined
This error code is not defined in WININET.

12052

12053

The application could not start an asynchronous thread.

The function could not handle the redirection, because the


scheme changed (for example, HTTP to FTP).

Another thread has a password dialog box in progress.


The dialog box should be retried.

HTTPS to HTTP Submit Redir

The data being submitted to an SSL connection is being


redirected to a non-SSL connection.
Insert CDROM

The request requires a CD-ROM to be inserted in the


CD-ROM drive to locate the resource requested.

FTP API Error Codes


The following are the error codes returned by the Internet API used to
access FTP protocols.
12110

12111

12112

Transfer in Progress

The requested operation cannot be made on the FTP session


handle because an operation is already in progress.
FTP Dropped

The FTP operation was not completed because the session was
aborted.
No Passive Mode

Passive mode is not available on the server.

Gopher API Error Codes


12130

Protocol Error

An error was detected while parsing data returned from the


Gopher server.

Appendix A: Internet Status Codes

295

Internet Codes

12131

Not File

12132

Data Error

12133

End of Data

12134

Invalid Locator

12135

Incorrect Locator Type

12136

Not Gopher Plus

12137

Attribute Not Found

12138

Unknown Locator

The request must be made for a file locator.


An error was detected while receiving data from the Gopher
server.
The end of the data has been reached.

The supplied locator is not valid.

The type of the locator is not correct for this operation.


The requested operation can only be made against a Gopher+
server or with a locator that specifies a Gopher+ operation.

The requested attribute could not be located.


The locator type is unknown.

HTTP API Error Codes

296

12150

Header Not Found

12151

Downlevel Server

12152

Invalid Server Response

12153

Invalid Header

12154

Invalid Query Request

12155

Header Already Exists

The requested header could not be located.


The server did not return any headers.

The server response could not be parsed.

The supplied header is invalid.


The request made for HTTP Query Info is invalid.
The header could not be added because it already exists.

e-Tester User Guide

Internet Codes

12156

Redirect Failed

The redirection failed because either the scheme changed (for


example, HTTP to FTP) or all attempts made to redirect failed
(default is five attempts).

12157

Security Channel Error

12158

Unable to Cache File

12159

TC/PIP not Installed

12160

Not Redirected

12161

Cookie Needs Confirmation

12162

Cookie Declined

12163

Disconnected

12164

Server Unreachable

12165

Proxy Server Unreachable

12166

Bad Auto Proxy Script

12167

Unable to Download Script

12168

Redirect Needs Confirmation

12169

Sec Invalid Cert

The application experienced an internal error loading the SSL


libraries.
The function was unable to cache the file.

The required protocol stack is not loaded and the application


cannot start WinSock.
The HTTP request was not redirected.

The HTTP cookie requires confirmation.


The HTTP cookie was declined by the server.

The Internet connection has been lost.


The Web site or server indicated is unreachable.
The designated proxy server cannot be reached.

There was an error in the automatic proxy configuration script.


The automatic proxy configuration script could not be
downloaded.

The redirection requires user confirmation.


SSL certificate is invalid.

Appendix A: Internet Status Codes

297

Internet Codes

12170

Sec Cert Revoked

12171

Failed Due to Security Check

SSL certificate was revoked.

The function failed due to a security check.

Additional Information
For additional information about HTTP Status Codes and the Win32
Internet API Constants, see the following Web resources:
Section 10 of the Hypertext Transfer Protocol HTTP/1.1
Request for Comments: 2616:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Microsoft MSDN Web Workshop Win32 Internet API Constants:


http://msdn.microsoft.com/workshop/networking/wininet/reference/const
ants/constants.asp

MSDN Knowledge Base article Q193625:


http://support.microsoft.com/support/kb/articles/Q193/6/25.ASP

298

e-Tester User Guide

Appendix B

Programming Reference
This appendix provides a programming reference to the e-Test
Programming Interface (e-PI). The reference contains detailed
information for using the type libraries, and specific objects, methods,
properties, and events provided for programming Test Scriptlets, Custom
VBA tests, External Callout tests, and external program control.

Webanlst.Exe COM Server


Webanlst.Exe is the application that contains the events, methods, and

properties available for accessing the full e-Tester application from an


external program. Webanlst.Exe contains the following classes:
ProgT
RswEobj
Webanlst.Exe is installed and registered by the e-TEST suite setup
procedure in the RSW installation directory (C:\Empirix\eTEST is the

default). The following section lists the available properties, methods, and
events for each class.

299

Webanlst.Exe COM Server

ProgT Class
The following table lists the properties and events of the ProgT class of
Webanlst.Exe.

300

Property/Event

Description

Gen

Property of the IProg class of the


RswIprogs type library.

IterationsBegin

The begin VisualScript playback


iteration event.

IterationsEnd

The end VisualScript playback iteration


event.

Om

Property of the IProgOM class of the


RswIprogs type library.

PageBegin

The begin VisualScript page playback


event.

PageEnd

The end playback of Visual Script page


event.

Play

Property of the IProgPlay class of the


RswIprogs type library.

PlaySuspended

The Visual Script playback suspended


event.

ScriptBegin

The Visual Script playback begin event.

ScriptEnd

The Visual Script playback end event.

TransitionEnd

The Visual Script page transition end


event.

e-Tester User Guide

Webanlst.Exe COM Server

RswEobj Class
The following table lists the methods of the RswEobj class of Webanlst.Exe
and RswMint.Exe.
Method/Property

Description

ErrDescription

Specifies an error description to pass to


e-Tester.

ErrNumber

Sets an error number to pass to e-Tester


or gets an error number from e-Tester.

FindInHtml

Finds the specified text string in the


HTML source.

Gen

Property of the IProg class of the


RswIprogs type library.

GetCurrentVuId

Gets the current Virtual User ID.

GetDataBankValue

Returns the current Data Bank value


from the specified field name.

GetDocuments

Gets a collection HTML documents


from all open browser windows.

GetHtml

Returns the HTML source of the


<BODY> tags (inclusive) of the page in

the Browser.
GetOriginalHtml

Returns the complete HTML source of


the current page in the Browser.

GetParameters

Gets the parameters of the current page


of the Visual Script as two collections.

IterationCount

Gets the playback iteration number.

LastDialogText

Returns the text from the last displayed


dialog box.

LastDialogTitle

Returns the title from the last displayed


dialog box.

Appendix B: Programming Reference

301

Webanlst.Exe COM Server

302

Method/Property

Description

MatchPattern

Matches a string pattern in the HTML


source of the specified frame.

Nav

Property of the IProgNav class of the


RswIprogs type library.

Om

Property of the IProgOM class of the


RswIprogs type library.

PageUid

Returns the Page ID passed in from the


External Callout Properties dialog box.

Play

Property of the IProgPlay class of the


RswIprogs type library.

Postdata

Returns the post data of the current page.

ScriptName

Returns name of the current Visual


Script.

SetBehaviour

Excludes testing of specific resources


while running e-Load Virtual Users
based upon URL patterns.

SetDataBankValue

Sets the value of an internal Visual Script


variable defined in the Data Bank Wizard.

TestLog

Writes to the e-Tester Results Log pane.

Url

Returns the URL of the current page in


the Visual Script.

e-Tester User Guide

RSWMint.Exe COM Server

RSWMint.Exe COM Server


RswMint.Exe is the application that contains the events, methods, and

properties available for accessing the e-Tester Minimum Tester (mint)


from an external program. RswMint.Exe contains the following classes:
ProgX
RswEobj
RswMint.Exe is installed and registered by the e-Test suite setup
procedure. The RswMint.Exe is installed in the RSW installation directory
(C:\Empirix\eTEST is the default). The following section lists the available

properties and methods for each class.

ProgX Class
The following table lists the properties and events of the ProgX class of
RSWMint.Exe.
Property/Event

Description

Gen

Property of the IProg class of the


RswIprogs type library.

Om

Property of the IProgOM class of the


RswIprogs type library.

PageBegin

The begin VisualScript page playback


event.

PageEnd

The end playback of Visual Script page


event.

Play

Property of the IProgPlay class of the


RswIprogs type library.

PlaySuspended

The Visual Script playback suspended


event.

ScriptEnd

The Visual Script playback end event.

TransitionEnd

The Visual Script page transition end


event.

Appendix B: Programming Reference

303

RswIProgs Type Library

RswEobj Class
The properties and methods are the same as listed for the RswEobj class
of WebAnlst.exe.

RswIProgs Type Library


The RswIprogs type library is the interface to the methods and properties
available for Test Scriptlets, External Callout tests, and External program
control. The type library contains the following classes:
Iprog
IProgAction
IProgNav
IProgOM
IProgPlay
RswIProgsLib.dll is installed and registered by the e-Test suite setup
procedure. The RswIProgsLib.dll is installed in the default installation
directory (C:\Empirix\eTEST is the default). The following sections list the

available properties and methods for each class.

IProg Class
The following table lists the methods of the IProg class of the RswIprogs
Type Library.

304

Method

Description

Back

Navigates back one page in the Browser


history.

GetCookies

Gets the value of the cookie for the


specified URL.

Halt

Stops navigation in all Browser windows.

MatchHtml

Locates a string pattern within the HTML


source of the specified page or frame.

Navigate

Navigates to the specified URL and frame


with optional post data and headers.
e-Tester User Guide

RswIProgs Type Library

Method

Description

Quit

Close the full e-Tester application from


external program control.

SetCookies

Sets a cookie value for a specified URL.

StateOf

Checks the current state of e-Tester.

IProgAction Class
The following table lists the properties of the IprogAction class of the
RswIprogs Type Library.
Property

Description

Cancel

Cancels the current DHTML or JAVA


action on a page in the Visual Script.

EventClass

Specifies the class type for an event on a


Web page.

EventElem

Specifies the HTML element property to


use for the BeforeAction event.

EventType

Gets the type of event that occurred on


the Web page to use for the
BeforeAction event.

Index

Gets the index of an action that occurred


on the Web page to use for the
BeforeAction event.

Appendix B: Programming Reference

305

RswIProgs Type Library

IProgNav Class
The following table lists the methods and properties of the IProgNav class of
the RswIprogs Type Library.
Method/Property

Description

ChangeNavigation

Changes the navigation recorded by the


Visual Script to a new URL and frame
with optional post data and headers.

EventContext

Gets the value of the event index and


name properties.

GetParameterValues

Gets the parameters of the current page


of the Visual Script as two collections.

GetRecordedPostdata

Gets the post data of the current page of


the Visual Script.

GetRecordedUrl

Gets the recorded URL of the current


page of the Visual Script.

SetParameterValues

Sets the parameters of the current page of


the Visual Script.

TimeToNavigate

Gets the amount of time it took for the


current page to navigate.

IProgOM Class
The following table lists the methods of the IProgOM class of the RswIprogs
Type Library.

306

Method

Description
Description

FindDoc

Finds an HTML document object by


name, title, URL, or parent document.

FindElement

Finds an HTML element object in the


current Visual Script page by property,
tag name, element range, or root element.
e-Tester User Guide

RswIProgs Type Library

Method

Description

FindElements

Finds one or more HTML elements in


the current Visual Script page by
property, tag name, element range, or
root element.

FindElementValue

Finds an HTML element value in the


current Visual Script page by property,
tag name, element range, or root element.

FireEvent

Fires an in line JavaScript event handler


on the specified HTML element object.

GetElementByPath

Gets an HTML document element by


the Document Object Model path.

GetTopDocument

Gets the Object Model for the top-level


document of a Visual Script page.

GetTopDocuments

Gets an array of all top documents from


multiple open browser windows.

IProgPlay Class
The following table lists the methods and properties of the IProgPlay class of
the RswIprogs Type Library.
Method/Property
Method/Property

Description

AmIWAPScript

Determines if the current Visual Script is


a Wireless Application Protocol (WAP)
script.

ChangeCurrentPage

Changes the current page in the Visual


Script and plays back the specified page.

CurrentPageNumber

Gets the number of the current page of


the Visual Script.

DoPage

Plays back the specified page of the


Visual Script and then stops.

Appendix B: Programming Reference

307

RswIProgs Type Library

308

Method/Property
Method/Property

Description

DoRV

Runs the Resource Validation test for the


specified Visual Script.

DoScript

Plays back the specified pages of the


Visual Script and then stops.

GetDataBank

Gets the field names and values from the


Data Bank.

GetDataBankSize

Gets the number of records in the Data


Bank.

GetDataBankValue

Gets the value of the specified Data Bank


field name from the current Visual Script.

GotoPage

Changes the current page number of the


Visual Script.

HasCustomTests

Determines if a Visual Script includes


custom tests.

InsertNav

Inserts programmatic playback between


current page playback.

IterateScript

Plays back a Visual Script with iterations.

Length

Gets the number of pages in the current


Visual Script.

Nav

Property of the IProgNav class.

OpenScript

Opens the specified Visual Script.

OpenWorkspace

Opens the specified Workspace.

ReplaceNav

Replaces current page playback with


programmatic playback.

SaveScript

Saves the Visual Script using the


specified script name.

SetCurrentDataBank
Record

Sets the Data Bank record number.

e-Tester User Guide

RswIProgs Type Library

Method/Property
Method/Property

Description

SetDataBankValue

Sets the value of the specified Data Bank


field from the current Visual Script.

SetOptions

Sets programmable playback options.

Playback Results Constants


The following table lists the playback outcome constants of the RswIprogs
Type Library.
#

Literal

-1

PLAYOUTCOME_UNKNOWN

PLAYOUTCOME_FINE

PLAYOUTCOME_TIMEDOUT

PLAYOUTCOME_STOPPED_WB_INTERACTION

PLAYOUTCOME_STOPPED_BY_USER

PLAYOUTCOME_END_OF_AUTOPLAY

PLAYOUTCOME_END_OF_MANUALPLAY

PLAYOUTCOME_STOPPED_BY_SHELL

PLAYOUTCOME_STOPPED_BY_SHELL_USER

PLAYOUTCOME_STOP_ONERR

PLAYOUTCOME_EXCEPTION

10

PLAYOUTCOME_XPRESSED_VARS_FAILED

11

PLAYOUTCOME_SUSPENSION_ABORTED

12

PLAYOUTCOME_IE_DIALOG

13

PLAYOUTCOME_NAVIGATION_FAILED

14

PLAYOUTCOME_FAILED_TESTS

Appendix B: Programming Reference

309

RswIProgs Type Library

Literal

15

PLAYOUTCOME_IEI_NOT_FOUND

16

PLAYOUTCOME_SECURITY_PROBLEM

17

PLAYOUTCOME_IGNORABLE_END

18

PLAYOUTCOME_PAGE_CHANGED

Error Constants
The following table lists the error constants of the RswIprogs Type Library.

310

Literal

&H80040000

PROGERR_OK

&H80040001

PROGERR_TIMEOUT

&H80040002

PROGERR_FAILED_CONTENT_TESTS

&H80040003

PROGERR_FAILED_RESOURCE_VALIDATION

&H80040004

PROGERR_SHELL_FAILED_COMMAND

&H80040005

PROGERR_SHELL_BAD_SYNTAX

&H80040006

PROGERR_UNEXPECTED_IE_DIALOG_BOXES

&H80040007

PROGERR_INTERNAL_ERROR

&H80040008

PROGERR_PLAYOUTCOME_BROWSER_NOT_FOUND

&H80040009

PROGERR_PLAYOUTCOME_XPRESSED_VARS_FAILED

&H8004000A

PROGERR_PLAYOUTCOME_NAVIGATION_FAILED

&H8004000B

PROGERR_USER

e-Tester User Guide

VBADLL Type Library

Status Constants
The following table lists the status constants of the RswIprogs Type Library.
#

Literal

ET_IDLE

ET_NAVIGATING

ET_PLAYING_PAGE

ET_PLAYING_SCRIPT

VBADLL Type Library


The VBADLL type library is the interface to the methods, properties and
events available for Custom VBA tests in e-Tester. The type library
contains the following classes:
RSWApp
RSWAppOm
RSWVBAPage
RSWVBAScript
RSWVBATest
VBAGLobalObject
VBADLL.dll is installed and registered by the e-Test suite setup procedure.
The VBADLL.dll is installed in the default installation directory
(C:\Empirix\eTEST is the default). The following sections list the available
methods, properties, and events for each class.

Appendix B: Programming Reference

311

VBADLL Type Library

RSWApp Class
The following table lists the methods and properties of the RSWApp class of the
VBADLL Type Library.

312

Method/Property

Description

ChangeNavigation

Changes the navigation recorded by the


Visual Script to a new URL and frame
with optional post data and headers.

CurrentPageNumber

Gets the number of the current page of


the Visual Script.

ExecutingProduct

Gets which product is currently running.

FindInHtml

Finds the specified text string in the


HTML source.

GetCookies

Gets the value of the cookie for the


specified URL.

GetDataBankValue

Gets the value of the specified Data Bank


field name from the current Visual Script.

GetHtml

Returns the HTML source of the


<BODY> tags (inclusive) of the page in
the Browser.

GetParameterValues

Gets the parameters of the current page


of the Visual Script as two collections.

GetRecordedPostdata

Gets the post data of the current page of


the Visual Script.

GetRecordedUrl

Gets the recorded URL of the current


page of the Visual Script.

GoBack

Navigates back one page in the Browser


history.

GotoPage

Changes the current page number of the


Visual Script.
e-Tester User Guide

VBADLL Type Library

Method/Property

Description

InsertNav

Inserts programmatic playback between


current page playback.

LastDialogtext

Returns the text from the last displayed


dialog box.

LastDialogTitle

Returns the title from the last displayed


dialog box.

MatchHtml

Locates a string pattern within the HTML


source of the specified page or frame.

Navigate

Navigates to the specified URL and frame


with optional post data and headers.

Om

Property of the RSWAppOM class of the


VBADLL type library.

ReplaceNav

Replaces current page playback with


programmatic playback.

ScriptLength

Returns he number of pages in the Visual


Script.

SetCookies

Sets a cookie value for a specified URL.

SetDataBankValue

Sets the value of the specified Data Bank


field from the current Visual Script.

SetParameterValues

Sets the parameters of the current page of


the Visual Script.

TimeToNavigate

Gets the amount of time to navigate


between pages.

WriteToLog

Writes to the e-Tester Results Log pane.

Appendix B: Programming Reference

313

VBADLL Type Library

RSWAppOM Class
The following table lists the methods of the RSWAppOM class of the VBADLL
Type Library.

314

Method

Description

FindDoc

Finds an HTML document object by


name, title, URL, or parent document.

FindElement

Finds an HTML element object in the


current Visual Script page by property,
tag name, element range, or root element.

FindElements

Finds one or more HTML elements in


the current Visual Script page by
property, tag name, element range, or
root element.

FindElementValue

Finds an HTML element value in the


current Visual Script page by property,
tag name, element range, or root element.

FireEvent

Fires an in line JavaScript event handler


on the specified HTML element object.

GetElementByPath

Gets an HTML document element by


the Document Object Model path.

GetTopDocument

Gets the Object Model for the top-level


document of a Visual Script page.

GetTopDocuments

Gets an array of all top documents from


multiple open browser windows.

e-Tester User Guide

VBADLL Type Library

RSWVBAPage Class
The following table lists the events and properties of the RSWVBAPage class of
the VBADLL Type Library.
Property/Event

Description

AfterPlay

Executes custom Visual Basic code after


playback of a Visual Script page.

BeforeAction

Executes custom Visual Basic code before


an action occurs on a Visual Script page.

BeforePlay

Executes custom Visual Basic code before


playback of a Visual Script page.

ErrDescription

Specifies an error description to pass to


e-Tester.

ErrNumber

Sets an error number to pass to e-Tester


or gets an error number from e-Tester.

RSWApp

Property reference to the RSWApp class of


the VBADLL type library.

RSWVBAScript Class
The following table lists the events and properties of the RSWVBAScript class
of the VBADLL Type Library.
Property/Event

Description

EndPlay

Executes custom Visual Basic code after


the end of Visual Script playback.

ErrDescription

Specifies an error description to pass to


e-Tester.

ErrNumber

Sets an error number to pass to e-Tester


or gets an error number from e-Tester.

RSWApp

Property reference to the RSWApp class of


the VBADLL type library.

Appendix B: Programming Reference

315

VBADLL Type Library

Property/Event

Description

ScriptClose

Executes custom Visual Basic code after


closing a Visual Script.

ScriptOpen

Executes custom Visual Basic code upon


opening a Visual Script.

ScriptRename

Executes custom Visual Basic code upon


renaming a Visual Script.

ScriptSave

Executes custom Visual Basic code upon


saving a Visual Script.

StartPlay

Executes custom Visual Basic code


before starting Visual Script playback.

RSWVBATest Class
The following table lists the events and properties of the RSWVBATest class of
the VBADLL Type Library.

316

Property/Event
Property/Event

Description

ErrDescription

Specifies an error description to pass to


e-Tester.

ErrNumber

Sets an error number to pass to e-Tester


or gets an error number from e-Tester.

PerformTest

Executes code for Custom VBA tests.

RSWApp

Property reference to the RSWApp class of


the VBADLL type library.

e-Tester User Guide

VBADLL Type Library

VBAGlobalObject Class
The following table lists the methods of the VBAGlobalObject class of the
VBADLL Type Library.
Method

Description

DoRegExpMatch

Performs a Regular Expression


comparison between recorded text or a
property value and the current Web page
on playback.

Product Constants
The following table lists the constants of the VBADLL Type Library.
#

Literal

PRODUCT_TESTER

PRODUCT_THICK

PRODUCT_THIN

Appendix B: Programming Reference

317

AfterPlay Event

AfterPlay Event
Purpose

Executes custom Visual Basic code after playback of a Visual Script


page.

Syntax

object_AfterPlay()
Parameter
object

Description

An object. The following object is valid:


E RSWVBAPage used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAPage

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

AfterPlay event is used to run custom page tests for Visual Script

pages. You enter the code in the Visual Basic for Applications
environment using the e-Tester Custom Page Programmability node.
The AfterPlay event executes any code in the procedure after
playback of the Visual Script page.
e-Tester automatically creates the RSWVBAPage object and AfterPlay
event for each Visual Script page in the Visual Basic environment. You
can add your own custom code to the event procedure.
The afterPlay event procedure is the equivalent of a Test Scriptlet
After test and the AfterPagePlay method in External Callout tests.
Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_afterPlay()
'execute custom code after playback of the
'Visual Script
Dim pagenum as Long
pagenum = RSWApp.CurrentPageNumber
RSWApp.WriteToLog "After Page, "", Cstr(pagenum)
End Sub

See Also

318

BeforePlay, BeforeAction, RSWApp

e-Tester User Guide

AmIWAPScript Method

AmIWAPScript Method
Purpose

Determines if the current Visual Script is a Wireless Application


Protocol (WAP) script.

Syntax

object.property.AmIWAPScript
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.

Member of

RswIprogs.IProgPlay

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if the Visual Script is a WAP script, otherwise False.

Example 1

'Test Scriptlets and External Callout Tests


Dim resultb
resultb = rswObject.play.amIWAPScript
Call rswOject.TestLog(,,Is WAP? " + Cstr(resultb))

Appendix B: Programming Reference

319

Back Method

Example 2

Option Explicit
'External Program Control
'Minimum Tester
'VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreateandStart_Click()
Dim resultb
Set m_tester = New mint.progX
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
resultb = m_tester.play.amIWAPScript
End Sub

See Also

Back, GoBack, GotoPage

Back Method
Purpose

Navigates back one page in the Browser history.

Syntax

object.property.back()
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

Member of
320

A reference to the gen property of rswEObj,


ProgT, and ProgX. The gen property is
required for Test Scriptlets, External Callout
tests, and External Program control.

RswIprogs.IProg

e-Tester User Guide

Back Method

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.


webanlst.ProgT is the object for the full e-Tester application and
user interface. mint.ProgX is the object for the e-Tester Thick Client

agent.
Example 1

'Test Scriptlets and External Callout Tests


Dim resultb
resultb = rswObject.gen.back()

Example 2

Option Explicit
'External Program Control
'Minimum Tester
'VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
'Full Tester
'VB Project>References = RSW e-Tester 4.0
'(Webanlst.exe)
Dim WithEvents f_tester As webanlst.ProgT
Private Sub cmdCreateandStart_Click()
Dim resultb
Set m_tester = New mint.progX
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
resultb = m_tester.gen.back()
End Sub

See Also

ChangeCurrentPage, GoBack, GotoPage

Appendix B: Programming Reference

321

BeforeAction Event

BeforeAction Event
Purpose

Executes custom Visual Basic code before an action occurs on a Visual


Script page.

Syntax

object_BeforeAction(ByVal actionObj As
RswIprogs.IProgAction)
Parameter
object

Description

An object. The following object is valid:


E RSWVBAPage used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAPage

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The BeforeAction event is used to run custom tests for form actions
on Web pages in Visual Script. Actions on Web pages in Visual
Scripts are listed in the Address node Properties. You can use the
BeforeAction event and the actionObj properties to access
elements on which user actions occurred.
You enter the code in the Visual Basic for Applications environment
using the e-Tester Custom Page Programmability node. The
BeforeAction event executes any code in the procedure before each
form action (e.g. mouse click) occurs on a Web page in a Visual
Script.
e-Tester automatically creates the RSWVBAPage object and
BeforeAction event for each Visual Script page in the Visual Basic
environment. You can add your own custom code to the event
procedure.

322

e-Tester User Guide

BeforeAction Event

Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_beforeAction(ByVal actionObj
As RswIprogs.IProgAction)
Dim
Dim
Dim
Dim
Dim

actIndex As Long
actEvntType As String
actEventElem As String
actElemType As String
SubmitButton As Object

'Get the action index


actIndex = actionObj.index
'Get the event type - i.e. "click"
actEvntType = actionObj.eventType
'Get the element tag name
actEventElem = actionObj.eventElem.tagName
'If the tag is an INPUT tag
' get the type (i.e "text" or "submit")
If actEventElem = "INPUT" Then
actElemType = actionObj.eventElem.Type
End If
'If the action is a Submit click
If (actionObj.eventType = "click") And _
(actElemType = "submit") Then
'Cancel the Submit click
actionObj.cancel = True
'Do something programmatically before
'the Submit click
'Now get the Submit button element
Set SubmitButton = RSWApp.om.FindElement("submit", _
"INPUT", "type")
'Now click Submit
SubmitButton.click
End If
End Sub

See Also

AfterPlay, BeforePlay, RSWApp

Appendix B: Programming Reference

323

BeforePlay Event

BeforePlay Event
Purpose

Executes Visual Basic code before playback of a Visual Script page.

Syntax

object_BeforePlay()
Parameter
object

Description

An object. The following object is valid:


E RSWVBAPage used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAPage

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

BeforePlay event is used to run custom page tests for Visual Script

pages. You enter the code in the Visual Basic for Applications
environment using the e-Tester Custom Page Programmability node.
The BeforePlay event executes any code in the procedure before
playback of the Visual Script page.

e-Tester automatically creates the RSWVBAPage object and BeforePlay


event for each Visual Script page in the Visual Basic environment. You
can add your own custom code to the event procedure.
The BeforePlay event procedure is the equivalent of a Test Scriptlet
Before test and the BeforePagePlay method in External Callout tests.
Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_beforePlay()
'execute custom code before playback of the
'Visual Script
Dim pagenum as Long
pagenum = RSWApp.CurrentPageNumber
RSWApp.WriteToLog "Before Page", "", Cstr(pagenum)
End Sub

See Also

324

AfterPlay, BeforeAction, RSWApp

e-Tester User Guide

Cancel Property

Cancel Property
Purpose

Cancels the current DHTML or JAVA action on a page in the Visual


Script.

Syntax

object.cancel
Parameter
object

Description

An object. The following object is valid:


E actionObj used with the
beforeAction event of Custom VBA
page tests.

Member of

RswIprogs.IProgAction

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The Cancel property is used to cancel user actions that occurred


during recording of Web pages to the Visual Script. Actions on Web
pages in Visual Scripts are listed in the Address node Properties. You
can use the Cancel property to cancel the recorded action and insert
additional programmatic tests or actions.
The e-Tester BeforeAction event automatically defines the
actionObj object.

Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_beforeAction(ByVal actionObj
As RswIprogs.IProgAction)
Dim
Dim
Dim
Dim
Dim

actIndex As Long
actEvntType As String
actEventElem As String
actElemType As String
SubmitButton As Object

'Get the action index


actIndex = actionObj.index
'Get the event type - i.e. "click"
actEvntType = actionObj.eventType

Appendix B: Programming Reference

325

Cancel Property

Example
(cont'd)

'Get the element tag name


actEventElem = actionObj.eventElem.tagName
'If the tag is an INPUT tag
' get the type (i.e "text" or "submit")
If actEventElem = "INPUT" Then
actElemType = actionObj.eventElem.Type
End If
'If the action is a Submit click
If (actionObj.eventType = "click") And _
(actElemType = "submit") Then
'Cancel the Submit click
actionObj.cancel = True
'Do something programmatically before
'the Submit click
'Now get the Submit button element
Set SubmitButton = RSWApp.om.FindElement("submit", _
"INPUT", "type")
'Now click Submit
SubmitButton.click
End If
End Sub

See Also

326

BeforeAction, Cancel, EventClass, EventElem, EventType,


Index

e-Tester User Guide

ChangeCurrentPage Method

ChangeCurrentPage Method
Purpose

Changes the current page in the Visual Script and plays back the
specified page.

Syntax

object.property.changeCurrentPage(newpageId)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

newpageId

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
A variant that specifies the ID number of the
Visual Script page to make the new current
page in the browser.

Member of

RswIprogs.IProgPlay

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Appendix B: Programming Reference

327

ChangeCurrentPage Method

Example 1

'Test Scriptlets and External Callout Tests


Dim resultb
resultb = rswObject.play.changeCurrentPage(2)

Example 2

Option Explicit
'External Program Control
'Minimum Tester
'VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreateandStart_Click()
Dim resultb
Set m_tester = New mint.progX
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
resultb = m_tester.play.changeCurrentPage(2)
End Sub

See Also

328
328

Back, GoBack, GotoPage

e-Tester User Guide

ChangeNavigation Method

ChangeNavigation Method
Purpose

Changes the navigation associated with the current Visual Script page.

Syntax

object.property.ChangeNavigation(target$,url$,
[postdata$], [headers$])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.

property

target$

url$
postdata$

headers$

A reference to the play.Nav properties of


rswObject. The play.Nav properties are
required for Test Scriptlets and External
Callout tests.
property is not used with Custom VBA tests.
A string that specifies the name of the target
frame in the current page in which the
navigation will take place.
A string that specifies the destination URL.
Optional. A string that specifies an
unencoded data string to be posted to the
server in the form:
name1=value1&name2=value2, etc.
Optional. A string that specifies any additional
HTTP headers to send to the server.

Member of

RswIprogs.IprogNav, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Appendix B: Programming Reference

329

ChangeNavigation Method

Remarks

Returns True if successful, otherwise False.


Use this method to change the page flow of Visual Script playback
based upon some condition detected in the Test Scriptlet, Custom
VBA test, or External Callout test.
Changing navigation is only useful in a Test Scriptlet Before, Custom
VBA beforePlay page event, or the External Callout beforePagePlay
method. A Test Scriptlet After, Custom VBA afterPlay page event,
and the External Callout afterPagePlay method are called after the
page navigation occurs.

Example 1

'Test Scriptlets and External Callout


Dim RecordedUrl
Dim NewUrl
Dim OldUrl
Dim resultb
RecordedUrl = rswObject.url
NewUrl = "C:\Empirix\eTEST\RSWDemo\Register.htm"
OldUrl = "C:\Empirix\eTEST\RSWDemo\Kitchen.htm"
If RecordedUrl = NewUrl Then
rswObject.play.nav.ChangeNavigation "", OldUrl,"",""
Else
rswObject.play.nav.ChangeNavigation "", NewUrl,"",""
End If

Example 2

'Custom VBA tests


Private Sub RSWVBAPage_beforePlay()
Dim RecordedUrl As String
Dim NewUrl As String
Dim OldUrl As String
Dim resultb As Boolean
resultb = RSWApp.GetRecordedUrl(RecordedUrl)
NewUrl = "C:\Empirix\eTEST\RSWDemo\Register.htm"
OldUrl = "C:\Empirix\eTEST\RSWDemo\Kitchen.htm"
If RecordedUrl = NewUrl Then
resultb = RSWApp.ChangeNavigation("", OldUrl, "", "")
Else
resultb = RSWApp.ChangeNavigation("", NewUrl, "", "")
End If
End Sub

See Also
330

GetDataBankValue, PostData
e-Tester User Guide

ChangeNavigation Method

ChangeNavigation Method
Purpose

This method is obsolete and should no longer be used. It is still


supported to maintain backward compatibility with existing External
Callout tests.

Member of

Webanlst.RswEobj, mint.RswEobj

CurrentPageNumber Property
Purpose

The current page number property of a Visual Script.

Syntax

object.property.currentPageNumber
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.

Member of

RswIprogs.IprogPlay, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Appendix B: Programming Reference

331

CurrentPageNumber Property

Remarks

Returns a Long representing the page number of the Visual Script.

Example 1

'Test Scriptlets and External Callout Tests


Dim pageNum
pageNum = rswObject.play.currentPageNumber

Example 2

'Custom VBA Tests


Dim pageNum as Long
pageNum = RSWApp.currentPageNumber

Example 3

Option Explicit
'External Program Control
'Minimum Tester
'VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
'Full Tester
'VB Project>References = RSW e-Tester 4.0
'(Webanlst.exe)
'Dim WithEvents f_tester As webanlst.ProgT
Private Sub cmdCreateandStart_Click()
Dim pagenum As Long
Set m_tester = New mint.progX
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
pagenum = m_tester.play.currentPageNumber
List1.AddItem "Current Page: " + pagenum
End Sub

See Also

332

None

e-Tester User Guide

DoPage Method

DoPage Method
Purpose

Plays back the specified page of the Visual Script and then stops.

Syntax

object.property.doPage(pageId)
Parameter
object

Description

property

A reference to the play property of


mint.ProgX and webanlst.ProgT objects.
The play property is required for External
Program control.
A variant that specifies the page number.

pageId

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IProgPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Test


# External Program

Applies To

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.


webanlst.ProgT is the object for the full e-Tester application and user
interface. mint.ProgX is the object for the e-Tester Thick Client agent.

Example

Option Explicit
'External Program Control
'Minimum Tester
'VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
'Full Tester
'VB Project>References = RSW e-Tester 4.0
'(Webanlst.exe)
'Dim WithEvents f_tester As webanlst.ProgT

Appendix B: Programming Reference

333

DoRegExpMatch Method

Example
(cont'd)

Private Sub cmdCreate_Click()


Set m_tester = New mint.ProgX
End Sub
Private Sub cmdStart_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doPage(3)
End Sub
Private Sub cmdDestroy_Click()
Set m_tester = Nothing
End Sub

See Also

DoRV, DoScript

DoRegExpMatch Method
Purpose

Performs a Regular Expression comparison between recorded text or


a property value and the current Web page on playback.

Syntax

DoRegExpMatch(testString$,testPattern$)
Parameter
testString$

Description

testPattern$

The Regular Expression pattern to use for


the comparison.

The text or property value to compare.

Member of

VBADLL.VBAGlobalObject

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Example

'Custom VBA Page Tests


Private Sub RSWVBATest_performTest()
On Error GoTo ERRLBL
Dim element As HTMLInputElement
Dim valueStr As String
RSWApp.om.GetElementByPath
"window[1].input(name='TodaysDate')[1]", element

334

e-Tester User Guide

DoRV Method

Example
(cont'd)

If element Is Nothing Then


errDescription = "html object not found!"
errNumber = -1
Exit Sub
End If
valueStr = element.defaultValue
If Not DoRegExpMatch(valueStr, "\d+/\d+/\d+") Then
errDescription = "string comparison failure!"
errNumber = -1
Exit Sub
End If
errDescription = ""
errNumber = 0
Exit Sub
ERRLBL:
errDescription = Err.Description
errNumber = Err.Number
End Sub

See Also

GetElementByPath, PerformTest

DoRV Method
Purpose

Runs the Resource Validation test for the specified Visual Script.

Syntax

object.property.doRV(results, [scriptname$],
[workspace$])
Parameter
object

Description

property

A reference to the play property of


mint.ProgX and webanlst.ProgT objects.
The play property is required for External
Program control.

Appendix B: Programming Reference

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

335

DoRV Method

Parameter
results
scriptname$
workspace$

Description

An array that stores the Resource Validation


results.
Optional. A string that specifies the Visual
Script name.
Optional. A string that specifies the
workspace name.

Member of

RswIprogs.IProgPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.


results is an array of arrays. Each Resource Validation item in the
results array is an array with the following string values: Host,
Resource Path, Current Status, Error Description, Resource Handle,
Internet Status Code, Statistics and Wininet Error Code.
DoRV is only used with the ScriptEnd event.

Example

Option Explicit
'External Program Control
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
'Full Tester
'VB Project>References = RSW e-Tester 4.0
'Webanlst.exe)
'Dim WithEvents f_tester As webanlst.ProgT
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub cmdDestroy_Click()
Set m_tester = Nothing
End Sub
Private Sub Command1_Click()
Dim results()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1", 2, 3
End Sub

336

e-Tester User Guide

DoRV Method

Example
(cont'd)

Private Sub m_tester_ScriptEnd( _


ByVal currentScriptName As String, _
ByVal playOutcomeNumber As Integer, _
ByVal
ByVal
ByVal
ByVal

playOutcomeDescription As String, _
playMostSevereActionSet As Long, _
playMostSevereErrTypeSet As Long, _
playSumOfDurations As Long)

'Set up variables for results


Dim
Dim
Dim
Dim
Dim
Dim
Dim
Dim

rvHost
rvResPath
rvCurStatus
rvErrDesc
rvResHandle
rvIntStatCode
rvStats
rvWininetErr

'Host
'Resource Path
'Current Status
'Error Description
'Resource Handle
'Internet Status Code
'Statistics
'WinInet Error Code

List1.AddItem "**** Start Resource Validation ****"


'Set up variable for Resource Validation array
Dim rvArray, resultb As Boolean
'Run Resource Validation and store results
'in an array of arrays
resultb = m_tester.play.doRV(rvArray, _
"tutor1", "RSWDemo")
'Set up a variable to parse the RV rows
Dim x As Integer
'For each Resource Validation Row
'Get the value of each Resource Validation
For x = LBound(rvArray) To UBound(rvArray)
Dim rvRow
Dim rvCol
rvRow = rvArray(x)
'For each column in the row
'Get the value of each column parameter
For rvCol = 0 To 7
If rvCol = 0 Then
rvHost = rvRow(rvCol)
ElseIf rvCol = 1 Then
rvResPath = rvRow(rvCol)
Appendix B: Programming Reference

337

DoRV Method

ElseIf rvCol = 2 Then


rvCurStatus = rvRow(rvCol)
ElseIf rvCol = 3 Then
rvErrDesc = rvRow(rvCol)
ElseIf rvCol = 4 Then
rvResHandle = rvRow(rvCol)
ElseIf rvCol = 5 Then
rvIntStatCode = rvRow(rvCol)
ElseIf rvCol = 6 Then
rvStats = rvRow(rvCol)
ElseIf rvCol = 7 Then
rvWininetErr = rvRow(rvCol)
End If

Example
(cont'd)

'Get the next column parameter of the


'current Resource Validation row
Next rvCol
'Do Resource error checking for the
'current results here
'Write the results to the log
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem
List1.AddItem

"*** Number: " & x & " ***"


"Host: " & rvHost
"Path: " & rvResPath
"Current Status: " & rvCurStatus
"Error Description: " & rvErrDesc
"Resource Handle: " & rvResHandle
"Internet Status: " & rvIntStatCode
"Statistics: " & rvStats
"WinInet Error: " & rvWininetErr
""

'get the next Resource Validation row


Next x
List1.AddItem "**** End Resource Validation ****"
End Sub

See Also

338

DoScript, ScriptEnd

e-Tester User Guide

DoScript Method

DoScript Method
Purpose

Plays back the specified pages of the Visual Script and then stops.

Syntax

object.property.doScript([scriptname$],
[startPageId,] [finishPageId])
Parameter
object

Description

property

A reference to the play property of


mint.ProgX and webanlst.ProgT objects.
The play property is required for External
Program control.
Optional. A string that specifies the Visual
Script name.
Optional. A variant that specifies the page
number.
Optional. A variant that specifies the page
number.

scriptname$
startPageId
finishPageId

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IProgPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Appendix B: Programming Reference

339

EndPlay Event

Example

Option Explicit
'External Program Control
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
'Full Tester
'VB Project>References = RSW e-Tester 4.0
'(Webanlst.exe)
'Dim WithEvents f_tester As webanlst.ProgT
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub cmdDestroy_Click()
Set m_tester = Nothing
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play openScript "tutor1"
m_tester.play.doScript "tutor1", 2, 3
End Sub

See Also

DoPage, DoRV

EndPlay Event
Purpose

Executes custom Visual Basic code after the end of Visual Script
playback.

Syntax

object_EndPlay()
Parameter
object

Description

An object. The following object is valid:


E RSWVBAScript used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAScript

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

340

e-Tester User Guide

ErrDescription Property

Remarks

The EndPlay event is used to run custom tests for Visual Scripts. You
enter the code in the Visual Basic for Applications environment using the
e-Tester Custom Page Programmability node. The EndPlay event
executes any code in the procedure after the end of Visual Script playback.
The EndPlay event executes only once at the end of Visual Script
playback.
e-Tester automatically creates the RSWVBAScript object and EndPlay
event for the Visual Script in the Visual Basic environment. You can add
your own custom code to the event procedure.

Example

'Custom VBA Script Tests


Private Sub RSWVBAScript_endPlay()
'execute custom code after playback of the
'Visual Script
Dim ScriptLen as String
ScriptLen = Cstr(RSWApp.ScriptLength)
RSWApp.WriteToLog "# Script Pages", "", ScriptLen
End Sub

See Also

RSWApp, StartPlay

ErrDescription Property
Purpose

Defines an error description that returns to e-Tester.

Syntax

object.ErrDescription=description$
Parameter
object

Description

An object variable. The following object is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
object is not used with Custom VBA tests.

description$

Appendix B: Programming Reference

Any error description.

341

ErrDescription Property

Member of

webanlst.rswEobj, mint.rswEobj, VBADLL.RSWVBAPage,


VBADLL.RSWVBAScript, VBADLL.RSWVBATest

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Test


U External Program

Used With

# Thick Client

# Thin Client

Remarks

The description will appear in the Visual Script node and in the
Properties dialog box. The description can also be used to pass back a
test passed description when used with the setting: errNumber=0
(the default).
This property is only useful in VBA tests, a Test Scriptlet After or the
AfterPagePlay method of an External Callout test. A Test Scriptlet
Before and the BeforePagePlay method do not return any values to

e-Tester.
Example 1

'Test Scriptlets and External Callout Tests


Dim submitButton, submitParam
submitParam="submit"
Set submitButton=om.FindElement(submitParam,"INPUT",
"type")
If sumitbutton is Nothing Then
rswObject.ErrDescription="My Error Description"
rswObject.errNumber=123
End If

Example 2

'Custom VBA Tests


Private Sub RSWVBATest_performTest()
On Error GoTo ERRLBL
Dim element As HTMLInputElement
Dim valueStr As String
RSWApp.om.GetElementByPath "window[1].input _
(name='TodaysDate')[1]", element
If element Is Nothing Then
errDescription = "html object not found!"
errNumber = -1
Exit Sub
End If
valueStr = element.defaultValue
If Not DoRegExpMatch(valueStr, "\d+/\d+/\d+") Then
errDescription = "string comparison failure!"
errNumber = -1
Exit Sub
End If

342

e-Tester User Guide

ErrNumber Property

errDescription = ""
errNumber = 0
Exit Sub
ERRLBL:
errDescription = Err.Description
errNumber = Err.Number
End Sub

See Also

ErrNumber

ErrNumber Property
Purpose

Defines an e-Tester error number.

Syntax

object.ErrNumber=number&
Parameter
object

Description

An object variable. The following object is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
object is not used with Custom VBA tests.

number&

A Long. Any user-defined number.

Member of

webanlst.rswEobj, mint.rswEobj, VBADLL.RSWVBAPage,


VBADLL.RSWVBAScript, VBADLL.RSWVBATest

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

This number is used by e-Tester to determine if Test Scriptlets,


Custom VBA tests, and External Callout tests pass or fail. If the
number is anything other than zero (the default), e-Tester considers
the test to have failed on play back and places a red flag on the Visual
Script node.

Appendix B: Programming Reference

343

ErrNumber Property

You can define your own error numbers based upon the logic in your
custom tests. The number is returned to e-Tester and appears in the
Properties dialog box for the Test Scriptlet, VBA test, or External
Callout node. You can define a corresponding description using
ErrDescription.
This property is only useful in VBA tests, a Test Scriptlet After or the
AfterPagePlay method of an External Callout test. A Test Scriptlet
Before and the BeforePagePlay method do not return any values.

Example 1

'Test Scriptlets and External Callout Tests


Dim submitButton, submitParam
submitParam="submit"
Set submitButton=om.FindElement(submitParam,"INPUT",
"type")
If submitbutton is Nothing Then
rswObject.ErrDescription="My Error Description"
rswObject.errNumber=123
End If

Example 2

'Custom VBA Tests


Private Sub RSWVBATest_performTest()
On Error GoTo ERRLBL
Dim element As HTMLInputElement, valueStr As String
RSWApp.om.GetElementByPath "window[1].input _
(name='TodaysDate')[1]", element
If element Is Nothing Then
errDescription = "html object not found!"
errNumber = -1
Exit Sub
End If
valueStr = element.defaultValue
If Not DoRegExpMatch(valueStr, "\d+/\d+/\d+") Then
errDescription = "string comparison failure!"
errNumber = -1
Exit Sub
End If
errDescription = ""
errNumber = 0
Exit Sub
ERRLBL:
errDescription = Err.Description
errNumber = Err.Number
End Sub

See Also
344

ErrDescription
e-Tester User Guide

EventClass Property

EventClass Property
Purpose

Specifies the class type for an event on a Web page.

Syntax

object.EventClass
Parameter
object

Description

An object. The following object is valid:


E actionObj used with the beforeAction
event of Custom VBA page tests.

Member of

RswIprogs.IProgAction

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The EventClass property is used in the BeforeAction event. The


BeforeAction event is used to run custom tests for form actions on Web
pages in Visual Scripts. Actions on Web pages in Visual Scripts are listed
in the Address node properties. The e-Tester BeforeAction event
automatically defines the actionObj object.
The following constants are defined:
0=DHTML_EVENT
1=JAVA_EVENT

Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_beforeAction(ByVal actionObj
As RswIprogs.IProgAction)
Dim actEventClass As Long
'Get the event class: DHTML or Java
actEventClass = actionObj.eventClass
If actEventClass = DHTML_EVENT Then
'If DHTML, handle event here
Else
'Java, handle event here
End If
End Sub

See Also

BeforeAction, Cancel, EventElem, EventType, Index

Appendix B: Programming Reference

345

EventContext Property

EventContext Property
Purpose

Gets the value of an event context using index and name ID.

Syntax

object.property.EventContext([eventIndex&],[nameId&])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

eventIndex&

nameId&

A reference to the play.nav properties of


rswObject. The play.nav properties are
required for Test Scriptlets and External
Callout tests.
Optional. A Long variable that specifies the
zero-based index of the event. The default is
the last event.
Optional. A Long that specifies the zerobased name ID of the event.

Member of

RswIprogs.IProgNav

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Test


# External Program

Used With

# Thick Client

U Thin Client

346

e-Tester User Guide

EventContext Property

Remarks

Returns a string containing the value of the event context. Events are
actions that occur on a page that may or may not cause navigation to
another page. For example, a mouse click is an event that can cause a
page navigation depending upon its context. If the click event is on a
link or image map the click causes a page navigation. If the click event
is in an INPUT field of a form, it does not cause page navigation.
The events correspond to the events recorded in the Address node
properties of the Visual Script. The eventIndex is the zero-based
index of the list of events in the Address node properties. The nameId
is the zero-based index of the object properties within each event. The
following is an example of how form events are represented in the
Address node of the Visual Script:
(click +window(0).form("theForm"|0).element("firstName"|1)
(click +window(0).form("theForm"|0).element("lastName"|2)
(click +window(0).form("theForm"|0).element(type="submit"|6)

The firstName click event is eventIndex=0. The lastName


click event is eventIndex=1. The submit event is eventIndex=2.
The nameId corresponds to the context of the properties within each
event. The window(0) context is nameId=0. The theForm context
is nameId=1. The firstname context is nameId=2.
Within the Document Object Model of the Web page, the event objects
show the zero-based index of each property within the document. For
example, window(0) is the top level window, form("theform"|0) is
the first form in the window, and the element("firstname"|1) is the
second element within the first form.
Example

'Test Scriptlets and External Callout Tests


Dim evContext, evIndex, nameId
evIndex=0 'specify which event index
nameId=1 'specify which property
evContext=rswObject.play.nav.eventContext(evIndex,
nameId)

See Also

None

Appendix B: Programming Reference

347

EventElem Property

EventElem Property
Purpose

Specifies the HTML element property to use for the BeforeAction


event.

Syntax

object.EventElem.property
Parameter
object

Description

property

An object property.

An object. The following object is valid:


E actionObj used with the beforeAction
event of Custom VBA page tests.

Member of

RswIprogs.IProgAction

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The EventElem property is used with the BeforeAction event. The


BeforeAction event is used to run custom tests for form actions on
Web pages in Visual Script. Actions on Web pages in Visual Scripts
are listed in the Address node Properties. You can use the
BeforeAction event and the actionObj properties to access
elements on which user actions occurred.
The e-Tester BeforeAction event automatically defines the
actionObj object.

Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_beforeAction(ByVal actionObj
As RswIprogs.IProgAction)
Dim
Dim
Dim
Dim
Dim

actIndex As Long
actEvntType As String
actEventElem As String
actElemType As String
SubmitButton As Object

'Get the action index


actIndex = actionObj.index
'Get the event type - i.e. "click"
actEvntType = actionObj.eventType
348

e-Tester User Guide

EventElem Property

Example
(cont'd)

'Get the element tag name


actEventElem = actionObj.eventElem.tagName
'If the tag is an INPUT tag
' get the type (i.e "text" or "submit")
If actEventElem = "INPUT" Then
actElemType = actionObj.eventElem.Type
End If
'If the action is a Submit click
If (actionObj.eventType = "click") And _
(actElemType = "submit") Then
'Cancel the Submit click
actionObj.cancel = True
'Do something programmatically before
'the Submit click
'Now get the Submit button element
Set SubmitButton = RSWApp.om.FindElement("submit", _
"INPUT", "type")
'Now click Submit
SubmitButton.click
End If
End Sub

See Also

BeforeAction, Cancel, EventClass, EventType, Index

Appendix B: Programming Reference

349

EventType Property

EventType Property
Purpose

Gets the type of event that occurred on the Web page to use for the
BeforeAction event.

Syntax

object.EventType
Parameter
object

Description

An object. The following object is valid:


E actionObj used with the beforeAction
event of Custom VBA page tests.

Member of

RswIprogs.IProgAction

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The EventType property is used with the BeforeAction event. The


BeforeAction event is used to run custom tests for form actions on Web
pages in Visual Scripts. Actions on Web pages in Visual Scripts are listed
in the Address node Properties. You can use the BeforeAction event and
the actionObj properties to access event types (e.g. click, submit, etc.)
that occurred on a Web page.
The e-Tester BeforeAction event automatically defines the
actionObj object.

Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_beforeAction(ByVal actionObj
As RswIprogs.IProgAction)
Dim
Dim
Dim
Dim
Dim

actIndex As Long
actEvntType As String
actEventElem As String
actElemType As String
SubmitButton As Object

'Get the action index


actIndex = actionObj.index
'Get the event type - i.e. "click"
actEvntType = actionObj.eventType

350

e-Tester User Guide

EventType Property

Example
(cont'd)

'Get the element tag name


actEventElem = actionObj.eventElem.tagName
'If the tag is an INPUT tag
' get the type (i.e "text" or "submit")
If actEventElem = "INPUT" Then
actElemType = actionObj.eventElem.Type
End If
'If the action is a Submit click
If (actionObj.eventType = "click") And _
(actElemType = "submit") Then
'Cancel the Submit click
actionObj.cancel = True
'Do something programmatically before
'the Submit click
'Now get the Submit button element
Set SubmitButton = RSWApp.om.FindElement("submit", _
"INPUT", "type")
'Now click Submit
SubmitButton.click
End If
End Sub

See Also

BeforeAction, Cancel, EventClass, EventElem, Index

Appendix B: Programming Reference

351

ExecutingProduct Property

ExecutingProduct Property
Purpose

Gets which product is currently running.

Syntax

object.ExecutingProduct
Parameter
object

Description

An object. The following object is valid:


E RSWApp used with Custom VBA tests.

Member of

VBADLL.RSWApp

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

The following constants are defined:


0=PRODUCT_TESTER
1=PRODUCT_THICK
2=PRODUCT_THIN

Example

'Custom VBA Page Tests


Private Sub RSWVBAScript_startPlay()
If RSWApp.ExecutingProduct = PRODUCT_TESTER Then
'Executing e-Tester
End If
If RSWApp.ExecutingProduct = PRODUCT_THICK Then
'Executing Thick Client
End If
If RSWApp.ExecutingProduct = PRODUCT_THIN Then
'Executing Thin Client
End If
End Sub

See Also

352

BeforeAction, Cancel, EventClass, EventElem, Index

e-Tester User Guide

FindDoc Method

FindDoc Method
Purpose

Returns HTML document objects, optionally by target window name,


title, URL, or parent document object.

Syntax

object.om.FindDoc([name$], [title$], [url$], [parent])


Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

name$

title$
url$

parent

Optional. A string that specifies the target


window or frame name pattern. The default
is any name.
Optional. A string that specifies the document
title pattern. The default is any title.
Optional. A string that specifies the
document Uniform Resource Locator
pattern. The default is any URL.
Optional. An object variable that specifies
the parent document. The default is
Nothing.

Member of

RswIprogs.IprogOM, VBADLL.RSWAppOm

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Test


# External Program

Used With

# Thick Client

U Thin Client

Appendix B: Programming Reference

353

FindDoc Method

Remarks

Example 1

The name$, title$, url$ parameters can use the Visual Basic Like
operator wildcard characters, as follows:
Characters
*

Description

Any single character.

Any single digit (0-9).

[characterlist]

An single character in characterlist

[!characterlist]

An single character not in characterlist

Zero or more characters.

'Test Scriptlets and External Callout Tests


'find the HTML document object in "contents" frame
Dim mydoc1
Set mydoc1=rswObject.om.FindDoc("cont*")
rswObject.TestLog "", "", mydoc1.Title
'find the HTML document object in the "main"
'frame of the parent document
Dim parentDoc2, mydoc2
Set parentDoc2=rswObject.om.getTopDocument()
Set mydoc2=rswObject.om.FindDoc("main*",,,parentDoc2)
rswObject.TestLog parentDoc2.Title, "", mydoc2.Title
'find the HTML document object that has "RSW"
'in the <TITLE>
Dim parentDoc3, mydoc3
Set parentDoc3=rswObject.om.getTopDocument()
Set mydoc3=rswObject.om.FindDoc(,"RSW*",,parentDoc3)
rswObject.TestLog parentDoc3.Title, "", mydoc3.Title
'find the HTML document object with "index" in URL
Dim parentDoc4, mydoc4
Set parentDoc4=rswObject.om.getTopDocument()
Set mydoc4=rswObject.om.FindDoc(,,"*index*",
parentDoc4)
rswObject.TestLog parentDoc4.Title, "", mydoc4.Title

Example 2

354

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
'find the HTML document object in "contents" frame
Dim mydoc1 As Object
Set mydoc1 = RSWApp.om.FindDoc("cont*")
RSWApp.WriteToLog "", "", mydoc1.Title

e-Tester User Guide

FindDoc Method

Example 2
(cont'd)

'find the HTML document object in the "main"


'frame of the parent document
Dim parentDoc2 As Object, mydoc2 As Object
Set parentDoc2 = RSWApp.om.GetTopDocument(0)
Set mydoc2 = RSWApp.om.FindDoc("main*", , ,
parentDoc2)
RSWApp.WriteToLog parentDoc2.Title, "", mydoc2.Title
'find the HTML document object that has "RSW"
'in the <TITLE>
Dim parentDoc3 As Object, mydoc3 As Object
Set parentDoc3 = RSWApp.om.GetTopDocument(0)
Set mydoc3 = RSWApp.om.FindDoc(, "RSW*", ,
parentDoc3)
RSWApp.WriteToLog parentDoc3.Title, "", mydoc3.Title
'find the HTML document object with "index" in URL
Dim parentDoc4 As Object, mydoc4 As Object
Set parentDoc4 = RSWApp.om.GetTopDocument(0)
Set mydoc4 = RSWApp.om.FindDoc(, , "*index*",
parentDoc4)
RSWApp.WriteToLog parentDoc4.Title, "", mydoc4.Title
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim mydoc1 As Object
'Write this info to the 'List1' form object
'when a Visual Script page ends
List1.AddItem "Page End Event: Page " + _
CStr(playIndex) + " Played"
List1.AddItem "Page " + CStr(playIndex) +
" Playback Duration " + CStr(lastDuration / 1000)
'find the HTML document object in "contents" frame
Set mydoc1 = f_tester.om.FindDoc("conts*")
List1.AddItem "doc title = " + mydoc1.Title
End Sub

See Also

FindElement, GetHtml, GetParameterValues

Appendix B: Programming Reference

355

FindElement Method

FindElement Method
Purpose

Finds the object model for an HTML element in the current Visual
Script page using property, tag name, element range, or root element.

Syntax

object.om.FindElement ([propertyValuePattern$],
[tagName$], [propertyName$], [fromElement],
[toElement], [rootElement])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

propertyValue
Pattern$
tagName$
propertyName$
fromElement
toElement
rootElement

Member of
356

Optional. A string that specifies the element


property value pattern in which to find a
match. The default is any string pattern.
Optional. A string that specifies an HTML
tag name. The default is an empty string.
Optional. A string that specifies the property
name to find. The default is an empty string.
Optional. An object that specifies the first
element of a range.
Optional. An object that specifies the last
element of a range.
Optional. An object that specifies the
element to use as the root element of the
search. The root element can be a document.

RswIprogs.IprogOM, VBADLL.RSWAppOM
e-Tester User Guide

FindElement Method

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns an object.
To find the object model for the following HTML element in the
current Web page of the Visual Script:
<INPUT type="submit" value="Send Form">

set the FindElement parameters as follows:


propertyValuePattern$ = "submit" or "Send Form"
tagName$ = "INPUT"
propertyName$ = "type" or "value"

The propertyValuePattern$ parameter can use the Visual Basic


Like operator wildcard characters, as follows:

Example 1

Characters
*

Description

Any single character.

Any single digit (0-9).

[characterlist]

An single character in characterlist

[!characterlist]

An single character not in characterlist

Zero or more characters.

'Test Scriptlets and External Callout Tests


Dim parentDoc, propPattern, elementValue
Dim hrefElement, hrefElementa
Dim fromElement, toElement
'get the top document to use as the root element
Set parentDoc=rswObject.om.getTopDocument()
'set the property pattern as any pattern
propPattern="*"
'set the "from element" as <INPUT NAME="email">
Set fromElement=rswObject.om.findelement( _
"email*","INPUT","NAME",,,parentDoc)

Appendix B: Programming Reference

357

FindElement Method

Example 1
(cont'd)

'set the "to element" as <INPUT NAME="Submit">


Set toElement=rswObject.om.findelement("Submit", _
"INPUT","NAME",,,parentDoc)
Set hrefElement=rswObject.om.findelement( _
"http://rsw066/1*","A","HREF", _
fromElement,toElement,parentDoc)
Set hrefElementa=rswObject.om.findelement(_
"http://rsw066/2*","A","HREF", _
,,parentDoc)
'find first OPTION value between "from-to elements
elementValue= rswObject.om.findelementValue( _
propPattern, "OPTION","VALUE",fromElement _
,toElement,parentDoc)
'display the value in the Summary column of e-Tester
Call rswObject.testlog ("","",elementValue)
'find the first OPTION value beginning with "W"
'between "from-to elements
propPattern="W*"
elementValue= rswObject.om.findelementValue( _
propPattern,"OPTION","VALUE", _
fromElement,toElement,parentDoc)
'display the values in
Call rswObject.testlog
Call rswObject.testlog
Call rswObject.testlog

Example 2

the Summary column of e-Tester


("","",elementValue)
("","",hrefElement)
("","",hrefElementa)

'Custom VBA Tests


Private Sub RSWVBAPage_beforePlay()
Dim
Dim
Dim
Dim

parentDoc As Object, propPattern As String


fromElement As Object, toElement As Object
hrefElement As Object, hrefElementa As Object
elementValue

'get the top document to use as the root element


Set parentDoc = RSWApp.om.GetTopDocument()
'set the property patter as any pattern
propPattern = "*"
'set the "from element" as <INPUT NAME="email">
Set fromElement = RSWApp.om.FindElement( _
"email*", "INPUT", "NAME", , , parentDoc)

358

e-Tester User Guide

FindElement Method

Example 2
(cont'd)

'set the "to element" as <INPUT NAME="Submit">


Set toElement = RSWApp.om.FindElement("Submit", _
"INPUT", "NAME", , , parentDoc)
Set hrefElement = RSWApp.om.FindElement( _
"http://rsw066/1*", "A", "HREF", fromElement, _
toElement, parentDoc)
Set hrefElementa = RSWApp.om.FindElement( _
"http://rsw066/2*", "A", "HREF" _
, , , parentDoc)
'find the first OPTION value between from-to elements
elementValue = RSWApp.om.FindElementValue( _
propPattern, "OPTION", "VALUE", fromElement, _
toElement, parentDoc)
'display the value in the Summary column of e-Tester
Call RSWApp.WriteToLog("", "", elementValue)
'find the first OPTION value beginning with "W"
'between the "from-to" elements
propPattern = "W*"
elementValue = RSWApp.om.FindElementValue( _
propPattern, "OPTION", "VALUE", fromElement, _
toElement, parentDoc)
'display the values in the
Call RSWApp.WriteToLog(, ,
Call RSWApp.WriteToLog(, ,
Call RSWApp.WriteToLog(, ,

Summary column of e-Tester


elementValue)
hrefElement.innerHTML)
hrefElementa.outerHTML)

End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
'set up the variables
Dim parentDoc As Object, propPattern As String
Dim fromElement As Object, toElement As Object
Dim elementValue, hrefElement As Object
Dim hrefElementa As Object

Appendix B: Programming Reference

359

FindElement Method

Example 3
(cont'd)

'get the top document to use as the root element


Set parentDoc = f_tester.om.GetTopDocument()
'set the property patter as any pattern
propPattern = "*"
'set the "from element" as <INPUT NAME="email">
Set fromElement = f_tester.om.FindElement("email*", _
"INPUT", "NAME", "", "", parentDoc)
'set the "to element" as <INPUT NAME="Submit">
Set toElement = f_tester.om.FindElement("Submit", _
"INPUT", "NAME", "", "", parentDoc)
Set hrefElement = f_tester.om.FindElement( _
"http://rsw066/1*", "A", "HREF", fromElement, _
toElement, parentDoc)
Set hrefElementa = f_tester.om.FindElement( _
"http://rsw066/2*", "A", "HREF", , , parentDoc)
'find the first OPTION value between the
'from-to elements
elementValue = f_tester.om.FindElementValue( _
propPattern, "OPTION", "VALUE", fromElement, _
toElement, parentDoc)
'display the value in the "List1" form object
List1.AddItem "Element Value = " + elementValue
'find the first OPTION value Beginning with "W"
'between the from-to elements
propPattern = "W*"
elementValue = f_tester.om.FindElementValue( _
propPattern, "OPTION", "VALUE", fromElement, _
toElement, parentDoc)
'display the value in the "List1" form object
List1.AddItem "Element Value2 = " + elementValue
'display the value in the "List1" form object
List1.AddItem "Element Value = " + elementValue
List1.AddItem "HREF Value = " + hrefElement
List1.AddItem "HREF Value2 = " + hrefElementa
End Sub

See Also

360

FindDoc, FindElements, FindElementValue

e-Tester User Guide

FindElements Method

FindElements Method
Purpose

Finds one or more HTML elements in the current Visual Script page
by property, tag name, element range, or root element.

Syntax

object.Om.findElements(elementArray,
[propertyPattern$], [tagName$], [propertyName$],
[fromElement], [toElement], [rootElement])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

elementArray

propertyPattern$

tagName$
propertyName$
fromElement

Appendix B: Programming Reference

Required. A variable to use for the element


array or collection. For cutstom VBA tests,
elementArray is a Collection.
Optional. A string that specifies the element
property pattern on which to find a match.
The default is any string pattern.
Optional. A string that specifies the HTML
tag name. The default is an empty string.
Optional. A string that specifies the property
name to find. The default is an empty string.
Optional. An object that specifies the first
element of a range.

361

FindElements Method

Parameter
toElement
rootElement

Description

Optional. An object that specifies the last


element of a range.
Optional. An object that specifies the
element to use as the root element of the
search. The root element can be a document
object.

Member of

RswIprogs.IprogOM, VBADLL.RSWAppOM

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.


The propertyPattern$ parameter can use the Visual Basic Like
operator wildcard characters, as follows:

Example 1

Characters
*

Description

Any single character.

Any single digit (0-9).

[characterlist]

An single character in characterlist

[!characterlist]

An single character not in characterlist

Zero or more characters.

' Test Scriptlets and External Callout Tests


Dim element , resultb
Dim count , item
count = 0
resultb = rswobject.om.FindElements(element, _
"radio", "INPUT", "type")
For Each item In element
count = count + 1
rswobject.testlog , , item.outerHTML
Next

362

e-Tester User Guide

FindElements Method

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim element As Collection
Dim count As Integer
Dim resultb As Boolean
Dim item
count = 0
resultb = RSWApp.om.FindElements(element, _
"radio", "INPUT", "type")
For Each item In element
count = count + 1
RSWApp.WriteToLog , , item.outerHTML
Next
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim element
Dim count As Integer
Dim resultb As Boolean
Dim item
count = 0
resultb = f_tester.om.FindElements(element, _
"text", "INPUT", "type")
For Each item In element
count = count + 1
List1.AddItem "Found element " + item.outerHTML
Next
End Sub

See Also

FindElement, FindElementValue

Appendix B: Programming Reference

363

FindElementValue Method

FindElementValue Method
Purpose

Finds an HTML element value in the current Visual Script page by


property, tag name, element range, or root element.

Syntax

object.om.FindElementValue([propertyPattern$],
[tagName$], [propertyName$], [fromElement],
[toElement], [rootElement])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

propertyPattern$

tagName$
propertyName$
fromElement
toElement
rootElement

364

Optional. A string that specifies the element


property pattern in which to find a match.
The default is any string pattern.
Optional. A string that specifies the HTML
tag name. The default is "".
Optional. A string that specifies the property
name to find. The default is "".
Optional. An object that specifies the first
element of a range.
Optional. An object that specifies the last
element of a range.
Optional. An object that specifies the element
to use as the root element of the search. The
root element can be a document object.

e-Tester User Guide

FindElementValue Method

Member of

RswIprogs.IprogOM, VBADLL.RSWAppOm

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a variant.
The propertyPattern$ parameter can use the Visual Basic Like
operator wildcard characters, as follows:

Example 1

Characters
*

Description

Any single character.

Any single digit (0-9).

[characterlist]

A single character in characterlist.

[!characterlist]

A single character not in characterlist.

Zero or more characters.

'Test Scriptlets and External Callout Tests


Dim parentDoc, elementValue, hrefElement
Dim fromElement, toElement
'get the top document to use as the root element
Set parentDoc=rswObject.om.getTopDocument()
'set the "from element" as
'<INPUT type=text NAME="TodaysDate">
Set fromElement=rswObject.om.findelement( _
"Today*","INPUT","name",,,parentDoc)
'set the "to element" as
'<INPUT type="submit" value="Register">
Set toElement=rswObject.om.findelement( _
"submit","INPUT","type",,,parentDoc)
'find the <INPUT type=text NAME="LastName">
'element between "from-to elements
elementValue= rswobject.om.FindElementValue("La*", _
"INPUT","name",fromElement,toElement,parentDoc)
'display the value in the Summary column of e-Tester
Call rswObject.TestLog ("","",elementValue)

Appendix B: Programming Reference

365

FindElementValue Method

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim
Dim
Dim
Dim

parentDoc As Object
elementValue
fromElement As Object
toElement As Object

'get the top document to use as the root element


Set parentDoc = RSWApp.om.GetTopDocument()
'set the "from element" as
'<INPUT type=text NAME="TodaysDate">
Set fromElement = RSWApp.om.FindElement( _
"Today*", "INPUT", "name", , , parentDoc)
'set the "to element" as
'<INPUT type="submit" value="Register">
Set toElement = RSWApp.om.FindElement( _
"submit", "INPUT", "type", , , parentDoc)
'find the <INPUT type=text NAME="LastName">
'element between "from-to elements
elementValue = RSWApp.om.FindElementValue("La*", _
"INPUT", "name", fromElement, toElement, _
parentDoc)
'display the value in the Summary column of e-Tester
RSWApp.WriteToLog , , elementValue
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim
Dim
Dim
Dim

parentDoc As Object
elementValue
fromElement As Object
toElement As Object

'get the top document to use as the root element


Set parentDoc = f_tester.om.GetTopDocument()

366

e-Tester User Guide

FindElementValue Method

Example 3
(cont'd)

'set the "from element" as


'INPUT type=text NAME="TodaysDate">
Set fromElement = f_tester.om.FindElement( _
"name*", "INPUT", "name", , , parentDoc)
'set the "to element" as
'INPUT type="submit" value="Register">
Set toElement = f_tester.om.FindElement( _
"submit", "INPUT", "type", , , parentDoc)
'find the <INPUT type=text NAME="LastName">
'element between "from-to elements
elementValue = f_tester.om.FindElementValue( _
"ph*", "INPUT", "name", fromElement, _
toElement, parentDoc)
'display the value in the "List1 form object
List1.AddItem "Found element " + elementValue
End Sub

See Also

FindElement, FindElements, GetTopDocument

Appendix B: Programming Reference

367

FindInHtml Method

FindInHtml Method
Purpose

Finds a specific text string in the HTML source of a page recorded to


the Visual Script.

Syntax

object.findInHtml(string$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.

string$

The text string to find in the HTML source


of the current page of the Visual Script.

Member of

mint.RswEobj, Webanlst.RswEobj, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.

Example 1

'Test Scriptlets and External Callout Tests


'determine if server has returned requested page
'if not, replay current page
'if so, skip to next Visual Script page after
'last Auto page (in example case, page 4)
If rswObject.findInHtml("Table of Contents") Then
rswObject.play.gotopage(4)
Else
rswObject.play.gotopage(1) 'the current page
End If

368

e-Tester User Guide

FindInHtml Method

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
'determine if server has returned requested page
'if not, replay current page
'if so, skip to next Visual Script page after
'last Auto page (in example case, page 4)
If RSWApp.FindInHtml("Table of Contents") Then
RSWApp.GotoPage (4)
Else
RSWApp.GotoPage (1) 'the current page
End If
End Sub

See Also

FindElements, FindElementValue

Appendix B: Programming Reference

369

FireEvent Method

FireEvent Method
Purpose

Fires a JavaScript event handler on the specified HTML element object.

Syntax

object.om.FireEvent(element, eventName$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

element

eventName$

An element object. Specifies the HTML


element on which to fire the Java Script event
handler. Use the FindElement method to
locate the HTML element object in the
HTML source.
A string that specifies the Java Script event
handler to fire (for example, onClick,
onSubmit, etc).

Member of

rswIprogs.IprogOM, VBADLL.RSWappOm

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False. The FireEvent


method is only supported under Internet Explorer version 5 (IE5).

370

e-Tester User Guide

FireEvent Method

Example 1

'Test Scriptlets and External Callout Tests


Dim selElement, resultb
'get the FORM element object (name="theForm")
set selElement = rswObject.Om.FindElement( _
"theForm", "FORM","name")
If selElement Is nothing Then
rswobject.errnumber= 1
rswobject.errdescription = "Select Element Empty"
End If
'fire "onsubmit" handler of the FORM element object
resultb=rswObject.Om.FireEvent(selElement,"onsubmit")

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim selectElement As Object
Dim resultb As Boolean
'get the FORM element object (name="theForm")
Set selectElement = RSWApp.om.FindElement( _
"theForm", "FORM", "name")
If selectElement Is Nothing Then
errNumber = 1
errDescription = "Select Element Empty"
End If
'fire the "onsubmit" handler on the
'FORM element object
resultb = RSWApp.om.FireEvent( _
selectElement, "onsubmit")
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim selectElement As Object
Dim resultb As Boolean

Appendix B: Programming Reference

371

Gen Property

Example 3
(cont'd)

'get the FORM element object (name="theForm")


Set selectElement = f_tester.om.FindElement( _
"theForm", "FORM", "name")
If selectElement Is Nothing Then
errNumber = 1
errDescription = "Select Element Empty"
End If
'fire the "onsubmit" handler on the
'FORM element object
resultb = f_tester.om.FireEvent( _
selectElement, "onsubmit")
End Sub

See Also

FindElement

Gen Property
Purpose

Property reference to the IProg class of the RswIprogs type library.

Syntax

object.gen.method
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

method

Member of

372

The methods of the Iprog class of the


RswIprogs type library.

mint.ProgX, Webanlst.ProgT, Webanlst.RswEobj

e-Tester User Guide

Gen Property

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

Remarks

The methods of the Gen property include Back, GetCookies, Halt,


MatchHtml, Navigate, Quit, SetCookies, and StateOf.
GetCookies, MatchHtml, Navigate, and SetCookies, are
supported in Custom VBA tests without the Gen property.

Example 1

'Test Scriptlets and External Callout Tests


Dim resultb, urlStr, cookieVnt, topdoc
Set topdoc=rswobject.om.getTopDocument()
urlStr=topdoc.url
resultb = rswObject.gen.GetCookies(urlStr,cookieVnt)
If resultb Then
'Do whatever with cookie data in "cookieVnt"
End If

Example 2

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim
Dim
Dim
Dim

resultb As Boolean
urlStr As String,
cookieVnt
topdoc As Object

Set topdoc=f_tester.om.getTopDocument()
urlStr=topdoc.url
resultb = f_Tester.gen.GetCookies(urlStr,cookieVnt)
If resultb then
'Do whatever with cookie data in "cookieVnt"
End If

See Also

Nav, Om, Play

Appendix B: Programming Reference

373

GetCookies Method

GetCookies Method
Purpose

Gets the value of the cookie for the specified Uniform Resource
Locator.

Syntax

object.property.GetCookies(url$,cookies$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

url$
cookies$

A reference to the gen property of rswEObj,


ProgT, and ProgX. The gen property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A string that specifies the Uniform Resource
Locator of the page.
A String to store the cookie value.

Member of

RswIprogs.Iprog, VBADll.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.

374

e-Tester User Guide

GetCookies Method

Example 1

'Test Scriptlets and External Callout Tests


Dim cookieVnt
If rswObject.gen.GetCookies( _
rswobject.url,cookieVnt)=True then
'Do whatever with cookie data in "cookieVnt"
End If

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim
Dim
Dim
Dim

resultb As Boolean
urlStr As String,
cookieVnt
topdoc As Object

Set topdoc =RSWApp.om.getTopDocument()


urlStr=topdoc.url
resultb = RSWApp.GetCookies(urlStr,cookieVnt)
If resultb then
'Do whatever with cookie data in "cookieVnt"
End If
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim
Dim
Dim
Dim

resultb As Boolean
urlStr As String,
cookieVnt
topdoc As Object

Set topdoc=f_tester.om.getTopDocument()
urlStr=topdoc.url
resultb = f_Tester.gen.GetCookies(urlStr,cookieVnt)
If resultb then
'Do whatever with cookie data in "cookieVnt"
End If

See Also

SetCookies

Appendix B: Programming Reference

375

GetCurrentVuId Method

GetCurrentVuId Method
Purpose

Gets the current Virtual User ID.

Syntax

object.GetCurrentVuId
Parameter
object

Description

An object variable. The following object is


valid:
E rswObject used with Test Scriptlets.

Member of

Webanlst.RswEobj, mint.RswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Use this procedure to get the ID of the current Virtual User being
played back in e-Load. The current Virtual User ID in e-Tester is
always zero.

Example

'Test Scriptlets and External Callout Tests


Dim vuId
vuId = rswObject.GetCurrentVuId
Call rswObject.TestLog("","", Cstr(vuId))

See Also

376

None

e-Tester User Guide

GetDataBank Method

GetDataBank Method
Purpose

Gets the field names and values from the Data Bank.

Syntax

object.property.getDataBank(fieldNames,values, index)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

fieldNames
values
index

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
A variant array to store the Data Bank field
names.
A variant array to store the Data Bank field
values.
A variant that defines the Data Bank record
index.

Member of

RswIprogs.IprogPlay

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

Appendix B: Programming Reference

377

GetDataBank Method

Remarks

Returns True if successful, otherwise False.


Use the Data Bank Wizard to define Visual Script variables and bind
the variable names to field names in the Data Bank file.
The current Data Bank record is determined by the record pointer of
e-Tester. The current record can be set using the Data Bank Wizard
or the Iterate options.

Example

'Test Scriptlets and External Callout Tests


'Set up the variables
Dim
Dim
Dim
Dim

nameCount, name, names


valueCount, value, values
recordNum, index
resultb

'Get the field names and values as two arrays


resultb = rswObject.play.GetDataBank(names, values,
index)
'Number of Data Bank variables
nameCount = Cstr(Ubound(names, 1))
'Number of values
valueCount = Cstr(Ubound(values, 1))
'Data Bank record number
recordNum = Cstr(index)
'Write the variable names/values to the Results log
Dim x
For x = 0 to nameCount
name = Cstr(names(x))
value = Cstr(values(x))
Call rswObject.TestLog("Name = " + name,"Record = "
+ recordNum,"Value = " +value)
Next

See Also

378

GetDataBankSize, GetDataBankValue, SetDataBankRecord,


SetDataBankValue

e-Tester User Guide

GetDataBankSize Method

GetDataBankSize Method
Purpose

Gets the number of records in the Data Bank.

Syntax

object.property.getDataBankSize()
Parameter
object

Description

property

A reference to the play property of ProgT


and ProgX. The play property is required
for External Program control.

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IprogPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a Long that specifies the number of records.


Use the Data Bank Wizard to define Visual Script variables and bind
the variable names to field names in the Data Bank file.

Example

'External Program Control


'Set up the variable
Dim numRecords As Long
'Get the number of records
numRecords = m_tester.play.GetDataBankSize()
List1.AddItem " DataBank Size: " & CStr(numrecords)

See Also

GetDataBank, GetDataBankValue,
SetCurrentDataBankRecord, SetDataBankValue

Appendix B: Programming Reference

379

GetDataBankValue Method

GetDataBankValue Method
Purpose

Gets the current Data Bank value from the specified variable name.

Syntax

object.property.getDataBankValue(fieldVarName$,value)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

fieldVarName$

value

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A string that specifies the name of Visual
Script variable bound to a field in the Data
Bank file attached to the current Visual
Script.
A variant variable to store the Data Bank
field value.

Member of

RswIprogs.IprogPlay, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.

380

e-Tester User Guide

GetDataBankValue Method

Use the Data Bank Wizard to define Visual Script variables and bind
the variable names to field names in the Data Bank file.
The current Data Bank record is determined by the record pointer of
e-Tester. The current record can be set using the Data Bank Wizard
or the Iterate options.
Example 1

'Test Scriptlets and External Callout Tests


Dim searchField, searchText, submitButton
'Map and bind the Visual Script variable "var_Search"
'to the "Search" field in the Data Bank file using
'the Data Bank wizard
'Get the Data Bank value from the Visual Script
'variable "var_Search" and store the value in
'The Test Scriptlet variable "searchText"
Call rswObject.play.GetDataBankValue("var_Search",
searchText)
'Get the Search Input Element Object using FindElement
Set searchField=rswObject.om.Findelement("Search",
"INPUT","name")
'Set the Data Bank value to the Form field value
searchField.value=searchtext
'Get the Submit button Element Object using FindElement
Set submitButton=rswObject.om.Findelement("submit",
"INPUT","type")
submitButton.click 'Click the Submit button

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim searchField As Object, submitButton As Object
Dim searchText As String
'Map and bind the Visual Script variable "var_Search"
'to the "Search" field in the Data Bank file using
'the Data Bank wizard
'Get the Data Bank value from the Visual Script
'variable "var_Search" and store the value in
'the variable "searchText"
Call RSWApp.GetDataBankValue("var_Search",searchText)
'Get the Search Input Element Object using FindElement
Set searchField = RSWApp.om.FindElement( _
"Search", "INPUT", "name")

Appendix B: Programming Reference

381

GetDataBankValue Method

Example 2
(cont'd)

'Set the Data Bank value to the Form field value


searchField.Value = searchText
'Get the Submit button Element using FindElement
Set submitButton = RSWApp.om.FindElement("submit",
"INPUT", "type")
submitButton.click 'Click the Submit button
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim searchField As Object, submitButton As Object
Dim searchText As String
'Map and bind the Visual Script variable "var_Search"
'to the "Search" field in the Data Bank file using
'the Data Bank wizard
'Get the Data Bank value from the Visual Script
'variable "var_Search" and store the value in
'the variable "searchText"
Call f_tester.play.GetDataBankValue( _
"var_Search",searchText)
'Get the Search Input Element Object using FindElement
Set searchField = f_tester.om.FindElement( _
"Search", "INPUT", "name")
'Set the Data Bank value to the Form field value
searchField.Value = searchText
'Get the Submit button Element using FindElement
Set submitButton = f_tester.om.FindElement( _
"submit", "INPUT", "type")
submitButton.click 'Click the Submit button
End Sub

See Also

382

ChangeNavigation, GetDataBank, GetDataBankSize,


SetDataBankRecord, SetDataBankValue
e-Tester User Guide

GetDocuments Method

GetDocuments Method
Purpose

Gets a collection of HTML documents from all open browser windows.

Syntax

object.GetDocuments(collection)
Parameter
object

Description

collection

A collection variable to store the documents


collection.

An object variable. The following object is


valid:
E rswObject used with External Callout
tests.

Member of

Webanlst.RswEobj, mint.RswEobj

Applies To

U Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Use this procedure to get a document from Web pages that open in
secondary windows.

Example

'External Callout Tests


Dim docs As New Collection
Dim doc As Object, link As Object
Call rswObject.GetDocuments(docs)
For Each doc In docs
For Each link In doc.links
If link.innerText = "index.htm" Then
'test passed, return success code
End If
Next link
Next doc

See Also

GetTopDocument, GetTopDocuments

Appendix B: Programming Reference

383

GetElementByPath Method

GetElementByPath Method
Purpose

Gets an HTML document element by the object model path.

Syntax

object.om.GetElementByPath(path$,[elObject],[errorStr])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

path$

The object path of the element.

elObject

Optional. An object to store the element


object specified by path$.
Optional. A variant to store the error string
returned if the element object is not found.

errorStr

Member of

RswIprogs.IprogOM, VBADLL.RSWAppOm

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

384

e-Tester User Guide

GetElementByPath Method

Remarks

Returns True if successful, otherwise False.


path$ is specified using the following format:
window[index].element[index]

Where window[index] is the index of open HTML document


windows. The window[index] index is 1 based.
element is the HTML element type in the HTML source in
window[index].
element[index] is the index of the specified element type in the
HTML in source order. The element[index] index is 1 based.

A path$ of window[1].Td[5] indicates the fifth TD (table cell)


element in the HTML source in Window 1 in source order.
path$ can also include parent tags and attributes to further define the

path using the following format:

window[index].parent.[index].element(attribute=
'value')[index]

A path$ of window[1].td[3].a(innerText='support')[1]
indicates the first A (anchor) element with the inner text support in
the third TD (table cell) in the HTML source in Window 1 in source
order.
You can use the e-Tester Custom Test Wizard to automatically select
page elements, path rules, and generate custom VBA tests.
Example 1

'Test Scriptlets and External Callout Tests


Dim gPath, element, errStr
'Get the third "A" element in the page
gPath="window[1].a[3]"
If rswObject.om.GetElementByPath(gPath, _
element, errStr) then
'display the value in the Summary column of e-Tester
Call rswObject.Testlog("","",element.outertext)
Else
'display an error in the Summary column of e-Tester
Call rswObject.Testlog("","",errStr)
End If

Appendix B: Programming Reference

385

GetElementByPath Method

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim gPath As String
Dim element As IHTMLElement
Dim errStr As String
'Get the third "A" element in the page
gPath = "window[1].a[3]"
If RSWApp.om.GetElementByPath(gPath, _
element, errStr) Then
'display the value in the Summary column of e-Tester
Call RSWApp.WriteToLog(, , element)
Else
'display an error in the Summary column of e-Tester
Call RSWApp.WriteToLog(, , errStr)
End If
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim gPath As String
Dim element As IHTMLElement
Dim errStr As String
'Get the third "A" element in the page
gPath = "window[1].a[3]"
If f_tester.om.GetElementByPath(gPath, _
element, errStr) Then
'display the value in the "List1 form object
List1.AddItem "Element " + element
Else
'display an error in the "List1 form object
List1.AddItem errStr
End If
End Sub

See Also
386

FindElement, FindElements, FindElementValue

e-Tester User Guide

GetHtml Method

GetHtml Method
Purpose

Returns the HTML source of the page in the Browser.

Syntax

object.getHtml(html$,frameName$,[master],[parsed])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.

html$

A string to store the HTML source.

frameName$

A string specfiying the frame name from which


to retrieve the HTML source. Use "" when not
in a frameset.
Optional. Always False if used. Master
HTML version is no longer supported. Not
used with Custom VBA tests.
Optional. True|False. When True,
e-Tester returns the text of the page with all
HTML tags and scripts removed. When
False (the default), e-Tester returns the
HTML <BODY> source (inclusive). Not
used with Custom VBA tests.

master

parsed

Member of

Webanlst.RswEobj, mint.RswEobj, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Test


U External Program

Used With

# Thick Client

# Thin Client

Appendix B: Programming Reference

387

GetHtml Method

Remarks

The HTML source is from the version of the Web page or application
being played back in the Browser, not the recorded version in the Visual
Script. The text returned is the source of the <BODY> tags of the page
including the beginning and ending <BODY></BODY> tags.
When used in beforePagePlay, the HTML source will be from the
previous page played back by the Visual Script. When used in
afterPagePlay, the HTML source will be from the current page
being played back.
Returns True if successful, otherwise False. html$ will contain an
error string on an error.

Example 1

'Test Scriptlets and External Callout Tests


Dim HtmlStr, HtmlStr1
'Get the HTML source in <BODY>
Call rswObject.GetHtml(HtmlStr, "",, False)
Call rswObject.TestLog(,,HtmlStr)
'Get the parsed source
Call rswObject.GetHtml(HtmlStr1, "",,True)
Call rswObject.TestLog(,,HtmlStr1)

Example 2

'Custom VBA Test


Private Sub RSWVBAPage_afterPlay()
Dim HtmlStr As String
'Get the HTML source in <BODY>
Call RSWApp.GetHtml(HtmlStr, "")
Call RSWApp.WriteToLog(,,HtmlStr)
End Sub

See Also

388

GetParameters, GetOriginalHtml

e-Tester User Guide

GetOriginalHtml Method

GetOriginalHtml Method
Purpose

Returns the complete HTML source of the current page in the Browser.

Syntax

object.getOriginalHtml(html$,frameName$)
Parameter
object

Description

html$

Any variable name to store the HTML source.

frameName$

The frame name from which to retrieve the


HTML source. Use "" when the HTML
source is not in a frameset.

An object variable. The following object is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.

Member of

Webanlst.RswEobj, mint.RswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

The HTML source is from the version of the Web page or application
being played back in the Browser, not the recorded version in the
Visual Script.
The text returned is the source of the <HTML> tags of the page
including the beginning and ending <HTML></HTML> tags.
When used in beforePagePlay, the HTML source will be from the
previous page played back by the Visual Script. When used in
afterPagePlay, the HTML source will be from the current page
being played back.
Returns True if successful, otherwise False. html$ will contain an
error string on an error.

Appendix B: Programming Reference

389

GetParameters Method

Example

'Test Scriptlets and External Callout Tests


Dim resultb, HtmlStr
'Get the HTML source in <HTML>
resultb=rswObject.getOriginalHtml(HtmlStr,
"Frame1") Call rswObject.TestLog(,,HtmlStr)

See Also

GetHtml, GetParameters

GetParameters Method
Purpose

Gets the parameters of the current page of the Visual Script as two
collections.

Syntax

object.getParameters paramNames, paramValues


Parameter
object

Description

paramNames

Any collection variable to store the parameter


name strings.
Any collection variable to store the parameter
value strings.

paramValues

An object variable. The following object is


valid:
E rswObject used with External Callout
tests.

Member of

Webanlst.RswEobj, mint.RswEobj

Applies To

U Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.

390

e-Tester User Guide

GetParameterValues Method

Example

'External Callout Tests


Dim paramNames, paramValues as new collection
rswObject.getParameters paramNames, paramValues
' Put parameters into the common area
Dim i%
For i = 1 To paramNames.Count
If i > 1 Then dscr = dscr + 1
dscr = paramNames(i) + "=" + paramValues(i)
Next I

See Also

GetHtml

GetParameterValues Method
Purpose

Gets the parameters names and values in the current page of the
Visual Script as two collections or arrays.

Syntax

object.property.getParameterValues(paramNames,
paramValues)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

Appendix B: Programming Reference

A reference to the play.nav properties of


rswEObj, ProgT, and ProgX. The
play.nav properties are required for Test
Scriptlets, External Callout tests, and
External Program control.
property is not used with Custom VBA tests.

391

GetParameterValues Method

Parameter
paramNames

paramValues

Description

An array or collection to store the parameter


names. For Test Scriptlets, External Callout
test and External Program Control,
paramNames is an array. For Custom VBA
tests, paramNames is a Collection.
An array or collection to store the parameter
values. For Test Scriptlets, External Callout
test and External Program Control,
paramValues is an array. For Custom VBA
tests, paramValues is a Collection.

Member of

RswIprogs.IprogNav, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.


The parameters are recorded under the Address node of a form results
page in the Visual Script.

Example 1

'Test Scriptlets and External Callout Tests


Scriptlets and External Callout Tests
Dim paramName, paramNames, paramValues, paramIndex
Dim resultb, desc, I
resultb=rswObject.play.nav.getParameterValues(
paramNames, paramValues)
' Loop through parameter name/value collections
I=0
For each paramName in paramNames
desc = paramNames(I) + "=" + paramValues(I)
paramIndex="Param("+Cstr(I)+")"
'write description to e-Tester result log
call testlog(paramIndex,"",desc)
'do something else with parameter name/value
I=I+1
Next

392

e-Tester User Guide

GetParameterValues Method

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim paramName
Dim paramNames As Collection
Dim paramValues As Collection
Dim paramIndex As String, resultb As Boolean
Dim desc As String, count As Long
resultb = RSWApp.GetParameterValues(paramNames, _
paramValues)
' Loop through parameter name/value collections
count = 1
For Each paramName In paramNames
desc = paramNames.Item(count) + "=" _
+ paramValues.Item(count)
paramIndex = "Param(" + CStr(count) + ")"
'write description to e-Tester result log
Call RSWApp.WriteToLog(paramIndex, , desc)
'do something else with parameter name/value
count = count + 1
Next
End Sub

Example 3

'External Program Control


Dim paramName
Dim paramNames As Collection
Dim paramValues As Collection
Dim paramIndex As String, resultb As Boolean
Dim desc As String, I As Long
resultb = f_tester.play.nav.GetParameterValues( _
paramNames, paramValues)
' Loop through parameter name/value collections
I=0
For each paramName in paramNames
desc = paramNames(I) + "=" + paramValues(I)
paramIndex="Param("+Cstr(I)+")"
'write description to List1 object of a form
List1.AddItem paramIndex + " " + desc)
'do something else with parameter name/value
I=I+1
Next

See Also

SetParameterValues

Appendix B: Programming Reference

393

GetRecordedPostdata Method

GetRecordedPostdata Method
Purpose

Gets the post data recorded in the current page of the Visual Script.

Syntax

object.property.getRecordedPostdata(postdata$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

postdata$

A reference to the play.nav properties of


rswEObj, ProgT, and ProgX. The
play.nav properties are required for Test
Scriptlets, External Callout tests, and
External Program control.
property is not used with Custom VBA tests.
A string used to store the unencoded post
data.

Member of

RswIprogs.IprogNav, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

394

e-Tester User Guide

GetRecordedPostdata Method

Remarks

Returns True if successful, otherwise False.


The post data is the data string from a Web page Form sent to the
server using the POST method. The post data string is in the
following format: name1=value1&name2=value2, etc.
name1 and name2 represent the name attribute of the INPUT
elements of a Web page form. value1 and value2 represent the data
entered into the respective input fields of the form. Each name=value
pair is separated by an ampersand (&). Spaces between words in the
individual value data are separated by a plus (+) sign, as follows:
name=my+name&comments=my+comments+entered+into+form

Example 1

'Test Scriptlets and External Callout Tests


Scriptlets and External Callout Tests
Dim PostdataStr, resultb
resultb=rswObject.play.nav.getRecordedPostdata( _
PostdataStr)
If resultb Then
'Post Data Get Successful - string in PostdataStr
Call rswObject.TestLog(,,PostdataStr)
Else
'Post Data Get Failed
Call rswObject.TestLog(,,"Post Data Get Failed")
End If

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim PostdataStr as String
Dim resultb As Boolean
resultb=RSWApp.getRecordedPostdata(PostdataStr)
If resultb Then
'Post Data Get Successful - string in PostdataStr
Call RSWApp.WriteToLog(,,PostdataStr)
Else
'Post Data Get Failed
Call RSWApp.WriteToLog(,,"Post Data Get Failed")
End If
End Sub

Appendix B: Programming Reference

395

GetRecordedPostdata Method

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim PostdataStr as String
Dim resultb As Boolean
resultb=f_tester.play.nav.getRecordedPostdata( _
PostdataStr)
If resultb Then
'Post Data Get Successful - string in PostdataStr
List1.AddItem "Post Data = " + PostdataStr
Else
'Post Data Get Failed
List1.AddItem "Post Data Get Failed"
End If

See Also

396

PostData

e-Tester User Guide

GetRecordedUrl Method

GetRecordedUrl Method
Purpose

Gets the Uniform Resource Locator of the current page in the Visual
Script.

Syntax

object.property.getRecordedUrl(url)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

url

A reference to the play.nav properties of


rswEObj, ProgT, and ProgX. The
play.nav properties are required for Test
Scriptlets, External Callout tests, and
External Program control.
property is not used with Custom VBA tests.
A string to store the recorded URL of the
page in the Visual Script.

Member of

RswIprogs.IprogNav, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.


url contains the recorded URL of the current Visual Script page .

Appendix B: Programming Reference

397

GetRecordedUrl Method

Example 1

'Test Scriptlets and External Callout Tests


Dim urlStr, resultb
resultb=rswObject.play.nav.GetRecordedUrl(urlStr)
If resultb Then
'Get URL Successful - string in urlStr
Call rswObject.TestLog(,,urlStr)
Else
'Get URL Failed
Call rswObject.TestLog(,,"Get URL Failed")
End If

Example 2

'Custom VBA Tests


Dim urlStr As String, resultb As Boolean
resultb=RSWApp.GetRecordedUrl(urlStr)
If resultb Then
'Get URL Successful - string in urlStr
Call RSWApp.WriteToLog(,,urlStr)
Else
'Get URL Failed
Call RSWApp.WriteToLog(,,"Get URL Failed")
End If

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim urlStr As String, resultb As Boolean
resultb=f_tester.play.nav.GetRecordedUrl(urlStr)
if resultb Then
'Get URL Successful - string in urlStr
List1.AddItem "Recorded URL = " + urlStr
else
'Get URL Failed
List1.AddItem "Get URL Failed"
end if

See Also

398

PageUId, Postdata, ScriptName

e-Tester User Guide

GetTopDocument Method

GetTopDocument Method
Purpose

Gets the Object Model for the top document of a Visual Script page.

Syntax

object.om.GetTopDocument(winId$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets. WinId is
optional for Test Scriptlets and External
Callout tests.
E RSWApp used with Custom VBA tests.
WinId is required for Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

winId

A string that specifies the window identifier.

Member of

RswIprogs.IprogOM, VBADLL.RSWAppOm

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns the Document Object Model for the Visual Script page.
If the winId string is 0, the Document Object Model of the current
page in the e-Tester browser window is returned.
If the winId is a string, the Document Object Model of the page in
the window specified by documents title string pattern is returned.
You can use the asterisk (*) and question mark (?) wildcards
characters in the pattern.

Appendix B: Programming Reference

399

GetTopDocument Method

If the winId is a number, the number is the zero-based index for the
open browser windows (e-Tester browser and any secondary windows).
Example 1

'Test Scriptlets and External Callout Tests


Dim topdoc, urlStr, titleStr, testerWin
testerWin="0"
Set topdoc=rswObject.om.GetTopDocument(testerWin)
urlStr="URL: " & topdoc.url
titleStr="Title: " & topdoc.title
Call Testlog(urlStr,,titleStr)

Example 2

'Custom VBA Tests


Dim topdoc As Object
Dim urlStr As String
Dim titleStr As String
Dim testerWin As String
testerWin = "0"
Set topdoc=RSWApp.om.GetTopDocument(testerWin)
urlStr="URL: " & topdoc.url
titleStr="Title: " & topdoc.title
Call RSWapp.WriteToLog(urlStr,,titleStr)

Example 3

'External Program Control


Dim topdoc As Object
Dim urlStr As String
Dim titleStr As String
Dim testerWin As String
testerWin = "0"
Set topdoc=f_tester.om.GetTopDocument(testerWin)
urlStr="URL: " & topdoc.url
titleStr="Title: " & topdoc.title
List1.AddItem urlStr
List1.AddItem titleStr

See Also

400

FindDoc, GetTopDocuments

e-Tester User Guide

GetTopDocuments Method

GetTopDocuments Method
Purpose

Gets an array of all top documents from multiple open browser windows.

Syntax

object.om.GetTopDocuments(docCol, [onlyTransitioned])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

docCol

onlyTransitioned

Required. An array or collection to get the


top documents of the Visual Script. For Test
Scriptlets, External Callout test and External
Program Control, docs is an array. For
Custom VBA tests, docs is a Collection.
Optional. True | False (default).

Member of

RswIprogs.IprogOM, VBADLL.RSWAppOm

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.


This procedure gets the documents from multiple open browser
windows. Use this procedure to get the document object from Web
pages that open in secondary windows.

Appendix B: Programming Reference

401

GetTopDocuments Method

Example 1

'Test Scriptlets and External Callout Tests


dim doc, docarray, docIndex, resultb, count, titleStr
resultb=rswObject.om.GetTopDocuments(docarray)
'Loop through array. Put Titles in e-Tester Log
count=0
For Each doc in docarray
titleStr = docarray(count).title
docIndex="doc("+Cstr(count)+")"
call testlog (docIndex,"",titleStr)
count = count+1
Next

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim doc As Object, doccoll As Collection
Dim docIndex As String, resultb As Boolean
Dim count As Long, titleStr As String
resultb = RSWApp.om.GetTopDocuments(doccoll)
'Loop through collection. Put Titles in e-Tester Log
count = 1
For Each doc In doccoll
titleStr = doccoll.Item(count).Title
docIndex = "doc(" + CStr(count) + ")"
Call RSWApp.WriteToLog(docIndex, "", titleStr)
count = count + 1
Next
End Sub

Example 3

'External Program Control


Dim doc As Object, doccoll As Collection
Dim docIndex As String, resultb As Boolean
Dim count As Long, titleStr As String
resultb=f_tester.om.GetTopDocuments(doccoll)
'Loop through array. Put Titles in List1 object
count=0
For Each doc in doccoll
titleStr = doccoll(count).title
docIndex="doc("+Cstr(count)+")"
List1.AddItem docIndex + " " + titleStr
count = count+1
Next

See Also
402

GetTopDocument
e-Tester User Guide

GoBack Method

GoBack Method
Purpose

Navigates back one page in the Browser history.

Syntax

object.GoBack()
Parameter
object

Description

An object variable. The following object is


valid:
E RSWApp used with Custom VBA tests.

Member of

VBADLL.RSWApp

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Example

'Custom VBA Tests


Dim resultb as Boolean
resultb = RSWApp.GoBack()

See Also

ChangeCurrentPage, GoBack, GotoPage

Appendix B: Programming Reference

403

GotoPage Method

GotoPage Method
Purpose

Goes to the specified Visual Script page and plays back the page.

Syntax

object.property.GotoPage(pageIndex)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

pageIndex

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A variant that specifies the Visual Script page
number.

Member of

RswIprogs.IprogPlay, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.

404

e-Tester User Guide

GotoPage Method

Example 1

'determine if server has returned requested page


'if not, replay current page
'if so, skip to next Visual Script page after
'last Auto page (in example case, page 4)
If FindInHtml("<TITLE>Table of Contents") then
rswObject.play.GotoPage(4)
Else
rswObject.play.GotoPage(1) 'the current page
End If

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
If RSWApp.FindInHtml("Table of Contents") Then
RSWApp.GotoPage (4)
Else
RSWApp.GotoPage (1) 'the current page
End If
End Sub

Example 3

'External Prgram Control


Dim reHtml As String
Dim lPattern As String
Dim rPattern As String
'match the HTML between "<*TITLE*>" and "</TITLE>"
lPattern = "<*TITLE*>"
rPattern = "</TITLE>"
resultb=f_tester.gen.matchHtml(retHtml, lPattern,
rPattern, "")
If retHtml = "Table of Contents" Then
f_tester.play.GotoPage (4)
Else
f_tester.play.GotoPage (1) 'the current page
End If
End Sub

See Also

Back, GoBack, Navigate

Appendix B: Programming Reference

405

Halt Method

Halt Method
Purpose

Stops navigation in all Browser windows.

Syntax

object.gen.halt()
Parameter
object

Description

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IProg

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.


Used to halt the e-Tester playback engine from an external program.

Example

'External Program Control


'Select Visual Basic Project>References = mint
Option Explicit
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
End Sub
Private Sub cmdDestroy_Click()
m_tester.gen.halt()
Set m_tester = Nothing
End Sub

See Also

406

None

e-Tester User Guide

HasCustomTests Method

HasCustomTests Method
Purpose

Determines if a Visual Script includes custom tests.

Syntax

object.play.HasCustomTests()
Parameter
object

Description

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IProgPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if the Visual Scripts has custom tests, otherwise False.
Custom tests include custom VBA tests, Test Scriptlets, and External
Callout tests.
This method can be used to determine which Visual Scripts in a
library of Visual Scripts contain custom programming code.

Example

'External Program Control


Dim scriptName as String
m_tester.play.openWorkspace "RSWDemo"
For each 'Visual Script in Workspace
'Visual Script name = scriptName
m_tester.play.openScript scriptName
If m_tester.play.hasCustomTests() Then
List1.AddItem scriptName + " Has Custom Code"
Else
'No custom code
End If
Next 'Get next Visual Script

See Also

None

Appendix B: Programming Reference

407

Index Property

Index Property
Purpose

Gets the index of an action that occurred on the Web page to use for
the BeforeAction event.

Syntax

object.Index
Parameter
object

Description

An object. The following object is valid:


E actionObj used with the
beforeAction event of Custom VBA
page tests.

Member of

RswIprogs.IprogAction

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The Index property is used in the BeforeAction event. The


BeforeAction event is used to run custom tests for form actions on
Web pages in Visual Scripts. Actions on Web pages in Visual Scripts
are listed in the Address node Properties. You can use the
BeforeAction event and the actionObj properties to access the
index of event action types (e.g. click, submit, etc.) that occurred on a
Web page.
The e-Tester BeforeAction event automatically defines the
actionObj object.

408

e-Tester User Guide

Index Property

Example

'Custom VBA Page Tests


Private Sub RSWVBAPage_beforeAction(ByVal actionObj
As RswIprogs.IProgAction)
Dim
Dim
Dim
Dim
Dim

actIndex As Long
actEvntType As String
actEventElem As String
actElemType As String
SubmitButton As Object

'Get the action index


actIndex = actionObj.index
'Get the event type - i.e. "click"
actEvntType = actionObj.eventType
'Get the element tag name
actEventElem = actionObj.eventElem.tagName
'If the tag is an INPUT tag
'get the type (i.e "text" or "submit")
If actEventElem = "INPUT" Then
actElemType = actionObj.eventElem.Type
End If
'If the action is a Submit click
If (actionObj.eventType = "click") And _
(actElemType = "submit") Then
'Cancel the Submit click
actionObj.cancel = True
'Do something programmatically before
'the Submit click
'Now get the Submit button element
Set SubmitButton = RSWApp.om.FindElement("submit", _
"INPUT", "type")
'Now click Submit
SubmitButton.click
End If
End Sub

See Also

BeforeAction, Cancel, EventClass, EventElem, EventType

Appendix B: Programming Reference

409

InsertNav Method

InsertNav Method
Purpose

Inserts custom program navigation (Test Scriptlet or External Callout


test) between Visual Script page playback.

Syntax

object.play.InsertNav([pageId])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

pageId

Optional. A variant that specifies the page


number to continue with after finishing the
custom program.

Member of

RswIprogs.IProgPlay

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

410

e-Tester User Guide

InsertNav Method

Example 1

'Test Scriptlets and External Callout Tests


Dim resultb
'navigate to Web site and continue with page
'four of Visual Script
resultb=rswObject.play.insertNav(4)
resutlb=rswObject.gen.navigate("http://
www.rswsoftware.com/index.html")

Example 2

'External Program Control


Dim resultb
'navigate to Web site and continue with page
'four of Visual Script
resultb=f_tester.play.insertNav(4)
resutlb=rswObject.gen.navigate("http://
www.rswsoftware.com/index.html")

See Also

ReplaceNav

Appendix B: Programming Reference

411

IterateScript Method

IterateScript Method
Purpose

Play back the Visual Script with iterations.

Syntax

object.play.IterateScript([scriptname$])
Parameter
object

Description

scriptname$

Optional. The Visual Script to iterate.

An object variable. The following objects are


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IProgPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Example

'Select Visual Basic Project>References = mint


Option Explicit
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub cmdDestroy_Click()
m_tester.gen.halt()
Set m_tester = Nothing
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.IterateScript("tutor1")
End Sub

See Also
412

DoScript

e-Tester User Guide

IterationCount Method

IterationCount Method
Purpose

Gets the playback iteration number.

Syntax

object.IterationCount()
Parameter
object

Description

An object variable. The following object is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.

Member of

Webanlst.RswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a zereo-based Long.

Example

'Test Scriptlets and External Callout Tests


Dim iCount
iCount=rswObject.IterationCount()
Call rswObject.TestLog(,,"Count = " + Cstr(iCount))

See Also

IterateScript

Appendix B: Programming Reference

413

IterationsBegin Event

IterationsBegin Event
Purpose

The begin VisualScript playback iteration event.

Syntax

object_IterationsBegin()
Parameter
object

Description

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester.

Member of

Webanlst.ProgT

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Used to execute code when Visual Script playback iterations begin.

Example

'External Program Contro


Option Explicit
'Select VB Project>References = RSW e-Tester 4.0
Dim WithEvents f_tester As Webanlst.ProgT
Private Sub cmdCreate_Click()
Set f_tester = Webanlst.ProgT
End Sub
Private Sub cmdStart_Click()
f_tester.play.openWorkspace "RSWDemo"
f_tester.play.openScript "tutor1"
f_tester.play.IterateScript "tutor1"
End Sub
Private Sub f_tester_IterationsBegin()
List1.AddItem "Iterations Started " & Time
End Sub

See Also

414

IterationsEnd, PageEnd, PlaySuspended, ScriptBegin,


ScriptEnd

e-Tester User Guide

IterationsEnd Event

IterationsEnd Event
Purpose

The end VisualScript playback iteration event.

Syntax

object_IterationsEnd()
Parameter
object

Description

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester.

Member of

Webanlst.ProgT

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Used to execute code when Visual Script playback iterations end.

Example

'External Program Control


Option Explicit
'Select VB Project>References = RSW e-Tester 4.0
Dim WithEvents f_tester As Webanlst.ProgT
Private Sub cmdCreate_Click()
Set f_tester = Webanlst.ProgT
End Sub
Private Sub cmdStart_Click()
f_tester.play.openWorkspace "RSWDemo"
f_tester.play.openScript "tutor1"
f_tester.play.IterateScript "tutor1"
End Sub
Private Sub f_tester_IterationsEnd()
List1.AddItem "Iterations Ended " & Time
End Sub

See Also

IterationsBegin, PageEnd, PlaySuspended, ScriptBegin,


ScriptEnd

Appendix B: Programming Reference

415

LastDialogText Method

LastDialogText Method
Purpose

Returns the text from the last displayed dialog box.

Syntax

object.lastDialogText
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.

Member of

webanlst.rswEobj, mint.rswEobj, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a string containing the text.

Example 1

'Test Scriptlets and External Callout Tests


Dim DlgTextStr
DlgTextStr=rswObject.LastDialogText

Example 2

'Custom VBA Tests


Dim DlgTextStr as String
DlgTextStr=RSWApp.LastDialogText

See Also

416

LastDialogTitle

e-Tester User Guide

LastDialogTitle Method

LastDialogTitle Method
Purpose

Returns the title from the last displayed dialog box.

Syntax

object.lastDialogTitle()
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.

Member of

webanlst.rswEobj, mint.rswEobj, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a string containing the title.

Example 1

'Test Scriptlets and External Callout Tests


Dim DlgTitleStr
DlgTitleStr=rswObject.LastDialogTitle()

Example 2

'Custom VBA Tests


Dim DlgTitleStr as String
DlgTitleStr=RSWApp.LastDialogTitle()

See Also

LastDialogText

Appendix B: Programming Reference

417

Length Property

Length Property
Purpose

Gets the number of pages in the current Visual Script.

Syntax

object.property.length()
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.

Member of

RswIprogs.IProgPlay

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a Long.

Example 1

'Test Scriptlets and External Callout Tests


Dim scriptLen
scriptLen=rswObject.play.Length

Example 2

'External Program Control


Dim scriptLen As Long
scriptLen=f_tester.play.Length

See Also

ScriptLength

418

e-Tester User Guide

MatchHtml Method

MatchHtml Method
Purpose

Matches a string pattern in the HTML source of the specified frame.

Syntax

object.property.matchHtml(result$, [leftPattern$],
[rightPattern$ [frameNamePattern$])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

leftPattern$

A reference to the gen property of rswEObj,


ProgT, and ProgX. The gen property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A string used to store the result of the
pattern match. If you specify leftPattern$
and rightPattern$, result contains the
HTML in between the patterns.
Optional. The left side pattern to match.

rightPattern$

Optional. The right side pattern to match.

frameNamePattern$

Optional. A string that specifies the pattern


for the frame name from which to match the
HTML source. Use "" when the source is
not in a frame set.

property

result$

Appendix B: Programming Reference

419

MatchPattern Method

Member of

RswIprogs.Iprog, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.


leftPattern$, rightPattern$, and frameNamePattern$ use the
question mark (?) or asterisk (*) character in place of quotation marks
within leftPattern$, rightPattern$, and frameNamePattern$

text strings, as follows:

gen.matchHtml(myMatch, "<A href=?index.htm*>",


"</A>","")

Example

Dim retHtml, lPattern, rPattern, resultb


'match the HTML between "<*storemap*>" and "</A>"
lPattern = "<*storemap*>"
rPattern = "</A>"
resultb=rswObject.gen.matchHtml(retHtml, lPattern,
rPattern, "")
If not resultb Then
'handle no match
Else
'do something with HTML in retHtml
End If

See Also

GetParameters

MatchPattern Method
Purpose

This command is obsolete and should no longer be used. It is still


supported to maintain backward compatibility with existing external
callout tests.

Member of

webanlst.rswEobj, mint.rswEobj

420

e-Tester User Guide

Nav Property

Nav Property
Purpose

Property reference to the IprogNav class of the RswIprogs type


library.

Syntax

object.property.Nav([pageId])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

pageId

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
Optional. A variant that specifies the Visual
Script page number.

Member of

RswIprogs.IProgPlay

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Appendix B: Programming Reference

421

Nav Property

Example 1

'Test Scriptlets and External Callout Tests


Dim urlStr, resultb
resultb=rswObject.Play.Nav.GetRecordedUrl(urlStr)
If resultb Then
'URL Get Successful - string in urlStr
Else
'URL Get Failed
End If

Example 2

'External Program Control


Option Explicit
'Minimum Tester
'VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
'Full Tester
'VB Project>References = RSW e-Tester 4.0
'(Webanlst.exe)
'Dim WithEvents f_tester As webanlst.ProgT
Private Sub cmdCreateandStart_Click()
Dim resultb, PageOneUrlStr
Set m_tester = New mint.progX
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
resultb=m_tester.Play.Nav(1).GetRecordedUrl(
PageOneUrlStr)
List1.AddItem PageOneUrlStr
End Sub

See Also

422

Gen, Om, Play

e-Tester User Guide

Navigate Method

Navigate Method
Purpose

Navigates to the specified URL and frame with optional post data and
headers.

Syntax

object.property.navigate(url$,[targetFrame$],
[postdataStr$], [headers$])
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

url$
targetFrame$

postdataStr$

Appendix B: Programming Reference

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A string that specifies the destination
Uniform Resource Locator.
Optional. A string that specifies the name of
the target HTML frame in url$ in which
the navigation will take place.
Optional. A string that specifies the HTTP
post data to be sent to the server in the form:
name1=value1&name2=value2, etc.

423

Navigate Method

Parameter
headers$

Description

Optional. A string that specifies any


additional HTTP headers to send to the
server. The headers are in addition to
standard browser headers.

Member of

RswIprogs.Iprog, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.


Use this command to change the page flow of a Visual Script playback
based upon some condition detected in the custom test code.

Example 1

'Test Scriptlets and External Callout Tests


Dim sRecordedUrl, resultb, sNewUrl
sRecordedUrl = play.nav.getRecordedUrl
sNewUrl = "newpage.html"
If 'some condition requiring navigation change
resultb=rswObject.gen.navigate(sNewUrl,"name=newpage",
"","")
Else If 'some condition to reset recorded navigation
resultb=rswObject.gen.navigate(sRecordedUrl,"","","")
End If

Example 2

'Custom VBA Tests


Dim sRecordedUrl As String
Dim resultb As Boolean
Dim sNewUrl As String
sRecordedUrl = play.nav.getRecordedUrl
sNewUrl = "newpage.html"
If 'some condition requiring navigation change
resultb=RSWApp.navigate(sNewUrl,"name=newpage",
"","")
Else If 'some condition to reset recorded navigation
resultb=RSWApp.navigate(sRecordedUrl,"","","")
End If

See Also
424

InsertNav

e-Tester User Guide

Om Property

Om Property
Purpose

Property reference to the IprogOM class of the RswIprogs type


library.

Syntax

object.om.method
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

method

The methods of the IprogOM class of the


RswIprogs type library and the RSWAppOm
class of the VBADLL type library.

Member of

mint.ProgX, webanlst.ProgT, webanlst.rswEobj,


VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

The methods of the Om property include FindDoc, FindElement,


FindElements, FindElementValue, FireEvent,
GetElementByPath, GetTopDocument, GetTopDocuments.

Appendix B: Programming Reference

425

Om Property

Example 1

'Test Scriptlets and External Callout Tests


Dim topdoc, urlStr, titleStr
Set topdoc=rswObject.om.GetTopDocument()
urlStr="URL: " & topdoc.url
titleStr="Title: " & topdoc.title
Call rswObject.TestLog(urlStr,"",titleStr)

Example 2

'Custom VBA Tests


Dim topdoc As Object
Dim urlStr As String
Dim titleStr As String
Set topdoc=RSWApp.om.GetTopDocument()
urlStr="URL: " & topdoc.url
titleStr="Title: " & topdoc.title
Call RSWApp.WriteToLog(urlStr,"",titleStr)

Example 3

'External Program Control


Dim topdoc As Object
Dim urlStr As String
Dim titleStr As String
Dim testerWin As String
testerWin = "0"
Set topdoc=f_tester.om.GetTopDocument(testerWin)
urlStr="URL: " & topdoc.url
titleStr="Title: " & topdoc.title
List1.AddItem urlStr
List1.AddItem titleStr

See Also

426

Gen, Nav, Play

e-Tester User Guide

OpenScript Method

OpenScript Method
Purpose

Opens the specified Visual Script.

Syntax

object.property.OpenScript(scriptName$)
Parameter
object

Description

property

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
A string that specifies the name of the Visual
Script to open.

scriptName$

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IprogPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Example

'External Program Control


Option Explicit
'Minimum Tester
'Select Visual Basic Project>References = mint
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub

Appendix B: Programming Reference

427

OpenWorkspace Method

Example
(cont'd)

See Also

Private Sub Command1_Click()


m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
End Sub
OpenWorkSpace, DoScript

OpenWorkspace Method
Purpose

Opens the specified Workspace.

Syntax

object.property.OpenWorkspace(scriptWorkspace$)
Parameter
object

Description

property

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
A string that specifies the name of the RSW
Workspace to open.

scriptWorkspace$

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IProgPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

428

e-Tester User Guide

PageBegin Event

Example

'External Program Control


Option Explicit
'Minimum Tester
Select Visual Basic Project>References = mint
'(RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
End Sub
Private Sub cmdDestroy_Click()
m_tester.gen.halt()
Set m_tester = Nothing
End Sub

See Also

OpenScript, DoScript

PageBegin Event
Purpose

The begin Visual Script page playback event.

Syntax

object_PageBegin(playIndex As Integer,
currentScriptName As String,
userErrNumber As Long,
userErrDescription As String)
Parameter
object

Description

playIndex%

The index number of the Visual Script page.

Appendix B: Programming Reference

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

429

PageBegin Event

Parameter
currentScript
Name$

Description

errNumber&

A page begin error number.

errDescription$

A page begin error description.

The name of the current Visual Script.

Member of

mint.ProgX, Webanlst.ProgT

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Used to execute code when playback of a Visual Script page begins.

Example

'External Program Control


Option Explicit
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub cmdStart_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
End Sub
Private Sub m_tester_PageBegin(playIndex As Integer,
currentScriptName As String, userErrNumber As Long,
userErrDescription As String)
List1.AddItem "Page Started " + CStr(playIndex)
End Sub

See Also

430

PageEnd, PlaySuspended, ScriptEnd

e-Tester User Guide

PageEnd Event

PageEnd Event
Purpose

The end Visual Script page playback event.

Syntax

object_PageEnd(playIndex As Integer,
currentScriptName As String,
playOutcomeNumber As Integer,
playOutcomeDescription As String,
playOutcomeActions As Long,
playErrTypeSet As Long,
lastDuration As Long,
errNumber As Long,
errDescription As String)
Parameter
object

Description

playIndex%

The index number of the Visual Script page.

currrentScript
Name$

The name of the current Visual Script.

playOutcome
Number%

The Visual Script page playback outcome


number. See the defined enumeration list at
the beginning of this appendix.
The Visual Script page playback outcome
description.
The Visual Script page playback outcome
actions.
The page playback error type setting. This is
a bit set that is used internally by e-Tester for
error reporting.
The duration of the last playback.

playOutcome
Description$
playOutcome
Actions&
playErrTypeSet&

lastDuration&

Appendix B: Programming Reference

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

431

PageEnd Event

Parameter
errNumber&

Description

errDescription$

A page end error description.

A page end error number.

Member of

mint.ProgX, Webanlst.ProgT

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Used to execute code when play back of a Visual Script page ends.

Example

'External Program Control


Option Explicit
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub cmdDestroy_Click()
m_tester.gen.halt()
Set m_tester = Nothing
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
End Sub
Private Sub m_tester_PageEnd(ByVal playIndex As
Integer, ByVal currentScriptName As String,
playOutcomeNumber As Integer, playOutcomeDescription
As String, playOutcomeActions As Long, playErrTypeSet
As Long, ByVal lastDuration As Long, errNumber As
Long, errDescription As String)
List1.AddItem "played page" + CStr(playIndex)
End Sub

See Also

432

PageBegin, PlaySuspended, ScriptEnd

e-Tester User Guide

PageUId Property

PageUId Property
Purpose

Returns the Page ID from the External Callout Properties dialog box.

Syntax

object.pageUId
Parameter
object

Description

An object variable. The following object is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.

Member of

mint.rswEobj, Webanlst.rswEobj

Applies To

U Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

#Thin Client

Remarks

Returns a string variant containing the ID of the current page.

Example

'External Callout Tests


Dim CurrentPageIdStr As String
CurrentPageIdStr = rswObject.PageUId

See Also

Postdata, ScriptName, Url

Appendix B: Programming Reference

433

PerformTest Event

PerformTest Event
Purpose

Executes code for Custom VBA tests.

Syntax

RSWVBATest_performTest()
Parameter
object

Description

An object variable. The following object is


valid:
E RSWVBATest used with Custom VBA
tests.

Member of

VBADLL.RSWVBATest

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

UThin Client

Remarks

The Custom Test Wizard automatically creates PerformTest events


for each custom test object.

Example

'Custom VBA Tests


Private Sub RSWVBATest_performTest()
Dim element As HTMLAnchorElement, valueStr As String
RSWApp.om.GetElementByPath "window[1].a[1]", element
If element Is Nothing Then
errDescription = "html object not found!"
errNumber = -1
Exit Sub
End If
valueStr = element.innerText
If valueStr <> "Support" Then
errDescription = "string comparison failure!"
errNumber = -1
Exit Sub
End If
errDescription = ""
errNumber = 0
Exit Sub
End Sub

See Also
434

ErrDescription, errNumber, RSWApp


e-Tester User Guide

Play Property

Play Property
Purpose

Property reference to the IProgPlay class of the RswIprogs type


library.

Syntax

object.play.method | property
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

method |
property

The methods and properties of the


IProgPlay class of the RswIprogs type
library.

Member of

mint.ProgX, webanlst.ProgT, webanlst.rswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

Remarks

The methods and properties of the Play property include


ChangeCurrentPage, CurrentPageNumber, DoPage, DoScript,
GetDataBank, GetDataBankValue, GotoPage, InsertNav,
IterateScript, Length, Nav, OpenScript, OpenWorkspace,
ReplaceNav, ResumeAfterTransitionEnd, SaveScript,
SetDataBankValue, SetOptions.

Appendix B: Programming Reference

435

PlaySuspended Event

Example 1

'Test Scriptlets and External Callout Tests


Dim scriptLen
scriptLen = rswObject.play.Length

Example 2

'External Program Control


Dim scriptLen As Long
scriptLen = f_tester.play.Length

See Also

Gen, Nav, Om

PlaySuspended Event
Purpose

The Visual Script page playback suspended event.

Syntax

object_PlaySuspended(playIndex As Integer,
currentScriptName As String,
errNumber As Long,
errDescription As String,
errTypeSet As Long)

Member of
436

Parameter
object

Description

playIndex%

The index number of the Visual Script page.

currentScript
Name$

The name of the current Visual Script.

errNumber&

A page suspended error number.

errDescription$

A page suspended error description.

errTypeSet&

The page playback error type setting. This is


a bit set that is used internally by e-Tester for
error reporting.

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

mint.ProgX, Webanlst.ProgT
e-Tester User Guide

Postdata Property

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Used to execute code when playback of a Visual Script page is


suspended.

Example

'External Program Control


Option Explicit
'Minimum Tester
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
End Sub
Private Sub m_tester_PlaySuspended(playIndex As
Integer, currentScriptName As String, errNumber As
Long, errDescription As String, errTypeSet As Long)
List1.AddItem "Page Suspended" + CStr(playIndex)
End Sub

See Also

PageBegin, PlaySuspended, ScriptEnd

Postdata Property
Purpose

This command is obsolete and should no longer be used. It is still


supported to maintain backward compatibility with existing external
callout tests.

Member of

mint.rswEobj, Webanlst.rswEobj

Appendix B: Programming Reference

437

Quit Method

Quit Method
Purpose

Close the full e-Tester application from external program control.

Syntax

object_Quit()
Parameter
object

Description

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

RswIprogs.IProg

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Used to close the full e-Tester application from external program


control.

Example

'External Program Control


Private Sub cmdDestroyFullTester_Click()
'Clear message and close the e-Tester application
List1.Clear
f_tester.gen.quit
Set f_tester = Nothing
'Write this info to the 'List1' form object
'after releasing the object variable
List1.AddItem "Full Tester Object Destroyed"
List1.AddItem "Tester Application Closed"
End Sub

See Also

438

PageBegin, PlaySuspended, ScriptEnd

e-Tester User Guide

ReplaceNav Method

ReplaceNav Method
Purpose

Replaces current Visual Script page navigation with the navigation


defined in the custom code.

Syntax

object.property.ReplaceNav(pageId)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

pageId

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A variant that specifies the page number to
continue with after finishing the custom
code.

Member of

rswIprogs.IprogPlay, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Appendix B: Programming Reference

439

RSWApp Property

Example

'Test Scriptlets and External Callout Tests


dim searchField, searchText, submitButton
'Indicate that we will replace the navigation
'for the previous page
play.replaceNav
'Map and bind the Visual Script variable "var_Search"
'to the "Search" field in the Data Bank file using
'the Data Bank wizard
'Get the Data Bank value from the Visual
'Script variable "var_Search"
'and store the value in "searchText"
Call play.GetDataBankValue("var_Search",searchText)
'Get the Search Input Element using FindElement
Set searchField=om.Findelement("search",
"INPUT","name")
'Set the Data Bank value to the Form field value
searchField.value=searchtext
'Get the Submit button Element using FindElement
Set submitButton=om.Findelement("submit",
"INPUT","type")
'Click the Submit button
submitButton.click

See Also

None

RSWApp Property
Purpose

Property reference to the RSWApp class of the VBADLL type library.

Syntax

RSWApp.method | property
Parameter
method |
property

Description

The methods and properties of the RSWApps


class of the VBADLL type library.

Member of

VBADLL.RSWVBAPage, VBADLL.RSWVBAScript,
VBADLL.RSWVBATest

Applies To

U Test Scriptlets
# Custom VBA Tests

440

U External Callout Tests


U External Programs
e-Tester User Guide

SaveScript Method

# Thin Client

Used With

# Thick Client

Remarks

The methods of the RSWApp property include ChangeNavigation,


CurrentPageNumber, ExecutingProduct, FindInHtml,
GetCookies, GetDataBankValue, GetHtml, GetParameterValues,
GetRecordedPostData, GetRecordedUrl, GoBack, GotoPage,
InsertNav, LastDialogText, LastDialogTitle, MatchHtml,
Navigate,om, ReplaceNav, ResumeAfterTransitionEnd,
ScriptLength, SetCookies, SetDataBankValue,
SetParameterValues, TimeToNavigate, WriteToLog.

Example

'Custom VBA Tests


Dim topdoc As Object
Dim urlStr As String
Dim titleStr As String
Set topdoc=RSWApp.om.GetTopDocument()
urlStr="URL: " & topdoc.url
titleStr="Title: " & topdoc.title
Call RSWApp.WriteToLog(urlStr, "" ,titleStr)

See Also

om

SaveScript Method
Purpose

Saves the Visual Script using the specified script name.

Syntax

object.property.SaveScript(scriptName$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

Appendix B: Programming Reference

441

SaveScript Method

Parameter
property

scriptName$

Description

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A string that specifies the name to use to save
the Visual Script.

Member of

rswIprogs.IprogPlay

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Example 1

'Test Scriptlets and External Callout Tests


rswObject.play.SaveScript("myScript1")

Example 2

'External Program Control


'Create the Full e-Tester Object
Private Sub cmdCreateFullTester_Click()
'Create a new instance of the full tester object
Set f_tester = New Webanlst.ProgT
List1.Clear
List1.AddItem "Full Tester created, not started"
End Sub
'Start the Full e-Tester
Private Sub cmdStartFullTester_Click()
f_tester.play.openWorkspace "RSWDemo"
f_tester.play.openScript "tutor1"
f_tester.play.doScript
List1.AddItem "Started " & Time & " " & Date
End Sub
'Save the Script
Private Sub cmdSaveScript_Click()
'Save as hardcoded name "myscript1" in RSWDemo
f_tester.play.SaveScript("myScript1")
End Sub

See Also
442

None
e-Tester User Guide

ScriptBegin Event

ScriptBegin Event
Purpose

The begin Visual Script playback event.

Syntax

object_ScriptBegin(iteration As long)
Parameter
object

Description

iteration%

The Visual Script playback iteration count.

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester.

Member of

Webanlst.ProgT

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

The ScriptBegin event is used to run custom code when playback


of Visual Script begins. The ScriptBegin event executes only once
when playback begins.

Example

'External Program Control


'Select VB Project>References = RSW e-Tester 4.0
Dim WithEvents f_tester As Webanlst.ProgT
Private Sub cmdCreate_Click()
Set f_tester = New Webanlst.ProgT
End Sub
Private Sub cmdStart_Click()
f_tester.play.openWorkspace "RSWDemo"
f_tester.play.openScript "tutor1"
f_tester.play.doScript "tutor1"
End Sub
Private Sub f_tester_ScriptBegin(iteration As Long)
List1.AddItem "Script Started " & Time
End Sub

See Also

PageEnd, PlaySuspended, ScriptEnd

Appendix B: Programming Reference

443

ScriptClose Event

ScriptClose Event
Purpose

Executes custom Visual Basic code after closing a Visual Script.

Syntax

object_ScriptClose()
Parameter
object

Description

An object. The following object is valid:


E RSWVBAScript used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAScript

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The ScriptClose event is used to run custom code after a Visual


Script is closed. You enter the code in the Visual Basic for
Applications environment using the e-Tester Custom Page
Programmability node. The ScriptClose event executes any code in
the procedure after closing the Visual Script.
e-Tester automatically creates the RSWVBAScript object and
ScriptClose event for the Visual Script in the Visual Basic
environment. You can add your own custom code to the event
procedure. The ScriptClose event executes only once when the
Visual Script is closed.

Example

'Custom VBA Script Tests


Private Sub RSWVBAScript_scriptClose()
Dim DateTime As String
DateTime = CStr(Date) + " at " + CStr(Time)
RSWApp.WriteToLog "RSWVBAScript", "", _
"Script Closed " + DateTime
End Sub

See Also

444

ScriptOpen, RSWApp

e-Tester User Guide

ScriptEnd Event

ScriptEnd Event
Purpose

The end Visual Script page playback event.

Syntax

object_ScriptEnd(currentScriptName As String,
playOutcomeNumber As Integer, playOutcomeDescription
As String, playMostSevereActionSet As Long,
playMostSevereErrTypeSet As Long, playSumOfDurations
As Long&)
Parameter
object

Description

currentScript
Name$

The name of the current Visual Script.

playOutcome
Number%

The Visual Script page playback outcome


number. See the defined enumeration list at
the beginning of this appendix.
The Visual Script page playback outcome
description.
The most severe playback action that
occurred. This is a bit set that is used
internally by e-Tester for error reporting
The most severe error type that occurred.
This is a bit set that is used internally by
e-Tester for error reporting
The sum of all Visual Script page playback
times.

playOutcome
Description$
playMostSevere
ActionSet&
playMostSevere
ErrTypeSet&
playSumOf
Durations&

An object variable. The following objects are


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

mint.ProgX, Webanlst.ProgT

Applies To

U Test Scriptlets
U Custom VBA Tests

Appendix B: Programming Reference

U External Callout Tests


# External Programs
445

ScriptEnd Event

U Thin Client

Used With

# Thick Client

Remarks

Used to execute code when playback of a Visual Script finishes.

Example

'External Program Control


Option Explicit
'Minimum Tester
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
End Sub
Private Sub m_tester_ScriptEnd(ByVal
currentScriptName As String, ByVal playOutcomeNumber
As Integer, ByVal playOutcomeDescription As String,
ByVal playMostSevereActionSet As Long, ByVal
playMostSevereErrTypeSet As Long, ByVal
playSumOfDurations As Long)
List1.AddItem currentScriptName + " Finished"
End Sub
Private Sub cmdDestroy_Click()
m_tester.gen.halt()
Set m_tester = Nothing
End Sub

See Also

446

PageBegin, PageEnd, PlaySuspended

e-Tester User Guide

ScriptLength Property

ScriptLength Property
Purpose

The number of pages in the Visual Script.

Syntax

object.ScriptLength
Parameter
object

Description

An object. The following object is valid:


E RSWApp used with Custom VBA tests.

Member of

VBADLL.RSWApp

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a Long representing the number of pages in the Visual Script.

Example

'Custom VBA Tests


Private Sub RSWVBAScript_endPlay()
Dim ScriptLen As String
ScriptLen = CStr(RSWApp.ScriptLength)
RSWApp.WriteToLog "RSWVBAScript", "", "Length = " _
+ ScriptLen + " Pages"
End Sub

See Also

None

Appendix B: Programming Reference

447

ScriptName Property

ScriptName Property
Purpose

Returns the name of the current Visual Script.

Syntax

object.ScriptName
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

Member of

mint.rswEobj, Webanlst.rswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns a string containing the name of the current Visual Script.

Example

'Test Scriptlets and External Callout Tests


Dim ScriptNameStr As String
ScriptNameStr = rswObject.ScriptName

See Also

448

PageUId, Postdata, Url

e-Tester User Guide

ScriptOpen Event

ScriptOpen Event
Purpose

Executes custom Visual Basic code upon opening a Visual Script.

Syntax

object_ScriptOpen(str As MSAPC.IApcStream)
Parameter
object

Description

An object. The following object is valid:


E RSWVBAScript used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAScript

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The ScriptOpen event is used to run custom code upon opening a


Visual Script. You enter the code in the Visual Basic for Applications
environment using the e-Tester Custom Page Programmability node.
The ScriptOpen event executes any code in the procedure when the
Visual Script is opened.
e-Tester automatically creates the RSWVBAScript object and
ScriptOpen event for the Visual Script in the Visual Basic

environment. You can add your own custom code to the event
procedure. The ScriptOpen event executes only once when the
Visual Script is opened.
Example

'Custom VBA Tests


Private Sub RSWVBAScript_scriptOpen(ByVal str As
MSAPC.IApcStream)
Dim DateTime As String
DateTime = CStr(Date) + " at " + CStr(Time)
RSWApp.WriteToLog "RSWVBAScript", "", _
"Script Opened " + DateTime
End Sub

See Also

RSWApp, ScriptClose

Appendix B: Programming Reference

449

ScriptRename Event

ScriptRename Event
Purpose

Executes custom Visual Basic code upon renaming a Visual Script.

Syntax

object_ScriptRename()
Parameter
object

Description

An object. The following object is valid:


E RSWVBAScript used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAScript

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The ScriptRename event is used to run custom code upon saving a


Visual Script as a new name. You enter the code in the Visual Basic
for Applications environment using the e-Tester Custom Page
Programmability node. The ScriptRename event executes any code
in the procedure when the Visual Script is saved to a new name.
e-Tester automatically creates the RSWVBAScript object and
ScriptRename event for the Visual Script in the Visual Basic
environment. You can add your own custom code to the event
procedure. The ScriptRename event executes only once when the
Visual Script is saved as the new name.

Example

'Custom VBA Tests


Private Sub RSWVBAScript_scriptRename()
Dim DateTime As String
DateTime = CStr(Date) + " at " + CStr(Time)
RSWApp.WriteToLog "RSWVBAScript", "", _
"Script Renamed " + DateTime
End Sub

See Also

450

RSWApp, ScriptClose, ScriptOpen, ScriptSave

e-Tester User Guide

ScriptSave Event

ScriptSave Event
Purpose

Executes custom Visual Basic code upon saving a Visual Script.

Syntax

object_ScriptSave(str As MSAPC.IApcStream)
Parameter
object

Description

An object. The following object is valid:


E RSWVBAScript used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAScript

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The ScriptSave event is used to run custom code upon saving a


Visual Script. You enter the code in the Visual Basic for Applications
environment using the e-Tester Custom Page Programmability node.
The ScriptSave event executes any code in the procedure when the
Visual Script is saved.
e-Tester automatically creates the RSWVBAScript object and
ScriptSave event for the Visual Script in the Visual Basic
environment. You can add your own custom code to the event
procedure. The ScriptSave event executes only once when the
Visual Script is opened.

Example

Private Sub RSWVBAScript_scriptSave(ByVal str As


MSAPC.IApcStream)
Dim DateTime As String
DateTime = CStr(Date) + " at " + CStr(Time)
RSWApp.WriteToLog "RSWVBAScript", "", _
"Script Saved " + DateTime
End Sub

See Also

RSWApp, ScriptClose, ScriptOpen, ScriptRename

Appendix B: Programming Reference

451

SetBehaviour Method

SetBehaviour Method
Purpose

Excludes testing of specific resources while running e-Load Virtual


Users based upon URL patterns.

Syntax

object.SetBehaviour(behaviorName$, behaviorValue)
Parameter
object

Description

behaviorName$

A string that specifies the download


behavior. The following string is valid:
E xurlPatterns exclude the specified
URL patterns.

behaviorValue

A variant that specifies the exclusion pattern


values in the form:

An object variable. The following object is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.

array("pattern"[,"pattern"[,]]))

Member of

Webanlst.RswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Test


U External Program

Used With

U Thick Client

# Thin Client

Remarks

This is useful for having e-Load mask specific types of images from
downloading. Create a Visual Script with a Test Scriptlet Before
containing the SetBehaviour procedure in e-Tester, as follows:
call SetBehaviour("xurlPatterns",array("pattern"
[,"pattern"[,]]))

where pattern is any URL pattern using Visual Basic Like Operator
patterns. For example:
call SetBehaviour("xurlPatterns",array("*.gif"))

452

e-Tester User Guide

SetBehaviour Method

Use the Visual Script as an e-Load Virtual User Profile. Enable Use
Download Manager and Use Custom Test Cases. You can also set VU
Display Ready to view the results of the SetBehaviour setting.
Examples

The following are examples of the SetBehaviour procedure in a


Test Scriptlet.
The following setting masks all .gif images:
Call SetBehaviour("xurlPatterns",array("*.gif"))

The following setting masks all.gif and .jpg images:


Call SetBehaviour("xurlPatterns",array("*.gif",
"*.jpg"))

The following setting masks any .gif file containing s in the URL
and any .jpg with plant7.jpg at the end of the URL:
Call SetBehaviour("xurlPatterns",array("*s*.gif",
"*plant7.jpg"))

The following setting masks any .gif containing news in the URL

and any .jpg with plant7.jpg at the end of the URL:

Call SetBehaviour("xurlPatterns",array("*news*.gif",
"*plant7.jpg"))

The following setting masks any .gif containing newsxxx, such as


newsabc and news123 in the URL and any .jpg with plant7.jpg
at the end of the URL:
Call SetBehaviour("xurlPatterns",array("*news???.gif"
,"*plant7.jpg"))

See Also

None

Appendix B: Programming Reference

453

SetCookies Method

SetCookies Method
Purpose

Sets a cookie value for a specified URL.

Syntax

object.property.SetCookies(url$,cookies$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

url$

A reference to the gen property of rswEObj,


ProgT, and ProgX. The gen property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A string that specifies the URL of the page.

cookies$

A string that specifies the cookie to set.

property

Member of

rswIprogs.Iprog, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.

454

e-Tester User Guide

SetCookies Method

Example 1

'Test Scriptlets and External Callout Tests


If rswObject.gen.SetCookies(rswobject.url, _
"ZZZZZ=76")=True then
Call rswObject.TestLog(,, "Set OK")
End If

Example 2

'Custom VBA Tests


Dim url As String
url = "http://rsw066/index.htm"
If RSWApp.SetCookies(url, _
"ZZZZZ=76")=True then
Call RSWApp.WriteToLog(,, "Set OK")
End If

Example 3

'External Program Control


'Minimum Tester
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub Command1_Click()
Dim url As String
url = "http://rsw066/index.htm"
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
If m_tester.gen.SetCookies(url, _
"ZZZZZ=76")=True then
List1.AddItem "Set OK"
End If
End Sub
Private Sub cmdDestroy_Click()
m_tester.gen.halt()
Set m_tester = Nothing
End Sub

See Also

GetCookies

Appendix B: Programming Reference

455
455

SetCurrentDataBankRecord Method

SetCurrentDataBankRecord Method
Purpose

Sets the Data Bank record number.

Syntax

object.property.SetCurrentDataBankRecord(recNumber)
Parameter
object

Description

property

A reference to the play property of ProgT,


and ProgX. The play property is required
for External Program control.
A variant that specifies the Data Bank record
number.

recNumber

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

rswIprogs.IprogPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Example

'External Program Control


Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript ""tutor3"
m_tester.play.SetCurrentDataBankRecord(3)
m_tester.play.doScript "tutor3"
End Sub

See Also

456

GetDataBankSize, GetDataBankValue

e-Tester User Guide

SetDataBankValue Method

SetDataBankValue Method
Purpose

Sets the value of an internal Visual Script variable defined in the Data
Bank Wizard.

Syntax

object.property.setDataBankValue(dbName$, dbValue$)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

dbName$

dbValue$

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for Test Scriptlets, External Callout
tests, and External Program control.
property is not used with Custom VBA tests.
A string that specifies the name of an internal
Visual Script variable in the Data Bank
Wizard.
A string that specifies the value to set.

Member of

rswIprogs.IprogPlay, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

Appendix B: Programming Reference

# External Callout Tests


# External Programs

457

SetDataBankValue Method

U Thin Client

Used With

# Thick Client

Remarks

Returns True if successful, otherwise False.

Example 1

'Test Scriptlets and External Callout Tests


Dim searchField, searchText, submitButton, setDb
'Map the Visual Script variable "var_myValue"
'as an Internal variable using the Data Bank wizard
'Specify any Expression as the internal
'variable value
'Define value to set to the Visual Script variable
setDb="Mylogin" & CStr(Rnd(3))
'Set the value
call rswObject.play.SetDatabankValue("var_myValue",
setDb)
'Get the Data Bank value from the Visual
'Script variable "var_myValue"
'and store the value in "searchText"
call play.getdatabankvalue("var_myValue",searchText)
'Get the Search Input Element Object using FindElement
Set searchField=rswObject.om.Findelement("Search",
"INPUT","name")
'Set the Data Bank value to the Form field value
searchField.value=searchText
'Get the Submit button Element Object using FindElement
Set submitButton=rswObject.om.Findelement("submit",
"INPUT","type")
'Click the Submit button
submitButton.click

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_beforePlay()
Dim
Dim
Dim
Dim

searchField As Object
searchText As String
submitButton As Object
SetDb As String

'Map the Visual Script variable "var_myValue"


'as an Internal variable using the Data Bank wizard
'Specify any Expression as the internal
'variable value

458

e-Tester User Guide

SetDataBankValue Method

Example 2
(cont'd)

'Define some value to set to the Visual


'Script variable
SetDb = "Mylogin" & CStr(Rnd(3))
'Set the value
Call RSWApp.SetDataBankValue("var_myValue", SetDb)
'Get the Data Bank value from the Visual
'Script variable "var_myValue"
'and store the value in "searchText"
Call RSWApp.GetDataBankValue("var_myValue",searchText)
'Get the Search Input Element Object using FindElement
Set searchField = RSWApp.om.FindElement("Search", _
"INPUT", "NAME")
'Set the Data Bank value to the Form field value
searchField.Value = searchText
'Get the Submit button Element Object using
'FindElement
Set submitButton = RSWApp.om.FindElement("submit", _
"INPUT", "type")
'Click the Submit button
submitButton.click
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim
Dim
Dim
Dim

searchField As Object
searchText As String
submitButton As Object
setDb As String

'Map the Visual Script variable "var_myValue"


'as an Internal variable using the Data Bank wizard
'Specify any Expression as the internal
'variable value

Appendix B: Programming Reference

459

SetDataBankValue Method

Example 3
(cont'd)

'Define some value to set to the Visual


'Script variable
SetDb = "Mylogin" & CStr(Rnd(3))
'Set the value
Call f_tester.play.SetDataBankValue( _
"var_myValue", SetDb)
'Get the Data Bank value from the Visual
'Script variable "var_myValue"
'and store the value in "searchText"
Call f_tester.play.GetDataBankValue( _
"var_myValue",searchText)
'Get the Search Input Element Object using FindElement
Set searchField = f_tester.om.FindElement( _
"Search", "INPUT", "NAME")
'Set the Data Bank value to the Form field value
searchField.Value = searchText
'Get the Submit button Element using FindElement
Set submitButton = f_tester.om.FindElement( _
"submit", "INPUT", "type")
'Click the Submit button
submitButton.click
End Sub

See Also

460

GetDataBankValue

e-Tester User Guide

SetOptions Method

SetOptions Method
Purpose

Sets Visual Script options for external programmatic playback.

Syntax

object.property.SetOptions(option=value,
[option=value],[])
Parameter
object

Description

property

A reference to the play property of rswEObj,


ProgT, and ProgX. The play property is
required for External Program control.
A comma separated string that specifies the
options. The following options are valid
(case is significant for the option names):

options

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

ev_mindelay=seconds
ev_maxdelay=seconds
pb_timeout=seconds
vu_docallouts=True | False
vu_dousertests = True | False
vu_execvba=True | False
vu_maxpagedelay=seconds
vu_minpagedelay=seconds
vu_minimumdisplay=0|1
vu_playwithdatabank=0|1
vu_traceon=0|1

Member of

rswIprogs.IProgPlay

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns True if successful, otherwise False.

Appendix B: Programming Reference

461

SetParameterValues Method

Example

'External Program Control


Option Explicit
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
m_tester.play.SetOptions("vu_docallouts=true,
vu_exevba=false")
End Sub
Private Sub cmdDestroy_Click()
Set m_tester = Nothing
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript
End Sub

See Also

None

SetParameterValues Method
Purpose

Sets the specified Parameter node value for the current page of the
Visual Script.

Syntax

object.property.setParameterValues(paramNamePattern$,
paramValues)
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

462

e-Tester User Guide

SetParameterValues Method

Parameter
property

paramNamePattern$
paramValues

Description

A reference to the play.nav properties of


rswEObj, ProgT, and ProgX. The
play.nav properties are required for Test
Scriptlets, External Callout tests, and
External Program control.
property is not used with Custom VBA tests.
A string that specifies the parameter name
pattern.
A variant that specifies the parameter value
to set. For custom VBA tests, paramValues
is a collection.

Member of

rswIprogs.IprogNav, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns True if successful, otherwise False.


The paramName string can use Visual Basic Like operator pattern
matching.

Example

'Test Scriptlets and External Callout Tests


Dim paramName, paramValue, resultb
paramName="Search*"
paramValue="Lamps"
resultb=rswObject.play.Nav.setParameterValues(
paramName, paramValue)

See Also

GetDataBankValue, GetParameterValues

Appendix B: Programming Reference

463

StartPlay Event

StartPlay Event
Purpose

Executes custom Visual Basic code before starting Visual Script


playback.

Syntax

object_StartPlay()
Parameter
object

Description

An object. The following object is valid:


E RSWVBAScript used with Custom VBA
page tests.

Member of

VBADLL.RSWVBAScript

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

U Thin Client

Remarks

The StartPlay event is used to run custom tests for Visual Scripts.
You enter the code in the Visual Basic for Applications environment
using the e-Tester Custom Page Programmability node. The
StartPlay event executes any code in the procedure before the start
of Visual Script playback.
The StartPlay event executes only once at the beginning of Visual
Script playback.
e-Tester automatically creates the RSWVBAScript object and
StartPlay event for the Visual Script in the Visual Basic environment.
You can add your own custom code to the event procedure.

Example

'Custom VBA Script Tests


Private Sub RSWVBAScript_startPlay()
Dim ScriptLen as String
ScriptLen = Cstr(RSWApp.ScriptLength)
RSWApp.WriteToLog "# Script Pages", "", ScriptLen
End Sub

See Also

464

RSWApp, ScriptClose, ScriptOpen

e-Tester User Guide

StateOf Method

StateOf Method
Purpose

Checks the current of state of e-Tester for external programmatic play


back.

Syntax

object.gen.stateOf()
Parameter
object

Description

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

Member of

rswIprogs.IProg

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

The following constants are defined:


0=ET_IDLE
1=ET_NAVIGATING
2=ET_PLAYING_PAGE
3=ET_PLAYING_SCRIPT

Example

'External Program Control


'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
m_tester.play.SetOptions(pb_timeout="120")
End Sub
Private Sub Command1_Click()
dim et_state
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
et_state=m_tester.gen.stateof()
End Sub

See Also

None

Appendix B: Programming Reference

465

TestLog Method

TestLog Method
Purpose

Writes log messages to the e-Tester playback results log pane.

Syntax

object.TestLog([Action$],[Result$],[Summary$])
Parameter
object

Description

Action$

The string to write to the Action column of


the results log pane.
The string to write to the Result column of
the results log pane.
The string to write to the Summary column
of the results log pane.

Result$
Summary$

An object variable. The following objects is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.

Member of

mint.rswEobj, webanlst.rswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Use this procedure to write string values to the e-Tester results pane.

Example

'Test Scriptlets and External Callout Tests


Dim topdoc, numlinks, hrefVal, linkIndex
Set topdoc=om.getTopDocument()
numlinks=topdoc.links.length
For linkIndex = 0 to numlinks-1
hrefVal=topdoc.links(linkIndex).href
Call rswObject.TestLog("Link("+Cstr(linkIndex)+")",
"",hrefVal)
Next

See Also

466

WriteToLog

e-Tester User Guide

TimeToNavigate Property

TimeToNavigate Property
Purpose

Gets the amount of time it took for the current page to navigate.

Syntax

object.property.TimeToNavigate
Parameter
object

Description

An object variable. The following objects are


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.
E RSWApp used with Custom VBA tests.
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the

minimum tester (Thick Client agent).

property

A reference to the play.nav properties of


rswEObj, ProgT, and ProgX. The
play.nav properties are required for Test
Scriptlets, External Callout tests, and
External Program control.
property is not used with Custom VBA tests.

Member of

rswIprogs.IprogNav, VBADLL.RSWApp

Applies To

# Test Scriptlets
# Custom VBA Tests

# External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Returns a Long that indicates the time in milliseconds.

Example 1

'Test Scriptlets and External Callout Tests


Dim navTime
navTime = rswObject.play.nav.TimeToNavigate
Call TestLog("","", Cstr(navTime))

Appendix B: Programming Reference

467

TransitionEnd Event

Example 2

'Custom VBA Tests


Private Sub RSWVBAPage_afterPlay()
Dim navTime As Long
navTime = RSWApp.TimeToNavigate
Call RSWApp.WriteToLog("", "", CStr(navTime))
End Sub

Example 3

'External Program Control


Private Sub f_tester_PageEnd(
ByVal playIndex As Integer, _
ByVal currentScriptName As String, _
playOutcomeNumber As Integer, _
playOutcomeDescription As String, _
playOutcomeActions As Long, _
playErrTypeSet As Long, _
ByVal lastDuration As Long, _
errNumber As Long, _
errDescription As String)
Dim navTime As Long
navTime = rswObject.play.nav.TimeToNavigate
List1.AddItem "Time to Navigate " + Cstr(navTime))
End Sub

See Also

None

TransitionEnd Event
Purpose

The Visual Script page playback transition end event.

Syntax

object_TransitionEnd(doc)

468

Parameter
object

Description

doc

A document object.

An object variable. The following object is


valid:
E user defined used with External
Program control. Dim the object variable
with Events as webanlst.ProgT for the
full e-Tester or as mint.ProgX for the
minimum tester (Thick Client agent).

e-Tester User Guide

TransitionEnd Event

Member of

mint.ProgX, Webanlst.ProgT

Applies To

U Test Scriptlets
U Custom VBA Tests

U External Callout Tests


# External Programs

Used With

# Thick Client

U Thin Client

Remarks

Used to execute code when a transition between Visual Script pages


ends.

Example

'External Program Control


Option Explicit
'Minimum Tester
'Select VB Project>References = mint (RSWMint.exe)
Dim WithEvents m_tester As mint.ProgX
Private Sub cmdCreate_Click()
Set m_tester = New mint.ProgX
End Sub
Private Sub cmdDestroy_Click()
m_tester.gen.halt()
Set m_tester = Nothing
End Sub
Private Sub Command1_Click()
m_tester.play.openWorkspace "RSWDemo"
m_tester.play.openScript "tutor1"
m_tester.play.doScript "tutor1"
End Sub
Private Sub m_tester_TransitionEnd(ByVal doc As
Object)
Dim docUrl
docUrl = doc.Url
List1.AddItem "Url: " + docUrl
End Sub

See Also

PageBegin, PageEnd, PlaySuspended, ScriptEnd

Appendix B: Programming Reference

469

URL Property

URL Property
Purpose

Gets the URL of the current page in the Visual Script.

Syntax

object.url

Parameter

Description

object

An object variable. The following objects is


valid:
E rswObject used with Test Scriptlets
and External Callout tests. object is
optional for Test Scriptlets.

Member of

mint.rswEobj, webanlst.rswEobj

Applies To

# Test Scriptlets
U Custom VBA Tests

# External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Returns a string containing the URL of the current page in the Visual
Script.

Example 1

Dim sUrl As String


sUrl = rswObject.url

Example 2

If rswObject.gen.SetCookies(rswobject.url, _
"ZZZZZ=76")=True then
Call rswObject.TestLog(,,"Cookie Set OK")
End If

See Also

PageUId, Postdata, ScriptName

470

e-Tester User Guide

WriteToLog Method

WriteToLog Method
Purpose

Writes log messages to the e-Tester playback results log pane.

Syntax

object.WriteToLog([Action$],[Result$],[Summary$])
Parameter
object

Description

Action$

The string to write to the Action column of


the results log pane.
The string to write to the Result column of
the results log pane.
The string to write to the Summary column
of the results log pane.

Result$
Summary$

An object variable. The following objects is


valid:
E RSWApp used with Custom VBA tests.

Member of

VBADLL.RSWApp

Applies To

U Test Scriptlets
# Custom VBA Tests

U External Callout Tests


U External Programs

Used With

# Thick Client

# Thin Client

Remarks

Use this procedure to write string values to the e-Tester results pane.

Example

'Custom VBA Tests


Dim topdoc As Object
Dim numlinks as Long
Dim hrefVal As String
Dim linkIndex As Long
Set topdoc=RSWApp.om.GetTopDocument(0)
numlinks=topdoc.links.length
For linkIndex = 0 to numlinks-1
hrefVal=topdoc.links(linkIndex).href
Call RSWApp.WriteToLog("Link("+Cstr(linkIndex)+")",
"",hrefVal)
Next

See Also

TestLog

Appendix B: Programming Reference

471

WriteToLog Method

[This page intentionally left blank]

472

e-Tester User Guide

Appendix C

HTML and DHTML Resources


This appendix lists the HTML elements and DHTML objects, collections,
and properties that can be used when creating Web pages. It is not a
complete HTML and DHTML reference. The lists are provided as a
convenient resource when using the e-Test Programming Interface (e-PI)
to create Test Scriptlets, Custom VBA tests, and External Callout tests for
Visual Scripts. See the links in the Web Resources section below for more
complete and detailed information about the Document Object Model,
HTML, and Dynamic HTML.

Web Resources
The following Web resources provide more information about Web page
development, Dynamic HTML, the Document Object Model, and Web
page scripting.
Microsoft Web Workshop
http://msdn.microsoft.com/workshop/default.asp

Document Object Model Introduction


http://www.w3.org/TR/REC-DOM-Level-1/introduction.html

Document Object Model Overview


http://msdn.microsoft.com/workshop/author/dom/domoverview.asp

DHTML Document Object Model


http://msdn.microsoft.com/workshop/author/om/doc_object.asp

DHTML References
http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtmlrefs.asp

DHTML Properties
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties.asp

473

Elements Defined by HTML

Elements Defined by HTML


The following table lists the Elements defined by HTML:

474

!DOCTYPE

ACRONYM

ADDRESS

APPLET

AREA

BASE

BASEFONT

BDO

BGSOUND

BIG

BLOCKQUOTE

BODY

BR

BUTTON

CAPTION

CENTER

CITE

CODE

COL

COLGROUP

COMMENT

custom

DD

DEL

DFN

DIR

DIV

DL

DT

EM

EMBED

FIELDSET

FONT

FORM

FRAME

FRAMESET

HEAD

Hn

HR

HTML

HTML Comment

IFRAME

IMG

INPUT

INPUT type=button

INPUT type=checkbox

INPUT type=file

INPUT type=hidden

INPUT type=image

INPUT type=password

INPUT type=radio

INPUT type=reset

INPUT type=submit

INPUT type=text

INS

ISINDEX

KBD

LABEL

LEGEND

LI

LINK

LISTING

MAP

MARQUEE

MENU

META

NOBR

NOFRAMES

NOSCRIPT

OBJECT

OL

OPTION

PARAM

PLAINTEXT
e-Tester User Guide

Objects Defined by Dynamic HTML

PRE

RT

RUBY

SAMP

SCRIPT

SELECT

SMALL

SPAN

STRIKE

STRONG

STYLE

SUB

SUP

TABLE

TBODY

TD

TEXTAREA

TFOOT

TH

THEAD

TITLE

TR

TT

UL

VAR

WBR

XML

XMP

Objects Defined by Dynamic HTML


The following table lists the Objects defined by Dynamic HTML:
!DOCTYPE

ACRONYM

ADDRESS

APPLET

AREA

attribute

BASE

BASEFONT

BDO

BGSOUND

BIG

BLOCKQUOTE

BODY

BR

BUTTON

CAPTION

CENTER

CITE

clientInformation

clipboardData

CODE

COL

COLGROUP

COMMENT

currentstyle

custom

dataTransfer

DD

DEL

DFN

DIR

DIV

DL

document

DT

EM

EMBED

event

external

FIELDSET

FONT

FORM

FRAME

Appendix C: HTML and DHTML Resources

475

Objects Defined by Dynamic HTML

FRAMESET

HEAD

history

Hn

HR

HTML

IFRAME

IMG

INPUT

INS

ISINDEX

KBD

LABEL

LEGEND

LI

LINK

LISTING

location

MAP

MARQUEE

MENU

META

navigator

NEXTID

NOBR

NOFRAMES

NOSCRIPT

OBJECT

OL

OPTION

PARAM

PLAINTEXT

PRE

RT

RUBY

rule

runtimeStyle

SAMP

screen

SCRIPT

SELECT

selection

SMALL

SPAN

STRIKE

STRONG

style

STYLE

stylesheet

SUB

SUP

TABLE

TBODY

TD

TEXTAREA

TextNode

TextRange

TextRectangle

TFOOT

TH

THEAD

TITLE

TR

TT

UL

userProfile

VAR

WBR

window

XML

XMP

476

e-Tester User Guide

Collections Exposed by Dynamic HTML

Collections Exposed by Dynamic HTML


The following table lists the Collections exposed by the Dynamic HTML
Object Model:
all

anchors

applets

areas

attributes

behaviorUrns

bookmarks

boundElements

cells

childNodes

children

controlRange

elements

embeds

filters

forms

frames

images

imports

links

mimeTypes

options

plugins

rows

rules

scripts

stylesheets

tBodies

TextRectangle

Properties in Dynamic HTML


The following table lists the Properties in the Dynamic HTML Object Model:
!important

@charset

@font-face

@import

@media

accessKey

action

activeElement

align

aLink

aLinkColor

alt

altHTML

altKey

appCodeName

appMinorVersion

appName

appVersion

autocomplete

availHeight

availWidth

background

backgroundAttachment

backgroundColor

backgroundImage

backgroundPosition

backgroundPositionX

backgroundPositionY

backgroundRepeat

balance

behavior

bgColor

bgProperties

border

borderBottom

borderBottomColor

Appendix C: HTML and DHTML Resources

477

Properties in Dynamic HTML

478

borderBottomStyle

borderBottomWidth

borderCollapse

borderColor

borderColorDark

borderColorLight

borderLeft

borderLeftColor

borderLeftStyle

borderLeftWidth

borderRight

borderRightColor

borderRightStyle

borderRightWidth

borderStyle

borderTop

borderTopColor

borderTopStyle

borderTopWidth

borderWidth

bottom

bottomMargin

boundingHeight

boundingLeft

boundingTop

boundingWidth

browserLanguage

bufferDepth

button

cancelBubble

canHaveChildren

caption

cellIndex

cellPadding

cellSpacing

checked

classid

className

clear

clientHeight

clientLeft

clientTop

clientWidth

clientX

clientY

clip

clipBottom

clipLeft

clipRight

clipTop

closed

code

codeBase

codeType

color

colorDepth

cols

colSpan

compact

complete

content

cookie

cookieEnabled

coords

cpuClass

cssText

ctrlKey

cursor

data

dataFld

dataFormatAs

dataPageSize

dataSrc

defaultCharset

defaultChecked

defaultSelected

defaultStatus

defaultValue

defer designMode

dialogArguments

dialogHeight

dialogLeft

dialogTop

dialogWidth

dir

direction

disabled
e-Tester User Guide

Properties in Dynamic HTML

display

documentElement

domain

dropEffect

dynsrc

effectAllowed

encoding

event

expando

face

fgColor

fileCreatedDate

fileModifiedDate

fileSize

fileUpdatedDate

filter firstChild

font

fontFamily

fontSize

fontSmoothingEnabled

fontStyle

fontVariant

fontWeight

form frame

frameBorder

frameSpacing

fromElement

hash

height

hidden

host

hostname

href

hspace

htmlFor

htmlText

httpEquiv

id

imeMode

indeterminate

index

innerHTML

innerText

isMap

isTextEdit

keyCode

lang

language

lastChild

lastModified

layoutGrid

layoutGridChar

layoutGridCharSpacing

layoutGridLine

layoutGridMode

layoutGridType

left

leftMargin

length

letterSpacing

lineBreak

lineHeight

link

linkColor

listStyle

listStyleImage

listStylePosition

listStyleType

loop

lowsrc

margin

marginBottom

marginHeight

marginLeft

marginRight

marginTop

marginWidth

maxLength

media

menuArguments

method

Methods

multiple

name

nameProp

nextSibling

nodeName

Appendix C: HTML and DHTML Resources

479

Properties in Dynamic HTML

480

nodeType

nodeValue

noHref

noResize

noShade

noWrap

object

offscreenBuffering

offsetHeight

offsetLeft

offsetParent

offsetTop

offsetWidth

offsetX

offsetY

onLine

opener

outerHTML

outerText

overflow

overflowX

overflowY

owningElement

padding

paddingBottom

paddingLeft

paddingRight

paddingTop

pageBreakAfter

pageBreakBefore

palette

parent

parentElement

parentNode

parentStyleSheet

parentTextEdit

parentWindow

pathname

pixelBottom

pixelHeight

pixelLeft

pixelRight

pixelTop

pixelWidth

platform

pluginspage

port

posBottom

posHeight

position

posLeft

posRight

posTop

posWidth

previousSibling

propertyName

protocol

qualifier

readOnly

readyState

reason

recordNumber

recordset

referrer

rel

repeat

returnValue

returnValue

rev

right

rightMargin

rowIndex

rows

rowSpan

rubyAlign

rubyOverhang

rubyPosition

rules

scopeName

screenLeft

screenTop

screenX

screenY

scroll

scrollAmount

scrollDelay

scrollHeight
e-Tester User Guide

Properties in Dynamic HTML

scrolling

scrollLeft

scrollTop

scrollWidth

search

sectionRowIndex

selected

selectedIndex

selectorText

self

shape

shiftKey

size

sourceIndex

span

specified

src

srcElement

srcFilter

srcUrn

start

status

styleFloat

systemLanguage

tabIndex

tableLayout

tagName

tagUrn

target

text

textAlign

textAutospace

textDecoration

textDecorationLineThrough

textDecorationNone

textDecorationOverline

textDecorationUnderline textIndent

textJustify

textTransform

tFoot

tHead

title

toElement

top

topMargin

trueSpeed

type

unicodeBidi

uniqueID

units

updateInterval

URL

urn

useMap

userAgent

userLanguage

vAlign

vAlign

value

vcard_name

verticalAlign

visibility

vLink

vlinkColor

volume

vspace

whiteSpace

width

wordBreak

wordSpacing

wrap

XMLDocument

zIndex

Appendix C: HTML and DHTML Resources

481

Methods in Dynamic HTML

Methods in Dynamic HTML


The following table lists the Methods exposed by the Dynamic HTML
Object Model:

482

add

addBehavior

AddChannel

AddDesktopComponent

AddFavorite

addImport

addReadRequest

addRule

alert

appendChild

applyElement

assign

attachEvent

AutoCompleteSaveForm AutoScan

back

blur

clear

clearAttributes

clearData

clearInterval

clearRequest

clearTimeout

click

cloneNode

close

collapse

compareEndPoints

componentFromPoint

confirm

contains

createCaption

createControlRange

createElement

createRange

createStyleSheet

createTextNode

createTextRange

createTFoot

createTHead

deleteCaption

deleteCell

deleteRow

deleteTFoot

deleteTHead

detachEvent

doReadRequest

doScroll

duplicate

elementFromPoint

empty

execCommand

execScript

expand

findText

firstPage

focus

forward

getAdjacentText

getAttribute

getAttribute

getBookmark

getBoundingClientRect

getClientRects

getData

getElementById

getElementsByName

getElementsByTagName

getExpression

go

hasChildNodes

ImportExportFavorites

inRange

insertAdjacentElement

insertAdjacentHTML
e-Tester User Guide

Methods in Dynamic HTML

insertAdjacentText

insertBefore

insertCell

insertRow

isEqual

IsSubscribed

item

javaEnabled

lastPage

mergeAttributes

move

moveBy

moveEnd

moveRow

moveStart

moveTo

moveToBookmark

moveToElementText

moveToPoint

namedRecordset

navigate

NavigateAndFind

nextPage

open

parentElement

pasteHTML

previousPage

print

prompt

queryCommandEnabled

queryCommandIndeterm queryCommandState

queryCommandSupported

queryCommandValue

recalc

refresh

releaseCapture

reload

remove

removeAttribute

removeBehavior

removeChild

removeExpression

removeNode

removeRule

replace

replaceAdjacentText

replaceChild

replaceNode

reset

resizeBy

resizeTo

scroll

scrollBy

scrollIntoView

scrollTo

select

select

setAttribute

setCapture

setData

setEndPoint

setExpression

setInterval

setTimeout

ShowBrowserUI

showHelp

showModalDialog

showModelessDialog

splitText

start

stop

submit

swapNode

tags

taintEnabled

urns

write

writeln

Appendix C: HTML and DHTML Resources

483

Events in Dynamic HTML

Events in Dynamic HTML


The following table lists the Events are exposed by the Dynamic HTML
Object Model:
onabort

onafterprint

onafterupdate

onbeforecopy

onbeforecut

onbeforeeditfocus

onbeforepaste

onbeforeprint

onbeforeunload

onbeforeupdate

onblur

onbounce

oncellchange

onchange

onclick

oncontextmenu

oncopy

oncut

ondataavailable

ondatasetchanged

ondatasetcomplete

ondblclick

ondrag

ondragend

ondragenter

ondragleave

ondragover

ondragstart

ondrop

onerror

onerrorupdate

onfilterchange

onfinish

onfocus

onhelp

onkeydown

onkeypress

onkeyup

onload

onlosecapture

onmousedown

onmousemove

onmouseout

onmouseover

onmouseup

onpaste

onpropertychange

onreadystatechange

onreset

onresize

onrowenter

onrowexit

onrowsdelete

onrowsinserted

onscroll

onselect

onselectstart

onstart

onstop

onsubmit

onunload

484

e-Tester User Guide

Appendix D

Regular Expressions
A regular expression is a text pattern consisting of ordinary characters, such
as the letters A-Z, and special characters, known as metacharacters. These
characters define a pattern that will be compared to a body of text in order to
find a match. The regular expression is a template for matching a character
pattern to the string being searched.
Following are some examples of expressions:
JScript

VBScript
VBScript

Matches

/^\[\t]*$/

"^\[\t]*$"

Matches a blank line.

/\d{2}-\d{5}/

"\d{2}-\d{5}"

Validates an ID
number consisting of 2
digits, a hyphen, and
another 5 digits.

/<(.*)>.*<\/\1>/

"<(.*)>.*<\/\1>"

Matches an HTML
tag.

MetaCharacters
This appendix lists the metacharacters and how they work.
Character

Description

Marks the next character as either a special character, a


literal, a backreference, or an octal escape. For
example, 'n' matches the character n. '\n' matches
a newline character. The sequence '\\' matches \
and '\{' matches {

485

MetaCharacters

486

Character

Description

Only matches the position at the beginning of the string.


If the RegExp objects Multiline property is set, ^ also
matches the position following '\n' or '\r'.

Only matches the position at the end of the string. If


the RegExp object's Multiline property is set, $ also
matches the position preceding '\n' or '\r'.

Matches the preceding characters zero or more times.


For example, 'to*' matches t and too. * is
equivalent to {0,}.

Matches the preceding characters one more times. For


example, 'to+' matches to and too, but not t.
+ is equivalent to {1,}.

Matches the preceding subexpression zero or one


time. For example, 'to(es)?' matches the do in
to or toes. ? is equivalent to {0,1}.

{n}

Matches exactly n times, where n is a nonnegative


integer. For example, 'f{2,}' does not match the o
in often, but matches the two fs in suffer.

{n,}

Matches at least n times, where n is a nonnegative


integer. For example, 'a{2,}' does not match the a
in age and matches all the as in aaaaaaah.
'a{1,}' is equivalent to 'a+'. 'a{0,}' is equivalent
to 'a*'.

{n,m}

Matches at least n and at most m times. m and n are


nonnegative integers, where n <= m. For example,
'a{1,3}' matches the first three as in aaaaaaah.
'a{0,1}' is equivalent to 'a?'. Do not separate the
comma and the number with a space.

e-Tester User Guide

MetaCharacters

Character

Description

When this character immediately follows any of the


other quantifiers (*, +, ?, {n}, {n,}, {n,m}), the
matching pattern matches as little of the searched
string as possible, whereas the default pattern matches
as much of the searched string as possible. For
example, in the string aaaa, 'a+?' matches a single
a, while 'a+' matches all 'as.

Matches any single character except the newline


character. To match any character including the '\n',
use a pattern such as '[.\n]'.

(pattern)

Matches the pattern and captures the match. The


captured match can be retrieved from the resulting
Matches collection, using the SubMatches collection
in VBScript or the $0$9 properties in JScript. To
match parentheses characters (), use '\(' or '\)'.

(?:pattern)

Matches the pattern but does not capture the match,


that is, the match is not stored for possible later use.
This is useful for combining parts of a pattern using
the or character (|). For example,
'continu(?|al)' is a more economical expression
than 'continual|continuous'.

(?=pattern)

Positive lookahead matches the search string at any


point where a string-matching pattern begins. The
match is not captured for later use. For example,
'Windows(?=95|98|INT|2000)' matches
Windows in Windows 2000 but not Windows
in Windows 3.1. Lookaheads do not consume
characters, that is, after a match occurs, the search for
the next match begins immediately following the last
match, not after the characters that comprised the
lookahead.

Appendix D: Regular Expressions

487

MetaCharacters

488

Character

Description

(?!pattern)

Negative lookahead matches the search string at any


point where a string not matching pattern begins. The
match is not captured for possible later use. For
example, 'Windows(?!95|98|INT|2000)' matches
Windows in Windows 3.1 but does not match
Windows in Windows 2000. Lookaheads do not
consume characters, that is, after a match occurs, the
search for the next match begins immediately
following the last match, not after the characters that
comprised the lookahead.

x|y

Matches either x or y. For example, 'm|house'


matches m or house. '(m|h)ouse' matches
mouseor house.

[xyz]

A character set. Matches any one of the enclosed


characters. For example, '[abc]' matches the b in
absolute.

[^xyz]

A negative character set. Matches any character not


enclosed. For example, '[^abc]' matches the s in
absolute.

[a-z]

A range of characters. Matches any character in the


specified range. For example, '[a-z]' matches any
lowercase alphabetic character in the range a through
z.

[^a-z]

A negative range characters. Matches any character


not in the specified range. For example, '[^a-z]'
matches any character not in the range a through z.

\b

Matches a word boundary, that is, the position


between a word and a space. For example, 'ous\b'
matches the ous in raucous but not the ous in
house.

\B

Matches a non-word boundary. 'ous\B' matches the


ous in house but not the ous in raucous.
e-Tester User Guide

MetaCharacters

Character

Description

\cx

Matches the control character indicated by x. For


example, \cM matches a Control-M or carriage return
character. The value of x must be in the range of A-Z
or a-z. If not, c is assumed to be a literal c character.

\d

Matches any digit. Equivalent to [0-9].

\D

Matches any non-digit. Equivalent to [^0-9].

\f

Matches a form-feed character. Equivalent to \x0c


and \cL.

\n

Matches a newline character. Equivalent to \x0a and


\cJ.

\r

Matches a carriage return character. Equivalent to


\x0d and \cM.

\s

Matches any white space character including space,


tab, form-feed, etc. Equivalent to [\f\n\r\t\v].

\S

Matches any nonwhite space character. Equivalent to


[^\f\n\r\t\v].

\t

Matches a tab character. Equivalent to \x09 and \cI.

\v

Matches a vertical tab character. Equivalent to \x0b


and \cK.

\w

Matches any word character including underscore.


equivalent to '[A-Za-z0-9_]'.

\W

Matches any nonword character. Equivalent to '[^A-

Za-z0-9_]'.
\xn

Appendix D: Regular Expressions

Matches n, where n is a two-digit hexadecimal escape


value. For example, '\x41' matches A. '\x041' is
equivalent to '\x04' & 1. Allows ASCII codes to be
used in regular expressions.

489

MetaCharacters

490

Character

Description

\num

Matches num, where num is a positive integer. A


reference back to captured matches. For example,
'(.)\1' matches two consecutive identical characters.

\n

Identifies either an octal escape value or a


backreference. If \n is preceded by at least n captured
subexpressions, n is a backreference. Otherwise, n is
an octal escape value if n is an octal digit (0-7).

\nm

Identifies either an octal escape value or a


backreference. If \nm is preceded by at least nm
captured subexpressions, nm is a backreference. If \nm
is preceded by at least n captures, n is a backreference
followed by literal m. If neither of the preceding
conditions exist, \nm matches octal escape value nm
when n and m are octal digits (0-7).

\nml

Matches octal escape value nml when n is an octal


digit (0-3) and m and l are octal digits (0-7).

\un

Matches n, where n is a Unicode character expressed


as four hexadecimal digits. For example, \u00A9
matches the copyright symbol ().

e-Tester User Guide

Index
Accept
All Tested Pages, 15
Tested Page, 15, 156
ActiveX
.dll File, 134
Properties, 92
Visual Script Node, 77
Add
Authentication, 220, 221
Data Bank Mapping, 185
Data Bank Variable, 184
DHTML Event Handlers, 66
Dialog Information to List, 217
External Callout Test, 135
Form Element Test, 129
Path Generation Rule, 143
Server Response Test, 126
to Test Library, 117, 123
Add Script Comment
Menu Option, 10
Address
e-Spider, 174
Properties, 93
Visual Script Node, 77
Admin
Authentication Manager, 22021
Delete Log, 224
Delete Visual Script, 223
Delete Workspace, 223
Dialog Manager, 21319
Menu Option, 17
New Workspaces, 222
Options, 211
Test Library, 21113
After
afterPagePlay method, 134
Closing Netscape Script, 65
Delete cookie file after each run, 64
Opening Netscape Script, 64

Playback of Page, 98, 134, 135


Playing Netscape Script, 65
AfterPlay event, 318
All Details, 162
Always Invoke VBA IDE on VBA Errors,
62
AmIWAPScript method, 319
Anchor Transitions, 45
Anchors Node, 77
Append
Forms Pages to e-Spider, 39
Page to e-Spider Tree, 176
Page to Tree, 173
Page to Visual Script, 80
to Results Log, 161, 163
Applets
Using Data Banks, 201, 205
Arrow Icon, 78
ASCII files
Export Visual Scripts, 79
Assign Object Reference, 284
Authentication Manager
Add Record, 220, 221
Map Password to Variable, 220
Map User Name to Variable, 220
Menu Option, 17
Modify Record, 220, 221
Password, 220
Realm, 220
Remove Record, 220, 221
User Name, 220
Using, 22021
Variables, 221
Auto Bind, 187, 188
Auto Map, 187
Auto Pages, 46
Auto Save Visual Scripts, 26
Automatic Script Generation, 4
Automatic Test Generation, 2
491

Index

Automatic Tests, 8385


All Pages, 83
Existence Test, 85
Single Page, 84
Specific Node, 84
Automatically Dismiss Dialogs During
Playback, 61
Automatically Run Resource Validation
After Playback, 62, 88
AWT_keys, 206
AWT_textchange, 201
Back method, 320
Base Final Event on Index, 94
Basic Node Properties, 91
Before
beforePagePlay method, 134
Playback of Page, 98, 134, 135
Playing Netscape Script, 64
BeforeAction event, 322
BeforePlay event, 324
Browser
Errors, 169
Menu Option, 14
Options, 14, 27
Pane, 8, 21
Specific Visual Script, 25
Timeout, 27
Cancel property, 325
Caption, 215, 216
Capture Dialog Information, 217
Capture Original, 27
Capture Processed, 27
Change
Error Recovery Settings, 170
Script Pane Width, 75
Change Selected Item, 217
ChangeCurrentPage method, 327
ChangeNavigation method, 329
ChangeNavigation statement, 331
Checkmark Icon, 78
Class, 215, 216
Clear
Data Bank File, 186
Output Window, 10, 164
Close
Data Bank Wizard, 198
Dialog Manager, 214
492

e-Spider, 172
e-Tester, 9
Netscape, 65
Visual Script, 9
Workspace, 9, 30
Code View, 17
Collapse
Page, 10, 7576
Script, 10, 7576
COM Server
RSWIProgsLib.dll, 282, 304
RSWMint.exe, 282, 303
VBADLL.dll, 311
Webanlst.exe, 281, 299
Command Reference
AfterPlay, 318
AmIWAPScript, 319
Back, 320
BeforeAction, 322
BeforePlay, 324
Cancel, 325
ChangeCurrentPage, 327
ChangeNavigation, 331
ChangeNavigation, 329
CurrentPageNumber, 331
DoPage, 333
DoRegExpMatch, 334
DoScript, 335, 339
EndPlay, 340
ErrDescription, 341
ErrNumber, 343
Error Constants, 310
EventClass, 345
EventContext, 346
EventElem, 348
EventType, 350
ExecutingProduct, 352
FindDoc, 353
FindElement, 356
FindElements, 361
FindElementValue, 364
FindInHtml, 368
FireEvent, 370
Gen, 372
GetCookies, 374
GetCurrentVuId, 376
GetDataBank, 377
e-Tester User Guide

Index

GetDataBankSize, 379
GetDataBankValue, 380
GetDocuments, 383
GetElementByPath, 384
GetHtml, 387
GetOriginalHtml, 389
GetParameters, 390
GetParameterValues, 391
GetRecordedPostdata, 394
GetRecordedUrl, 397
GetTopDocument, 399
GetTopDocuments, 401
GoBack, 403
GotoPage, 404
Halt, 406
HasCustomTests, 407
Index, 408
InsertNav, 410
IProg Class, 304
IProgAction Class, 305
IProgNav Class, 306
IProgOM Class, 306
IProgPlay Class, 307
IterateScript, 412
IterationCount, 413
IterationsBegin, 414
IterationsEnd, 415
LastDialogText, 416
LastDialogTitle, 417
Length, 418
MatchHtml, 419
MatchPattern, 420
Nav, 421
Navigate, 423
Om, 425
OpenScript, 427
OpenWorkspace, 428
PageBegin, 429
PageEnd, 431
PageUId, 433
PerformTest, 434
Play, 435
Playback Results Constants, 309
PlaySuspended, 436
Postdata, 437
Product Constants, 317
ProgT Class, 300
Index

ProgX Class, 303


Quit, 438
ReplaceNav, 439
RSWApp, 440
RSWApp Class, 312
RSWAppOM Class, 314
RswEobj Class, 301
RSWEObj Class, 304
RSWIProgsLib.dll, 304
RSWMint.exe, 303
RSWVBAPage Class, 315
RSWVBAScript Class, 315
RSWVBATest Class, 316
SaveScript, 441
ScriptBegin, 443
ScriptClose, 444
ScriptEnd, 445
ScriptLength, 447
ScriptName, 448
ScriptOpen, 449
ScriptRename, 450
ScriptSave, 451
SetBehaviour, 452
SetCookies, 454
SetCurrentDataBankRecord, 456
SetDataBankValue, 457
SetOptions, 461
SetParameterValues, 462
StartPlay, 464
StateOf, 465
Status Constants, 311
TestLog, 466
TimeToNavigate, 467
TransitionEnd, 468
URL, 470
VBADLL.dll, 311
VBAGLobalObject Class, 317
Webanlst.exe, 299
WriteToLog, 471
Comments in Visual Script, 81
Comparison Exclusions
Menu Option, 16
Range of HTML Source, 74
Specific URL Parts, 71
Test Pattern Masks (Regular
Expression), 70
URL Parameter Values, 72
493

Index

URL Parameters, 71
URL Sub Paths, 72
User Defined Content Comparison
Filters, 70
Configure d-Tracker Server, 17
Content
Missing, 169
New, 169
Severe Changes, 169
Continue Spider, 173
Cookies
Delete Persistent Before Playback, 63
Properties, 94
Use Distinct Directory, 62
Visual Script Node, 77
Copy Element Path, 152
Copy Page, 10
Copy Page in Visual Script, 80
Current
Form Element Value, 128
Page for Server Response Test, 125
Record Number, 53, 185, 187
Record Only, 52, 62
Current Page menu option, 11
Current Path, 152
CurrentPageNumber method, 331
Custom Page Programmability
Visual Script Node, 77
Custom Test
Acceptable Parent Tags, 143
Boolean Properties, 144
Capture Page Element, 152
Choose Tag name, 143
Choose What to Test, 140
Current Path, 152
Databank Variables, 145, 146
Date Properties, 145
Insert, 138
Numeric Properties, 147
Path Generation Rules, 142, 143
Pattern Matching, 149
Properties, 96, 140
Property Name, 141
Property Value, 141
Regular Expressions, 149
Selected Path, 152
String Properties, 149
494

Test Error String, 138


Test Name, 138
Text, 140
Where to Execute, 138
Wildcards, 149
Wizard Generated Code, 15051
Wizard Options, 13749
Custom VBA Tests
Breakpoints, 275
Creating, 265
Custom Programmability Node, 265
Editing, 271
Error Handling, 271
Inheriting VBA Code, 271
Shared Code, 267
Sharing Code Between Visual Scripts,
272
Single Step, 275
Variables, 270
VBA Development Evironment, 272
View Locals, 274
Visual Script Obejct, 269
Visual Script Objects, 267
Visual Script Page Obejct, 268
Visual Script Projects, 267
Cut Page, 10
Data Bank Wizard, 183
Data Banks
Actual Data, 118
Add Mapping, 120, 185, 191
Add Variable, 120, 184, 190
Auto Bind, 187, 188
Auto Map, 187
Bindings, 121, 186, 197
Clear File Selection, 186
Create Files, 251
Current Record Number, 53, 185, 187
Data-Driven Test, 11823
Delete Variable, 185
Difference Between Play and Iterate,
210
End at Record, 53
Fetch Record, 122, 185, 187
Field Name, 187
Field Number, 187
Field Value, 187
Fields, 119, 186
e-Tester User Guide

Index

Files, 119, 188


Get Values, 251
Goto Record, 185, 200
Input Data, 118
Internal Variables, 191
Iterate, 52, 123
Iterate All Records, 52
Iterate Current Record, 52, 210
Iterate over Range, 53, 55, 199, 210
Iterate with, 52, 53
Iterate without, 52
Key Data Bank Variable, 206
Map Variables, 189
Mappings, 185
Menu Option, 11
Name, 53
Parameter Name, 185
Parameters, 184
Playback, 210
Playback Range, 199
Playback with, 53, 62
Playback without, 62
Recorded Value, 184, 185
Script Variables, 252
Select File, 186, 197
Specific Record, 200
Start at Record, 53
Tested Value, 185
Textchange Data Bank Variable Name,
202
Use All Records, 62, 210
Use Current Record Only, 62, 210
Variable Name, 185, 186
Variable Value, 185
Variables, 120, 184, 186
Verify Data-Driven Test, 11823
with Java Applets, 201, 205
Wizard, 4, 183
Default
to Script Name, 161
to Workspace Name, 161
Default Tests, 8385
All Pages, 83
Dont test (Item), 84
Error Recovery, 168
Single Page, 84
Specific Node, 84
Index

Define Object Variable, 283


Delay
Before Playback, 94
Between Iterations, 52
Constant, 67
Event Playback, 67
Maximum, 63
Play with Recorded, 63
Recorded, 67
Delete
Dialog Information, 214
Log File, 17, 167, 224
Menu Option, 10
Page from e-Spider, 173, 177
Persistent Cookies Before Playback, 63
Test from Library, 124
Test from Script, 124, 127
Variable, 185
Visual Script, 17, 82, 223
Visual Script Page, 81
Workspace, 17, 31, 223
Delete cookie file after each run, 64
DHTML, 67, 245
Event Handlers, 41
Recording Options, 65
Dialog
Action, 215, 217
Caption, 215, 216
Class, 215, 216
Evaluation Priority, 219
Specify information, 218
Text, 215, 216
Unexpected, 215
Dialog Manager
Action, 215, 217
Add to List, 217
Caption, 215, 216
Capture information, 214, 217
Change Priority, 214, 219
Change Selected Item, 217
Class, 215, 216
Delete Information, 214
Dialog List, 215
Edit Information, 219
Edit Menu, 214
Exit, 214
Fatal Error, 216, 217
495

Index

Menu Option, 17, 214


Priority, 215, 219
Save, 214
Select Dialog, 214, 217
Specify Dialog, 218
Start, 217
Text, 215, 216
Toolbar, 214
Using, 21319
Variables, 217
Discard
All Tested Pages, 15, 156
Tested Page, 15, 156
Do Not Log, 161
Document Objects
Accessing, 246
Find HTML Element, 248, 361
Getting, 246
in Frameset, 247
Match HTML Pattern, 249
Methods, 243
Properties, 243
Set Properties, 250
Top Document, 247, 399
Working with, 241
DoPage method, 333
DoRegExpMatch method, 334
DoScript method, 335, 339
Duration Node, 77
During e-Tester Start, 64
Dynamic HTML, 67, 245
Edit
Dialog Information, 219
Dialog Manager, 214
Menu Option, 10
Server Response Test, 127
Text Matching Test, 123
Visual Script, 8082
Elapsed Time, 158, 159
During Playback, 111
During Recording, 111, 126
e-Load
Menu option, 17
Quick Test, 17
e-Manager
Menu Option, 16
e-Monitor
496

Menu Option, 17
Notify on Error, 169
End
at Record, 53
Server Response Test on Page, 111,
125, 127
EndPlay event, 340
ErrDescription property, 341
ErrNumber property, 343
Error
External Callout Server, 136
Fatal Dialog Boxes, 216, 217
Number from Server, 98, 112
String from Server, 98, 112
Type, 169
Error Codes, 287
Error Constants, 310
Error Recovery
Browser Errors, 169
Change Settings, 170
Default Page Test, 168
Error Type, 169
External Callout Test, 168
Form Element Test, 168
Menu Option, 15
Missing Content, 169
Navigation Failure, 169
New Content, 169
Notify e-Monitor, 169
Options, 168
Page Timeout, 168
Resource Validation Test, 168
Server Response Tests, 168
Severe Content Changes, 169
Skip Remaining Iterations, 169
Skip Remaining Pages, 169
Text Matching Test, 168
e-Spider
Address, 174
Append Form Pages, 39
Append Page to Tree, 173, 176
Automatic Script Generation, 4
Basics, 17175
Continue, 173
Delete Page, 173, 177
Edit Menu, 173
Exclude URLs, 173, 178
e-Tester User Guide

Index

Exisitng Map File, 181


Export Site Map As, 172, 182
F Flag, 174
File menu, 172
Generate Visual Script, 173, 180
Help menu, 174
Ignore All but Current Page, 179
Ignore All Other Pages, 173
Ignore Page, 173, 179
Main window, 172
Map Files, 181
Map Tree, 174
Menu option, 16
Minus Icon, 174
Modify Excluded URL, 179
New Map, 181
New Site Map, 172
Node icons, 174
Open Site Map, 172
Pause, 176
Plus Icon, 174
Record Scripts, 38
Red border Flag, 174
Resume, 176
Run Menu, 173
Save Map, 40, 181
Save Map File, 40
Save Site Map, 172
Save Site Map As, 172
Start, 173, 175
Status Bar, 175
Stop, 173, 176
T Flag, 174
Tools Menu, 173
X Flag, 174
e-Test Programming Interface, 4, 225,
299
e-Tester
Automatic Test Generation, 2
Data Bank Wizard, 4
Features, 1
Installation, 7
Real Time Test Results Analysis, 5
Specialized Web Server Testing, 5
System Requirements, 6
Visual Scripts, 3
Event Failure, 68
Index

Event Handlers, 65
Event Name, 66
Event Recording, 16
EventClass property, 345
EventContext property, 346
EventElem property, 348
Events
Dynamic HTML, 67
Java, 67
Playback Options, 16, 67
Recording Options, 16
EventType property, 350
Exclude URLs, 173, 178
Execute Test, 110
ExecutingProduct property, 352
Existence Tests
Specific Node, 85
Existing Map File, 181
Existing Workspaces, 222
Exit
Dialog Manager, 214
e-Spider, 172
e-Tester, 9
Netscape, 65
Expand
Page, 10, 7576
Script, 10, 7576
Export
e-Spider Site Map, 172, 182
Resource Validation, 87
Results Log File, 166
Results Log Pane, 9, 163
Visual Scripts, 9, 79
Expression
Data Banks, 19197
Form Element test, 130
Extensibility
Client Types, 240
Data Bank Variables, 252
Data Banks, 251
Document Objects, 241, 246
DOM Methods, 243
DOM Properties, 243
Dynamic HTML Events, 245
HTML Elements, 248, 361
Level 1 Visual Scripts, 22728
Level 2 Data Banks, 22930
497

Index

Level 2 Test Cases, 22930


Level 3 Test Scriptlets, 23132
Level 4 Custom VB Code, 23234
Level 5 External Callout Tests, 235
Level 6 External Programs, 236
Overview, 227
Set Properties, 250
Web Page Objects, 246
External Callout Test, 13336
afterPagePlay, 134, 278
Basic Procedure, 276
beforePagePlay, 134, 277
Callout Server, 27980
ChangeNavigation statement, 331
Create .dll, 134
Determine Program ID, 135
Error, 133
Error Recovery, 168
GetHtml method, 387
GetOriginalHtml method, 389
GetParameters mehtod, 390
Insert into Script, 135
MatchPattern function, 420
Menu Option, 15
OLE Server, 133, 136
Options, 136
PageUId property, 433
Program Id, 133, 136
Properties, 97
Return Values, 281
RswIProgsLib.dll, 279
RSWSampl.cls, 134
RSWSample.vbp, 134
Sample Project, 276
ScriptName property, 448
Server Unavailable, 136
Status, 133, 136, 280
Test Server, 133, 136
URL property, 470
Visual Basic Project, 134, 276
External Program Control
Assign Object Reference, 284
Closing e-Tester, 285
Constants, 30911
Define Object Variables, 283
Error Constants, 310
Full Tester, 286
498

IProg Class, 304


IProgAction Class, 305
IProgNav Class, 306
IProgOM Class, 306
IProgPlay Class, 307
Minimum Tester, 286
Monitor Script Events, 285
Open workspace, 284
Play Back Script, 284
Playback Results Constants, 309
Product Constants, 317
ProgT Class, 281, 300
ProgX Class, 282, 303
Reference Object, 283
Release Object Variables, 285
RswEobj Class, 301, 304
RSWIProgsLib.dll, 282, 304
RSWMint.exe, 282, 303
Status Constants, 311
Using, 281
VBADLL.dll, 311
Webanlst.exe, 281, 299
External Window, 44
F Flag, 174
Failure Codes, 289
Failure Flag, 78
Failures Only, 162
Fatal Error, 216, 217
Fetch Record, 185, 187
Fields
Binding, 186, 197
Data Bank, 186
Name, 187
Number, 187
Value, 187
File
Data Bank, 186, 188, 197
Dialog Manager Menu, 214
e-Spider Map, 40, 181
e-Spider Menu, 172
Menu Option, 9
Netscape Script, 49, 58
Visual Script, 48
Find
Next Failure, 15, 154
Previous Failure, 15, 154
FindDoc method, 353
e-Tester User Guide

Index

FindElement method, 356


FindElements method, 361
FindElementValue method, 364
FindInHtml method, 368
FireEvent method, 370
Flags
in e-Spider Map, 174
in Visual Script, 78
Form Element Test, 12829
Error Recovery, 168
Expressions, 130
Insert into script, 129
Properties, 99, 100
Property Must Always be a Number,
128
Property Must Always be a String, 129
Property Must Always be Empty, 128
Property Must Always be in Range,
129
Property Must Equal Variable, 129
Property Must Satisfy Expression, 129
Test Expression, 129
Forms
Element Properties, 99
Element Test Properties, 100
Node Properties, 101
Visual Script Node, 77
Frames Node, 77
Framset, Getting Document Objects, 247
FTP API Error Codes, 295
Full Tester, 286
Gen property, 372
Generate
Netscape Scripts, 48
Visual Script in e-Spider, 173, 180
Generate Netscape Script menu option, 11
Generate Script for Load, 27
GetCookies method, 374
GetCurrentVuId method, 376
GetDataBank method, 377
GetDataBankSize method, 379
GetDataBankValue method, 380
GetDocuments procedure, 383
GetElementByPath method, 384
GetHtml method, 387
GetOriginalHtml method, 389
GetParameters method, 390
Index

GetParameterValues method, 391


GetRecordedPostdata method, 394
GetRecordedUrl method, 397
GetTopDocument method, 399
GetTopDocuments method, 401
Global Playback Options, 61
Go
Back, 14
Forward, 14
Home, 14
GoBack method, 403
Gopher API Error Codes, 295
Goto Record, 185, 187, 200
GotoPage method, 404
Halt method, 406
HasCustomTests method, 407
Help Menu, 18
Hide Results Log Pane, 162
Host Not Reachable, 103
HTML
Find Element, 248, 361
Find Element in Range, 249
Match Pattern, 249
Node Properties, 102
Set Properties, 250
Source, 102
Test On, 117
View Differences, 154
Visual Script Node, 77
HTML Capture, 27
HTTP API Error Codes, 296
Icons
Arrow, 78
Checkmark, 78
F Flag, 174
Minus Sign, 78, 174
Page, 78
Plus Sign, 78, 174
Red and Yellow Flag, 78
Red border, 174
Red Flag, 78
Red Flag w/Strip, 78
T Flag, 174
X Flag, 174
Yellow Flag, 78, 174
Ignore
All but Current Page, 179
499

Index

All Other Pages, 173


Failure-Flag Icon in Script, 78
Page in e-Spider, 173, 179
Page-Flag Icon in e-Spider, 174
Specific Failure, 157
Test Case, 157
Test-Flag Icon in Script, 78
Images
Available, 103
Host Not Reachable, 103
Link Not Reachable, 104
Node Properties, 103
Playback Value, 103
Unknown, 104
Visual Script Node, 77
Index property, 408
Information Codes, 287
Inherit VBA From, 9
Insert
Custom Test, 13
External Callout Test, 13, 135
Form Element Test, 13, 129
Server Response Test, 12, 126
Test Scriptlet After, 12, 131
Test Scriptlet Before, 12, 131
Text Matching Test, 12, 117
InsertNav method, 410
Installation, 7
Internet Error Codes, 291
Introduction, 1
Invoke Callout Function, 134
IProg Class, 304
IProgAction Class, 305
IProgNav Class, 306
IProgOM Class, 306
IProgPlay Class, 307
Iterate, 51
Current Record Number, 53
Data Bank Name, 53
Data Banks, 52, 123
Delay Between Iterations, 52
End at Record, 53
Menu Option, 12
Number of Iterations, 52
Over Range, 53
Start at Record, 53
Use All Records, 52
500

Use Current Record Only, 52


with Data Banks, 52, 53
without Data Bank, 52
Iterate menu option, 12
IterateScript method, 412
IterationCount method, 413
IterationsBegin event, 414
IterationsEnd event, 415
Java
Console, 14, 25
Data Bank Applets, 201, 205
Data Bank Key Listener, 206
Data Bank Textchange, 202
Event Playback Options, 67
Microsoft Applet Support, 68
Options, 16, 68
Sun Plugin Applet Support, 68
Java Applets
Node Properties, 104
Panel Properties, 107
Visual Script Node, 77
JavaScript Differences, 155
Key Data Bank Variable Name, 206
LastDialogText method, 416
LastDialogTitle method, 417
Launch Timeout, 65
Length property, 418
Links
Available, 105
Host Not Reachable, 105
Node Properties, 105
Not Reachable, 104, 106
Playback Value, 105
Unknown, 106
Visual Script Node, 77
Locate Test Result, 153
Logging Mode, 161
Logs
Append to, 163
Clear Window, 164
Delete File, 167, 224
Export to ASCII, 163, 166
File Name, 161
Hide Pane, 162
Options, 161
Overwrite File, 164
Save File, 164
e-Tester User Guide

Index

Show Pane, 162


View Saved File, 165
Main Window
Features, 8
Title bar, 8
URL Dropdown, 8
Manual Navigation, 43, 44
Manual Recording, 34
Map
Create New File, 181
Files in e-Spider, 181
Password to Variable, 220
Save Files, 181
User Name to Variable, 220
Variable to Script Parameter, 185, 191
MatchHtml method, 419
MatchPattern function, 420
Maximum
Delay (seconds), 63
Number of Threads, 90
Time Allowed for Playback, 111, 127
Menu Options
Accept All Tested Pages, 15
Accept Tested Page, 15
Add Script Comment, 10
Admin Menu, 17
Authentication Manager, 17
Browser Menu, 14
Browser Options, 14
Clear Output Window, 10
Close Script, 9
Close Workspace, 9
Code View, 17
Collapse Page, 10
Collapse Script, 10
Comparison Exclusions, 16
Configure d-Tracker Server, 17
Copy Page, 10
Cut Page, 10
Data Bank Wizard, 11
Delete, 10
Delete Logs, 17
Delete Scripts, 17
Delete Workspace, 17
Dialog Manager, 17, 214
Dimmed, 31
Discard All Tested Pages, 15
Index

Discard Tested Page, 15


Edit Menu, 10
e-Load, 17
e-Load Quick Test, 17
e-Manager, 16
e-Monitor, 17
Error Recovery, 15
e-Spider, 16
Event Playback, 16
Event Recording, 16
Expand Page, 10
Expand Script, 10
Export Output Log As, 9
Export Script As, 9
External Callout, 15
File Menu, 9
Find Next Failure, 15
Find Previous Failure, 15
Generate Netscape Script, 11
Go Back, 14
Go Forward, 14
Go Home, 14
Help Menu, 18
Inherit VBA From, 9
Insert Custom Test, 13
Insert External Callout Test, 13
Insert Form Element Test, 13
Insert Server Response Test, 12
Insert Test Scriptlet After, 12, 131
Insert Test Scriptlet Before, 12, 131
Insert Text Matching Test, 12
Iterate, 12
Java (options), 16
Modify Custom Test, 14
Modify Default Tests, 13
Modify External Callout Test, 13
Modify Form Element Test, 14
Modify Server Response Test, 13
Modify Test Scriptlet Before, 13
Modify Text Matching Test, 13
Navigate Manually, 11
Netscape, 16
New Script, 9
New Workspace, 17
Open Script, 9
Open Workspace, 9
Options Menu, 15
501

Index

Overview, 8
Page Snapshot, 11
Paste Page, 10
Playback, 12
Playback (options), 15
Playback Currrent Page, 12
Preferences, 16
Properties, 11
Record, 11
Record Currrent Page, 11
Resize Output Log View, 18
Resize Visual Script View, 18
Resource Validation, 12
Resource Validation (options), 16
Results Log, 16
Results Menu, 15
Run Menu, 11
Save Output Log As, 9
Save Script, 9
Save Script As, 9
Script Comments, 9
Search the World Wide Web, 14
Show Applet Resource, 14
Show Java Console, 14
Start Playback, 12
Start Recording, 11
Stop (browser), 14
Stop Playback, 12
Stop Recording, 11
Switch to IE Baseline, 10
Switch to Netscape Baseline, 10
Test Library, 17
Tests Menu, 12
Tools Menu, 16
Up to Current Page, 12
View Results Log, 15
WAP Options, 16
WAP Script Recorder, 16
Window Menu, 18
Microsoft Development Environment,
261
Microsoft Java Applet Support, 68
Microsoft Script Debugger, 259
Microsoft Visual Basic IDE, 24, 265
Minimum Tester, 286
Minimum Time Allowed for Playback,
111, 126
502

Minus Icon, 78, 174


Modify
Authentication, 220, 221
Custom Test, 14
Default Tests, 13
Excluded URL, 179
External Callout Test, 13
Form Element Test, 14
Server Response Test, 13
Test Scriptlet Before, 13
Text Matching Test, 13
Move
Down, 214
Script Page, 80
Up, 214
Name of Data Bank, 53
Nav method, 421
Navigate Manually menu option, 11
Navigate method, 423
Navigation Failure, 169
Netscape
Close when Exiting e-Tester, 65
Delete cookie file after each run, 64
Exit After Closing Script, 65
Exit After Playing Script, 65
Exit when Opening IE Script, 65
Generate Visual Scripts, 11, 48
Launch Timeout, 65
Options, 16, 6465
Start After Opening Script, 64
Start Before Playing Script, 64
Start with e-Tester, 64
Switch to Netscape Baseline, 58
Wait for Activity, 65
New
Map File, 181
Path Generation Rule, 143
Site Map, 172
Visual Script, 9
Workspace, 17, 29, 222
Node Properties, 91
Viewing, 9091
Number of Iterations, 52
Number of Retries on Timeout, 61
Objects
Assign References, 284
Closing e-Tester, 285
e-Tester User Guide

Index

Define References, 283


Define Variables, 283
Release Variables, 285
OLE Server, 133
Om property, 425
Open
Netscape, 65
Site Map, 172
Visual Script, 9
Workspace, 9, 30
OpenScript method, 427
OpenWorkspace method, 428
Options
Event, 6768
Event Recording, 65
External Callout, 136
Java, 68
Menu Options, 15
Netscape, 6465
Playback, 61
Resource Validation, 89
Overwrite Log, 161, 164
Page
Append to Visual Script, 80
Copy in Visual Script, 80
Delete from Visual Script, 81
End Server Response Test on, 125
Move in Visual Script, 80
Node Properties, 106
Properties, 106
Request, 159
Response, 159
Retrieval, 126
Snapshot, 37
Specification, 111, 125
Start Server Response Test on, 125
Timeout, 168
Visual Script Icon, 78
Page Snapshot menu option, 11
PageBegin event, 429
PageEnd event, 431
Pages with META Refresh, 45
PageUId property, 433
Parameter
Data Banks, 184
Mapped to Variable, 108
Name, 185
Index

Properties, 108
Recorded Value, 108
Tested Value, 108
Use Default value on play back, 108
Visual Script Node, 77
Pass When, 116
Password, 220
Paste Page in Visual Script, 10
Path Generation Rules, 142
Pause e-Spider, 176
PerformTest event, 434
Play property, 435
Play with Recorded Delay Between Pages,
63, 159
Playback, 49
Always Invoke VBA IDE on VBA
Errors, 62
Automatically Dismiss Dialogs, 61
Automatically Run Resource
Validation After, 62
Comparison Exclusions, 6974
Current Page, 12
Delete Persistent Cookies Before, 63
Different URL, 57
Entire Visual Script, 50
Exclude a Range of HTML Source,
74
Exclude Specific URL Parts, 71
Exclude URL Parameter Values, 72
Exclude URL Parameters, 71
Exclude URL Sub Paths, 72
Iterations, 51
Maximum Delay (seconds), 63
Menu Option, 12
Multiple Times, 51
Netscape Script, 58
Number of Retries on Timeout, 61
Recorded Delay, 50
Results pane, 23, 59, 158
Skip Auto Pages in Thin Load, 63
Specific Data Bank Record, 55
Specific Script Page, 50
Start, 12
Start New Browser Session Before, 63
Stop, 12
Text Pattern Masks (Regular
Expression), 70
503

Index

Timeout on Page After, 61


Unexpected Windows and Dialogs, 60
Up to Current Page, 12
Use All Records, 62
Use Current Record Only, 62
Use Distinct Cookie Directory, 62
User Defined Content Comparison
Filters, 70
Value, 103
Viewing Results, 23, 59, 158
Visual Scripts, 49
with Data Bank, 52, 53, 62
with Recorded Delay Between Pages,
63
without Data Bank, 52, 62
Playback Current Page menu option, 12
Playback Options
Always Invoke VBA IDE on VBA
Errors, 62
Automatically Dismiss Dialogs, 61
Automatically Run Resource
Validation After Playback, 62
Data banks, 62
Delete Persistent Cookies Before
Playback, 63
Global Settings, 61
Maximum Delay (seconds), 63
Menu Option, 15
Number of Retries on Timeout, 61
Play with Recorded Delay Between
Pages, 63
Resource Validation, 88
Script Settings, 62
Skip Auto Pages in Thin Load, 63
Start New Browser Session Before
Playback, 63
Timeout on Page After, 61
Use All Records, 62
Use Current Record Only, 62
Use Distinct Cookie Directory, 62
with Data Bank, 62
without Data Bank, 62
Playback Results Constants, 309
PlaySuspended event, 436
Plus Icon, 78, 174
Postdata property, 437
Preferences
504

Menu Option, 16
Options, 26
Prepend Workstation Name, 161
Priority, 215, 219
Program Id, 133, 136
Programming
Access Top Document, 247, 399
Access Web Page Objects, 246
Client Types, 240
Data Bank Records, 254
Data Bank Values, 251, 253, 255
Document Objects, 243, 246
Document Objects Properties, 243
Dynamic HTML Events, 245
Find Element in Range, 249
Find HTML Element, 248, 361
Frameset Objects, 247
Match HTML Pattern, 249
Set Properties, 250
Test Scriptlets, 256
Test Scriptlets vs. Web Page, 257
Programming Interface, 4, 225, 299
ProgT Class, 281, 300
ProgX Class, 282, 303
Properties
Action, 101
Actions, 93
ActiveX, 92
Address, 93
After Playback of Page, 98
Attribute Name, 92, 104, 107
Attribute Value, 92, 104, 107
Available Images, 103
Available Link, 105
Base Final Event on Index, 94
Basic Node Properties, 91
Before Playback of Page, 98
Client Requests, 95
Cookies, 94
Current Value, 99
Custom Page Programmability
Properties, 96
Delay Before Playback, 94
Elapsed Time During Playback, 111
Elapsed Time During Recording, 111
Encoding, 101
End Test on This Page, 111
e-Tester User Guide

Index

Error Number from Server, 98, 112


Error String from Server, 98, 112
Execute Existence test, 91
Execute Validation Test, 103, 105
External Callout, 97
Form, 101
Form Element, 99
Form Element Test, 100
Host Not Reachable, 103, 105
HTML, 102
HTML Source, 102
Image, 103
Invoke External Callout, 98
Java Applet Panels, 107
Java Applets, 104
Link, 105
Link Not Reachable, 104, 106
Mapped to Variable, 108
Maximum Time Allowed for Playback,
111
Menu Option, 11
Method, 101
Minimum Time Allowed for Playback,
111
Name, 91
Page, 91
Page Identifier, 98
Page Properties, 106
Page Specification, 111
Parameter, 108
Playback Value, 103, 105
Property, 99
Recorded Duration, 94
Recorded Value, 108
Result, 91
Return Values, 98, 112
Script Node, 109
Script Source, 109
Selected Text, 113
Server Response, 110
Server Responses, 95
Start Test on This Page, 111
Target, 101
Test, 99
Test For, 113
Test Scriptlet, 112
Tested Duration, 94
Index

Tested Value, 108


Text Matching Test, 113
Time Specifications, 111
Title, 93
Transition Criteria, 94
Type, 91
Unknown image, 104
Unknown Link, 106
URL, 93
Viewing, 9091
WML nodes, 114
Proxy Server, 27
Quit method, 438
Realm, 220
Record
Anchor Transitions, 45
Auto Pages, 46
Current Page, 11
DHTML Event Handlers, 41, 65
External Window, 44
Generate Netscape Script, 48
Manual Navigation, 43
Manually, 34
Menu Option, 11
Navigate Manually, 11
Page Snapshot, 11, 37
Pages with META Refresh, 45
Start, 11
Stop, 11
Unexpected Windows and Dialogs, 60
User Authentication, 47
Visual Scripts, 3441
with e-Spider, 38, 17580
Record all list selections by index, 26
Recorded Duration, 94
Recorded Value, 185
Records
Current Number, 185, 187
Fetch, 185, 187
Goto Specific, 185, 187
Red Flag, 78
Redirection Codes, 288
Release Object Variables, 285
Remove
Authentication, 220, 221
Page from e-Spider, 177
Page from Script, 81
505

Index

Test from Library, 124


Test from Script, 124, 127
ReplaceNav method, 439
Request, 159
Resize
Output Log View, 18, 23, 59
Visual Script View, 18, 21
Resource Validation
Menu Option, 12
Options Menu, 16
Select from Results Log, 162
Resource Validation Test
Error Recovery, 168
Export Results, 87
For Every Host, 90
Maximum Number of Threads, 90
Options, 89
Playback Options, 88
Running, 8590
Specific Node, 89
Start Manually, 85
Timeout in Seconds, 90
Response, 159
Results Log
All Details, 162
Append to Log, 161, 163
Clear Output Window, 164
Column Headings, 158, 165
Default Script Name, 161
Delete File, 167, 224
Do Not Log, 161
Export, 163
Export Saved Files, 166
Failures Only, 162
File Name, 161
Hide Pane, 162
Logging Mode, 161
Menu Option, 16
Options, 161
Overwrite Log, 161, 164
Prepend Worksatation Name, 161
Report, 162
Save to File, 164
Select Resource Validation, 162
Select Script Page, 162
Show Pane, 162
Timelines, 159
506

Use Specified Name, 161


View Saved Files, 165
Workspace Name, 161
Results Menu, 15
Resume Spider, 176
Retain Variables Across Scripts, 26
Retry Event if Failed, 68
RSWApp Class, 312
RSWApp property, 440
RSWAppOM Class, 314
RswEobj Class, 301, 304
RSWIProgsLib.dll, 282, 304
RSWMint.exe, 282, 303
RSWSampl.cls, 134
RSWSample.vbp, 134
RswSpy, 60
RSWVBAPage Class, 315
RSWVBAScript Class, 315
RSWVBATest Class, 316
Run Menu, 11
Satisfy Expression, 129
Save
Auto Save Visual Scripts, 26
Dialog Information, 214
e-Spider Map File, 181
Output Log As, 9
Results Log, 164
Site Map, 172
Site Map As, 172
Visual Script, 9, 48
Visual Script As, 9
SaveScript method, 441
Script Comments, 9
Script Node
Properties, 109
Script Source, 109
Script Setting Playback Options, 62
Script Source, 109
ScriptBegin event, 443
ScriptClose event, 444
ScriptEnd event, 445
ScriptLength property, 447
Scriptlet Editing Pane, 22
ScriptName property, 448
ScriptOpen event, 449
ScriptRename event, 450
Scripts Node, 77
e-Tester User Guide

Index

ScriptSave event, 451


Search the World Wide Web, 14
Select Data Bank File, 186, 197
Select Dialog, 214, 217
Select Test Criteria, 128
Select Test From Library, 116, 124
Selected Path, 152
Selected Property, 128
Selected Text, 116
Absent, 116
Present, 116
Server Error Codes, 290
Server Response Test, 12527
Current Page, 125
Delete from Script, 127
Edit Attributes, 127
Elapsed Time During Playback, 111
Elapsed Time During Recording, 111
End Test on This Page, 111, 125
Error Recovery, 168
Execute Test, 110
Insert into Visual Script, 126
Maximun Time Allowed for Playback,
111
Minimum Time Allowed for Playback,
111
Name, 125
Page Specification, 111, 125
Properties, 110
Start Test on This Page, 111, 125
Time Specifications, 111
Server Status codes, 287
SetBehaviour method, 452
SetCookies method, 454
SetCurrentDataBankRecord method, 456
SetDataBankValue method, 457
SetOptions method, 461
SetParameterValues method, 462
Show Applet Resource, 14
Show Java Console, 14
Show Results Log Pane, 162
Site Map
Export, 172, 182
New, 172
Open, 172
Save, 172
Save As, 172
Index

Site Map Tree, 174


Skip
Remaining Iterations on Error, 169
Remaining Pages on Error, 169
Skip Test Flag, 78
Specify Comparison Condition, 128
Spider. See e-Spider
Start
at Record, 53
Dialog Manager, 217
e-Spider, 173, 175
Netscape, 64
New Browser Session Before Playback,
63
Server Response Test on Page, 111,
125, 126
Start Playback menu option, 12
Start Recording menu option, 11
StartPlay event, 464
StateOf method, 465
Status Bar, 23, 175
Status Constants, 311, 317
Stop
Browser, 14
e-Spider, 173, 176
Stop Playback menu option, 12
Stop Recording menu option, 11
Stripped Flags, 78
Success Codes, 287
Sun Plugin Applet Support, 68
Switch
to IE Baseline, 10
to Netscape Baseline, 10, 58
System Requirements, 6
T Flag, 174
Test Cases
Add Text Matching, 117
Add to Library, 123
Delete from Library, 124
Delete Server Response, 127
Delete Text Matching, 124
Edit Server Response, 127
Edit Text Matching, 123
External Callout, 13336
Form Element, 12829
Server Response, 12527
Text Matching, 11617
507

Index

Use from Library, 124


Verify Data-Driven Test, 118
Test Library
Add Test, 117, 123, 212
Delete Test, 124, 213
Menu Option, 17
Options, 212
Select Test, 116, 124
Using, 21113
Test on HTML, 117
Test Results
Accept Tested Pages, 156
All Details, 162
Append to Log, 161, 163
Clear Output Window, 164
Column Headings, 158, 165
Default Script Name, 161
Delete Log File, 167
Discard Tested Pages, 156
Do Not Log, 161
Export Results, 163
Export Saved Files, 166
Falilures Only, 162
Find Next Failure, 154
Find Previous Failure, 154
Form Element Test, 129
Hide Pane, 162
HTML Differences, 154
Ignore Specific Failure, 157
Ignore Test Case, 157
JavaScript Differences, 155
Locate in Script, 153
Log File Name, 161
Loging Mode, 161
Options, 161
Overwrite Log, 161, 164
Prepend Workstation Name, 161
Report, 162
Save to File, 164
Select Resource Validation, 162
Select Script Page, 162
Show Pane, 162
Summary, 158
Text Matching Test, 116
Timelines, 159
Use Specified Name, 161
VBScript Differences, 155
508

View Saved Files, 165


Workspace Name, 161
Test Results Log
Delete Log File, 224
Test Scriptlets
Debugging, 259
Detach Process, 264
Editing, 258
Error Handling, 258
MS Development Evironment, 261
MS Script Debugger, 259
Properties, 112
Scriptlet Editing Pane, 22
Single Step, 260, 264
Using, 256
Variables, 258
View Locals, 263
vs. Web Page Scripts, 257
Test Server, 133, 136
Tested Duration, 94
Tested Value, 185
TestLog method, 466
Tests Menu, 12
Tests Node, 77
Text Matching Test, 11617
Data-Driven Test, 11823
Delete from Script, 124
Edit Attributes, 123
Error Recovery, 168
Expected Results, 118
Insert into Script, 117
Properties, 113
Selected Text, 113
Test For, 113
Variables, 122
Textchange Data Bank Variable Name,
202
Think Time, 159
Time Specifications, 111
Timelines for Results, 159
Timeout
Event Failure, 68
Number of Retries, 61
Resource Validation, 90
Web Page, 61
TimeToNavigate property, 467
Toggle Script View, 75
e-Tester User Guide

Index

Toolbar
Browser Navigation Options, 14
Browser Type, 10
Data Bank Wizard, 11
Dialog Manager, 214
Dimmed, 31
Edit Options, 173, 214
Edit Options, 10
e-Spider, 16
File Options, 172, 214
File Options, 9
Help Options, 18
Playback Options, 12
Record Options, 11
Resize Output Log View, 18
Resize Visual Script View, 18
Resource Validation, 12
RSW e-Spider, 17274
Test Case Options, 12
Tools Menu, 16
TransitionEnd event, 468
Unexpected Windows and Dialogs, 60
Up to Current Page menu option, 12
URL Dropdown, 8
URL property, 470
Use All Records, 52, 62
Use Constant Delay, 67
Use Current Record Only, 52, 62
Use Distinct Cookie Directory, 62
Use Recorded Delay, 67
Use Specified Log Name, 161
User Authentication, 47
User Name, 220
Validation Tests
Export Results to File, 87
Maximum Number of Threads, 90
Maximum Timeout in Seconds, 90
Options, 89
Playback Options, 88
Running, 8590
Specific Node, 89
Start Manually, 85
Variable
Add, 190
Authentication, 221
Bind Data Banks, 197
Data Bank Binding, 186
Index

Delete, 185
in Dialog Manager, 217
in Text Matching Test, 122
Internal, 191
Map Data Banks, 189
Name, 185
Retain Across Scripts, 26
Value, 185
VBA
Development Environment, 265, 272
Inherit VBA From, 9
VBA Tests
RSWApp Class, 312
RSWAppOM Class, 314
RSWVBAPage Class, 315
RSWVBAScript Class, 315
RSWVBATest Class, 316, 317
VBADLL.dll, 311
VBAGLobalObject Class, 317
VBScript Differences, 155
View
Playback Results, 59
Resize Output Log, 18
Resize Visual Script, 18
Results Log, 15, 165
Visual Scripts, 75
Visual Scripts
Accept Tested Pages, 156
ActiveX Node, 77
ActiveX Properties, 92
Address Node, 77
Address Properties, 93
Always Invoke VBA IDE on VBA
Errors, 62
Anchors Node, 77
Append Page, 80
Arrow Icon, 78
Auto Pages, 46
Auto Save, 26
Automatic Tests, 8385
Automatically Dismiss Dialogs, 61
Automatically Run Resource
Validation After Playback, 62
Browser Specific, 25
Change Pane Width, 75
Checkmark Icon, 78
Collapse Tree, 7576
509

Index

Comments, 9, 81
Cookies Node, 77
Cookies Properties, 94
Copy Page, 80
Custom Page Programmability Node, 77
Custom Page Programmability
Properties, 96
Default Tests, 8385
Delete, 223
Delete Page, 81
Delete Persistent Cookies Before
Playback, 63
Delete Visual Script, 82
Discard Tested Pages, 156
Duration Node, 77
Edit Tree, 8082
Expand Nodes, 75
Expand Tree, 7576
Export to File, 79
External Callout Properties, 97
Find Next Failure, 154
Find Previous Failure, 154
Flag Icons, 19, 78
Form Element Properties, 99
Form Element Test Properties, 100
Form Node, 77
Form Properties, 101
Frames Node, 77
Generate Netscape Script, 48
HTML Differences, 154
HTML Node, 77
HTML Properties, 102
Ignore Specific Failure, 157
Ignore Test Case, 157
Image Properties, 103
Images Node, 77
Java Applet Node, 77
Java Applet Properties, 104
JavaScript Differences, 155
Link Properties, 105
Links Node, 77
Locate Failures, 154
Maximum Delay (seconds), 63
Minus Icon, 78
Modify Default Tests, 8385
Move Page, 80
Navigation, 239
510

Node Properties, 91
Node Types, 7778
Number of Retries on Timeout, 61
Overview, 3
Page Icon, 78
Page Properties, 106
Pages with META Refresh, 45
Panel Properties, 107
Parameter Properties, 108
Parameters Node, 77
Play with Recorded Delay Between
Pages, 63
Playback, 49, 50
Playback Iterations, 51
Playback Multiple Times, 51
Playback Netscape Script, 58
Playback On Different URL, 57
Playback Specific Page, 50
Playback Specific Record, 55
Playback with Data Bank, 53, 62
Playback with Recorded Delay, 50
Playback without Data Bank, 62
Plus Icon, 78
Popup Menu, 20
Programming, 238
Record, 3441
Record Anchor Transitions, 45
Red Flag, 78
Results Log, 23, 158
Results Timelines, 159
Saving, 48
Script Node Properties, 109
Scripts Node, 77
Select Page from Results Log, 162
Server Response Properties, 110
Skip Auto Pages in Thin Load, 63
Start New Session Before Playback, 63
Stripped Flags, 19, 78
Switch to Netscape Baseline, 58
Test Scriptlet Properties, 112
Tests Node, 77
Text Matching Properties, 113
Timeout on Page After, 61
Type of Information, 77
Use All Records, 62
Use Current Record Only, 62
Use Distinct Cookie Directory, 62
e-Tester User Guide

Index

User Authentication, 47
VBScript Differences, 155
View Node Properties, 9091
View Pane, 19
with Client Types, 240
WML Properties, 114
Working with, 75
Yellow Flag, 78
Visual Test Results Analysis, 5
Wait for Activity, 65
WAP browser emulation, 16
WAP Options, 16
WAP Script Recorder, 16
Web Server Testing, 5
Webanlst.exe, 281, 299

Index

Window Menu, 18
WML nodes
Properties, 114
Workspaces
Add New, 29
Close, 30
Delete, 31, 223
Existing, 222
Name, 222
New, 29, 222
Open, 30
WriteToLog property, 471
X Flag, 174
Yellow Flag, 78, 174

511

Index

[This page intentionally left blank]

512

e-Tester User Guide

Вам также может понравиться