Você está na página 1de 120

USER GUIDE

e-Monitor User Guide


Version 5.1
Empirix, Inc.
Copyright 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 ...........................................................................................ix
Related Documentation....................................................................................x
e-TEST Suite Printed Manuals ...............................................................x
Other Printed Manuals ...........................................................................xi
Electronic Documentation.......................................................................xi
Conventions...................................................................................................xiii
Using Help ...................................................................................................xiii
Obtaining Technical Support .......................................................................xiv
Chapter 1

Introduction
Feature Highlights...........................................................................................2
Sophisticated Error Reporting.........................................................................2
System Requirements .......................................................................................3

Chapter 2

e-Monitor Basics
Installing and Starting e-Monitor....................................................................6
e-Test Console..................................................................................................7
e-Monitor Windows ........................................................................................7
Job Editor Window Features ...................................................................8
Toolbar...............................................................................................9
Results Pane .......................................................................................9
Current Schedule Window Features ......................................................10
Job Summary Pane Features ...........................................................12
Current Job Window Features ...............................................................13
Status Bar .........................................................................................15

Contents

iii

Contents

Overview of the Monitor Menu Options...............................................15


e-Monitor Menu..............................................................................15
Job Editor Menu .............................................................................16
Chapter 3

Creating and Running Jobs


Using the e-Monitor Wizard ........................................................................17
Defining the Workspace and Scripts......................................................17
Specifying Job Notification Options ......................................................19
Specifying Log Window Messages ........................................................20
Specifying the Windows NT Event Log Message ................................21
Specifying Email Details.........................................................................22
Specifying Executable Details.................................................................23
Specifying the SNMP Message .............................................................24
Finishing the Job.....................................................................................25
Editing Jobs....................................................................................................25
Setting Advanced Email Options ...........................................................26
Changing the Severity Mapping.............................................................28
Importing e-Monitor Shell Scripts.........................................................29
Running Jobs..................................................................................................30
Starting a Job Manually..........................................................................30
Viewing Job Reports ......................................................................................31
Submitting Bugs to d-Tracker................................................................32

Chapter 4

Working With Schedules


Adjusting the Schedule Display.....................................................................33
Creating Schedules.........................................................................................35
Editing Schedules...........................................................................................37
Schedule Menus.............................................................................................38
Right Click Menu in an Unscheduled Area ..........................................38
Right Click Menu on a Scheduled Job ..................................................39
Activating the Schedule..................................................................................39

iv

e-Monitor User Guide

Contents

Appendix A

Command Reference
Notification Variables.....................................................................................43
Script Execution and Event Triggering ........................................................44
Script Queue ....................................................................................44
Event Hierarchy...............................................................................44
Script File Names...........................................................................................44
Variables and Error Handling .......................................................................44
Variables ...........................................................................................45
Error Handling................................................................................45
Working With Visual Scripts and VBA in e-Monitor Jobs..........................46
Application Object .........................................................................................47
Result Object..................................................................................................48
ThisJob Object ...............................................................................................49
VisualScript Object ........................................................................................51
AppendLog Method......................................................................................52
ClearLog Method ..........................................................................................52
CurrentResult Property..................................................................................53
CurrentScriptName Property ........................................................................53
DatabankIndex Property................................................................................54
DatabankValue Method.................................................................................54
DoRV Method ...............................................................................................55
Email Method ................................................................................................57
ErrDescription Property ................................................................................58
ErrNumber Property .....................................................................................58
EventLog Method .........................................................................................59
Failure Event..................................................................................................59
FmtStr Function ............................................................................................60
GetValue Method...........................................................................................60
IterationsBegin Event ....................................................................................61
IterationsEnd Event.......................................................................................62
JobBegin Event ..............................................................................................62
JobEnd Event.................................................................................................63
JobName Property .........................................................................................63
LastDuration Property...................................................................................64
Log Method ...................................................................................................64
MsgBox Method ...........................................................................................65

Contents

Contents

Notifier Property ............................................................................................65


PageBegin Event............................................................................................66
PageEnd Event ..............................................................................................67
PageTitle Property .........................................................................................67
PageURL Property........................................................................................68
PlayIndex Property ........................................................................................68
RemoveValue Method ...................................................................................68
RunJob Method .............................................................................................70
RunNext Method...........................................................................................70
RunScriptNext Method.................................................................................71
SaveLog Method ...........................................................................................72
ScriptBegin Event ..........................................................................................72
ScriptEnd Event.............................................................................................73
ScriptName Property .....................................................................................73
SetNextRunDatabankIndex Method ............................................................74
SetValue Method............................................................................................74
SkipNextScript Method.................................................................................75
SNMPTrap Method .....................................................................................76
Status Property ...............................................................................................77
StopJob Method.............................................................................................77
StopSchedule Method....................................................................................78
StopScript Method.........................................................................................78
Workspace Property.......................................................................................78
Appendix B

Internet Status Codes


Server Status Codes........................................................................................79
Information Codes ...........................................................................79
Success Codes...................................................................................79
Redirection Codes............................................................................80
Failure Codes ...................................................................................81
Server Error Codes ..........................................................................82
Internet Codes ................................................................................................83
Internet Error Codes........................................................................83
FTP API Error Codes ....................................................................87
Gopher API Error Codes ................................................................87
HTTP API Error Codes ................................................................88
Additional Information ...........................................................................90

vi

e-Monitor User Guide

Contents

Appendix C

Converting e-Monitor 5.0 Shell Scripts


Overview.........................................................................................................92
Importing Shell Scripts ..................................................................................93
What is Imported ....................................................................................94
What is Not Imported.............................................................................94
Converting Custom Code ..............................................................................96
e-Monitor 5.0 to 5.1 Conversion Reference...........................................97
I n d e x ........................................................................................................103

Contents

vii

Contents

[This page intentionally left blank]

viii

e-Monitor User Guide

Preface
Welcome to the e-Monitor User Guide. This guide explains how to get
started using the features and options of e-Monitor for monitoring Web
sites or applications.
This guide is intended for Web test engineers who will be monitoring site
availability and reliability. The guide does require an understanding of
software or Web application testing concepts. Test engineers using
e-Monitor should be familiar with the concepts of regression testing, load
testing, scalability testing, and operational monitoring.
The monitoring paradigm of e-Monitor does not require any
programming experience to develop Visual Scripts, jobs, or schedules.
However, the advanced programmability features available in e-Monitor
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 appendix:
Chapter
Chapter 1 Introduction: provides an overview of the major features of

e-Monitor.
Chapter 2 ee-Monitor Basics: provides descriptions of the e-Monitor
main window features and menu options.
Chapter 3 Creating and Running Jobs: provides instructions and

explanations for using the e-Monitor Wizard to create jobs.


Chapter 4 Working With Schedules: provides

instructions on creating

and activating e-Monitor schedules.

ix

Preface

Appendix A Command 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-Monitor.

Internet Status Codes: provides a listing of server status


codes and Internet error codes.

Appendix B

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 eManager 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.
x

e-Monitor User Guide

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.
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:\RSW is the default).

xi

Preface

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 job 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
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-Test Suite Getting Started.pdf


e-Tester User Guide.pdf
e-Tester for WAP User Guide.pdf
e-Manager User Guide.pdf
e-Monitor User Guide.pdf
e-Load User Guide.pdf

WebReporter User Guide.pdf


e-Spider Tutorial.pdf
d-Tracker User Guide.pdf
d-Tracker Administrator Guide.pdf
readme.doc
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.

xii

e-Monitor User Guide

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

Description

Bold Sans Serif

Menu options and dialog box


selections.

Sans Serif

File names and Visual Script


nodes.

Fixed-Pitch type

Program code.

Arrow between menu options.

Select each option in sequence.

Using Help
e-Monitor provides a comprehensive online 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.

xiii

Preface

Obtaining Technical Support


If you have questions about e-Monitor, 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 725801 (8:30 - 18:00 GMT)
Japan: (03) 3791-2336

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.

xiv

e-Monitor User Guide

Chapter 1

Introduction
Your Web site is online and available to your customers twenty four hours
a day, seven days a week. The Web is an electronic door to your business
and is rapidly becoming a focal point for your customers to gain access to
your products and services.
Web sites can be comprised of a mix of software technologies and back-end
database systems, including HTML, Active-X, Java, and ASP. Any
combination of hardware or software problems can cause a Web site to fail.
e-Monitor is designed to provide continuous, comprehensive testing for
Web sites while they are in use. e-Monitor acts like a quality assurance
engineer, constantly testing and reporting failures in real time. e-Monitor
is capable of executing any sequence of Visual Scripts on a scheduled
basis, providing comprehensive regression testing, around the clock
while leveraging your investment in Visual Scripts.
e-Monitor is a companion product to e-Tester. It runs from the e-TEST
Console and allows you to automate play back of e-Tester Visual Scripts.

Feature Highlights

Feature Highlights
e-Monitor offers the following advantages for Web-based application
testing:

Comprehensive Web Site Monitoring


Monitoring for unauthorized changes in
content, business logic failures, and degraded Web server access time.

Job Wizard for grouping Visual Scripts into jobs.

Built in automatic error recovery and statistics gathering functions make


sophisticated monitoring tasks simple and efficient.

Easy integration with the Microsoft Application Event Log.

Extensive notification system alerts you instantly to Web site hardware


and software failures.

Seamlessly integrated with e-Tester, leveraging your investment in our

powerful Visual Scripts.

Visual Basic for Applications integration that allows you to create

custom scripts for execution on certain events.

Scripts can be generated for continuous 24 x 7 monitoring, periodic


daily testing, or batch regression testing.

Sophisticated Error Reporting


e-Monitor offers comprehensive error reporting and recovery features, as
follows:

Results and error logging to the e-Monitor log.

Automatic error recovery and statistics gathering functions.

Email notification of error events.

Ability to write to the Windows NT application event log.

Easy integration with third party system management and monitoring


tools, such as CA Unicenter and Tivoli, which can provide instant
notification of Web site hardware and software failures.
e-Monitor User Guide

System Requirements

System Requirements
The e-Test suite has the following system requirements:

Operating System: Microsoft Windows NT 4.0, Windows 2000, or


Windows 98 (e-Tester and e-Monitor only). The e-TEST suite is
NOT supported on Windows 95.

Recommended Memory: minimum 64 MB, 128 MB recommended

Disk Space: 100 MB

System: IBM-compatible PC with Pentium Pro or faster processor


recommended

Chapter 1: Introduction

System Requirements

[This page intentionally left blank]

e-Monitor User Guide

Chapter 2

e-Monitor Basics
This chapter explains how to use e-Monitor to schedule and automate
play back of e-Tester Visual Scripts. It explains how to install and start the
program and the features of the main window.
e-Monitor is tightly integrated with e-Tester. e-Monitor allows you to
group Visual Scripts together into jobs, then schedule when and how
often to run one or more jobs.
e-Monitor allows you to do the following:

Perform intelligent monitoring of Web pages or applications,


including execution of the Visual Script tests developed using e-Tester.

Group Visual Scripts together to create Jobs to monitor your Web


application or Web pages on a continuous basis.

Group Visual Scripts together to create Jobs to carry out unattended


regression and functional testing of your Web page or application.

Use the scheduling capabilities to specify when and how often a Jobs
should run.

Use the e-Monitor Wizard to generate jobs.

Add elegant error handling to your scripts with email notification on


problems with Web pages.

Add custom scripts using Visual Basic for Applications.

Installing and Starting e-Monitor

Installing and Starting e-Monitor


There are two ways that you can install e-Monitor:
http://www.empirix.com/products/download.html

1.

2.
3.

Download the product (ets##.exe) from the Web site and save it
to a temporary directory on your hard disk.

Unzip ets##.exe. and then run setup.exe to install e-TEST suite.

From the CD:

Insert the e-TEST suite CD into your computers CD-ROM drive.

In Windows, click Start Run and browse to the drive letter that
corresponds to the CD-ROM drive.

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

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


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

suite ee-Monitor to start e-Monitor.

e-Monitor User Guide

e-Test Console

e-Test Console
e-Monitor runs from the e-TEST Console, along with e-Load,
ServerStats, and e-Reporter.
The toolbars that are displayed in the Console window are based on the
application with which you are working and can be selected by clicking
the right mouse button and choosing the toolbar you want.
This chapter explains the e-Monitor menus and interface. Refer to the
appropriate manuals for the other menus and features.

e-Monitor Windows
The e-TEST Console main window is where you work with e-Monitor to
create jobs and schedules, activate and deactivate jobs, and view results of
jobs that have run. Following is a picture of the e-TEST Console with
only the toolbar buttons for e-Monitor displayed, and no open jobs or
schedules.

Chapter 2: e-Monitor Basics

e-Monitor Windows

e-Monitor has the following windows:


Job Editor Window lets you edit the job details, included the scripts that

comprise the job, error notifications, and severity mapping. You can also
manually run the job from this window.
Current Schedule Window lets you create and edit a schedule for

running jobs. It includes the Job Summary pane for displaying the results
of jobs that have been run.
Current Job Window lets you view the Visual Scripts and summary play

back information for the scripts in the current e-Monitor job. You can use
this window to view the progress of results of Visual Scripts being run by
the current jobs in a schedule.

Job Editor Window Features


The Job Editor window lets you view, change, and test e-Monitor jobs
created using the Monitor Wizard and add custom VBA code. The Job
Editor window consists of the title bar, toolbar, status bar, Job Tree pane,
and Options pane, as well as a menu accessed from the toolbar.
The Job Tree shows the name of the job, the Visual Scripts in the job, the
notification options, and the severity mapping. The Options pane shows
the options related to the selected job tree node. They include the same
script and notification options that are in the e-Monitor Wizard plus the
severity mapping settings.

e-Monitor User Guide

e-Monitor Windows

Toolbar
The Job Editor toolbar includes the following buttons:
Pulldown Menu displays the Job Editor options for saving and editing

jobs.
Save Job saves the job using the same name.
Test Job starts immediate play back of the Visual Scripts in the job.
Stop Job stops play back of the Visual Scripts in the job.
Clear Log clears the contents of the Results pane and the log file.
View Job Summary displays the latest e-Monitor Job Report in a

browser window.
View HTML displays the Virtual User Display for viewing Visual Script

page content during playback.


Edit VBA opens the Microsoft

Visual Basic Editor for adding custom


code to the Visual Script play back event handlers.

Edit Schedule makes the Current Schedule window active and displays

the Creating dialog box for adding a job to the schedule.

Results Pane
The Results pane shows any log messages generated during playback of
Visual Scripts.

Double-click on the top line to hide and show the details.

Chapter 2: e-Monitor Basics

e-Monitor Windows

Current Schedule Window Features


The Current Schedule window displays the scheduled jobs, past results,
and lets you edit the schedule. The window consists of the job tree that
lists the available jobs, a calendar that shows a grid displaying the
scheduled jobs, and the results pane on the bottom of the window that
shows the playback results.
You can adjust the Calendar to view all jobs scheduled for the week or
view jobs scheduled for a day. The following shows a sample week view.

10

e-Monitor User Guide

e-Monitor Windows

The following shows a sample day view. Use the scroll bar to view the
schedule for the next or previous day.

The Job Tree lists the available Workspaces and e-Monitor jobs. You can
expand or collapse workspace nodes to show or hide the jobs in the
Workspace.
To schedule a job, click on the job in the left pane and drag it onto the
schedule. The default is to schedule the job to run continuously all day on
the scheduled day. To adjust the schedule, double click on the job or right
click on the job and select Edit.
To view the time at which the job is scheduled to run, place the cursor
over the job.
To display the Job Editor window for a job, right-click on the job in the
job tree pane and select View Job.

Chapter 2: e-Monitor Basics

11

e-Monitor Windows

Job Summary Pane Features


The Job Summary pane of the Current Schedule window displays the
results of job playback when the schedule has been activated. While a job
is being run, the script being played back is displayed, as well as the last
and worst errors.

The Job Summary pane in the Current Schedule window has the
following options:
Job Name displays the name of the job. Double-click on the name to

display the Current Job window for any running job.


Iter displays the iteration being run.
Fail displays the number of failures.
Warn displays the number of warnings.
Status displays the name and page number of the Visual Script currently

being played back. Displays the last date and time when the job finishes.
Last Error indicates the last error encountered during job playback.
First Error indicates the first error encountered during job playback.
Show Job Details displays the Current Job window.
Clear Job Results clears the Last Error and Worst Error columns for the

selected job.
Show Job Log displays the job log in Notepad.
Show Job Report displays the e-Monitor job report in a browser

window.
Show Job HTML displays the Virtual User Display.

12

e-Monitor User Guide

e-Monitor Windows

The Job Summary pane also has the following right-click menu options:
Job Details displays the Current Job window.
Clear Job Results clears the Last Error and Worst Error columns for the

selected job.
Show Log displays the job log.
Show Job HTML displays the Virtual User Display.
Show Job Report displays the e-Monitor job report in a browser

window.
Remove Unscheduled Jobs removes jobs that are not scheduled from the

job list.
The e-TEST Console also writes the playback results for each iteration of
each job to a jobname.slg file. The log file is stored in the same Workspace
as the e-Monitor job file (.mjb).

Current Job Window Features


The Current Job window lists the Visual Scripts in the current e-Monitor
job with summary play back information for each Visual Script. The Job
pane includes a toolbar and results log. You can use the Current Job
window to view the progress or results of Visual Scripts being run by the
current jobs in the schedule.

Chapter 2: e-Monitor Basics

13

e-Monitor Windows

Double-click on the name of a job in the Job Results pane of the


Scheduler window to open the Current Job window for the job.

The Current Job window has the following toolbar buttons:


Stop Job stops play back of the Visual Scripts in the e-Monitor job.
Clear Log --

clears the contents of the e-Monitor log pane and log file.

View Job Report displays the e-Monitor Job Report in a browser

window.
View HTML displays the Virtual User Display for viewing Visual Script

page content during playback.


The jobs list includes the following columns:
Script Name displays the name of the e-Tester Visual Script.
Result displays whether the script playback passed or failed.
Duration (Seconds) displays the length of time required to play back the

Visual Script.
Summary displays a summary of the Visual Script playback results.

The log shows the playback results for the Visual Scripts in the job list.
Double-click on the top line of the results for a script to expand and
collapse the details.
14

e-Monitor User Guide

e-Monitor Windows

Status Bar
The status bar shows the current status of jobs and Visual Scripts in
e-Monitor. The status bar panes from left to right are as follows:
Job shows the current e-Monitor job status: Idle, Running, or

Stopping.
Visual Script shows the name and page number of the currently running
Visual Script.

Overview of the Monitor Menu Options


There are two menus for use with e-Monitor:

The e-Monitor menu on the e-TEST Console menu bar lets you work
with schedules and jobs.

The Job Editor menu lets you edit jobs.

e-Monitor Menu
These menu options let you work with jobs and schedules. The following
options are available:
New lets you create a new schedule or job.
New Schedule displays the Current Schedule window for creating a

new schedule.

New Job starts the e-Monitor wizard for creating a new job.
Open lets you open a schedule or job.
Open Schedule lets you open a previously created schedule.
Open Job lets you open a previously created job.
Save lets you save a schedule or job.
Save Schedule
Schedule saves the schedule using the current name.
Save Schedule As saves the schedule using a different name.
Save Job saves the job using the current name.
Save Job As saves the job using a different name.

Chapter 2: e-Monitor Basics

15

e-Monitor Windows

Activate Schedule activates the schedule when the Current Schedule

window is the active window.


Deactivate Schedule deactivates the schedule when the Current

Schedule window is the active window.


Configure Mail Server displays the e-Monitor Mail Server

Configuration dialog box for setting up the mail server. This must be
configured to send email notifications.
Import Shell Script lets you import a Shell Script to create a job.

Job Editor Menu


The Job Editor window has a menu that is accessed by clicking on the job
editor menu button. It allows you to save and edit jobs. The menu
contains the following options:
Save Job saves the job using the same name.
Save Job As saves the job using a different name.
Edit Scripts opens the Workspaces and Script screen of the Wizard in
the right pane of the Job Editor window for changing the list of Visual
Scripts contained in the e-Manager job.
Edit Notifications opens a dialog box in the right pane of the Job Editor

window for selecting the type of error notification you want to change.
Edit Severity Mapping opens the severity mapping information in the

right pane of the Job Editor window for changing the severity mapping,
which determines when scripts pass or fail.
Edit VBA opens the Microsoft

Visual Basic Editor for adding custom


code to the Visual Script play back event handlers.

Exit Closes the Job Editor window.

16

e-Monitor User Guide

Chapter 3

Creating and Running Jobs


The e-Monitor Wizard walks you through the steps required to build a
job that plays back multiple Visual Scripts created with e-Tester. You
select Visual Scripts and specify notifications for the job. After the job is
created, you can edit it and create severity mappings using the Job Editor
by selecting e-Monitor Open Open Job.
You can also create jobs by importing existing e-Monitor 5.0 or earlier
wizard-generated Shell Scripts into e-Monitor.

Using the e-Monitor Wizard


Click the e-Monitor New Job toolbar button or select e-Monitor New
New Job. e-Monitor opens the Welcome screen of the e-Monitor Wizard.
If you do not want the Welcome screen to appear each time you run the
e-Monitor wizard, check the Skip this screen in the future check box.
Click the Next button to continue to the Workspace and Scripts screen of
the e-Manager Wizard.
You can use the Back button at any time to return to a previous screen in the
Wizard.

Defining the Workspace and Scripts


The Workspace and Scripts screen of the e-Monitor Wizard is where you
specify the name of the job, the e-Tester Workspace, the Visual Scripts to
include in job, and the order in which they will be played back.

17

Using the e-Monitor Wizard

The Workspace and Scripts screen has the following options:

lists the Workspaces with Visual Scripts that can be


included in e-Monitor jobs. Select the Workspace and then select the
Visual Scripts. e-Monitor jobs can include Visual Scripts from multiple
Workspaces.

Script Selection

Workspace select the e-Tester Workspace containing the Visual

Scripts you want to include in the e-Monitor job.

Script select the e-Tester Visual Script(s) to include in the e-Monitor


job. Click Add or double-click the name to add the Visual Script to the
Script Order list.
Script Order lists the selected Visual Scripts and their Workspaces for
the e-Monitor job. Double-click the name to remove a Visual Script from
the list. Click the up or down arrow buttons to change the order of the
Visual Scripts in the list.
Data Banks enables or disables databank iteration. Databank iteration is
not enabled by default for each selected script. You can enable databank
iteration using all records or the current record by selecting the script, and
clicking the appropriate option buttons.

Click the Next button to continue to the Job Notifications screen of the
e-Monitor Wizard.
18

e-Monitor User Guide

Using the e-Monitor Wizard

Specifying Job Notification Options


The Job Notifications [Step 2a of 2] screen of the e-Monitor wizard is
where you select the actions that will occur when an error occurs during
script playback.
The Job Notification screen has the following options:

Log the Error writes an error message to the e-Monitor results log pane.

When this option is selected, the e-Monitor Wizard opens an additional


screen for specifying the log message when you click Next.
Write to the NT Event Log writes a message to the Windows NT Event

Log. When this option is selected, the e-Monitor Wizard opens an


additional screen for specifying the log message when you click Next.
Send Email sends an email message to a specified address providing

notification of the error. e-Monitor requires either a MAPI (Messaging


Application Programming Interface) or SMTP (Simple Mail Transport
Protocol) compliant email program to be installed to use the email option.
When this option is selected, the e-Monitor wizard opens an additional
screen for specifying the email address and message structure when you
click Next.

Chapter 3: Creating and Running Jobs

19

Using the e-Monitor Wizard

Launch an .Exe or .Bat File executes a specified program or batch file


when an error occurs. When this option is selected, the e-Monitor wizard
opens an additional screen for specifying the name, location, and
parameters for the file when you click Next.
Set SNMP Trap sends a message to an SNMP (Simple Network

Management Protocol) management service. When this option is


selected, the e-Monitor wizard opens an additional screen for specifying
the name, location, and parameters for the message when you click Next.
Click the Next button to continue to the next Error Handling screen of
the e-Monitor Wizard as determined by your error notification selections.

Specifying Log Window Messages


The Job Notifications Log Window [Step 2b of 2] screen of the
e-Monitor Wizard is where you specify the message to write to the log if
an error occurs during playback of the Shell Script.
This screen only appears if you selected the Log the Error option in the Job
Notifications screen of the Wizard.
The Job Notifications - Log Window screen has the following options:

20

e-Monitor User Guide

Using the e-Monitor Wizard

Log Message Format any text entered into this edit box will appear in
the log message. You can insert variables to pass details from the script
playback to the log message. See the Command Reference for more
information about using variables.

Click the Next button to continue to the next Error Handling screen of
the e-Monitor Wizard as determined by your error notification selections,
or click Finish.

Specifying the Windows NT Event Log Message


The Job Notifications Application Even Log [Step 2b of 2] screen of
the e-Monitor Wizard is where you specify the message to be sent to the
Windows NT Event log.
This screen only appears if you selected Write to the NT Event Log on the
Job Notifications screen of the wizard.
The Job Notifications Application Event Log screen has the following
options:

Windows NT Eventlog Message Format any text entered into this edit

box will appear in the log message. You can insert variables to pass details
from the script playback to the log message. See the Command Reference
for more information about using variables.
Chapter 3: Creating and Running Jobs

21

Using the e-Monitor Wizard

Click the Next button to continue to the next Error Handling screen of
the e-Monitor Wizard as determined by your error notification selections,
or click Finish.

Specifying Email Details


The Job Notifications Email [Step 2b of 2] screen of the e-Monitor
Wizard is where you specify the email addresses, and message to send if
an error occurs during playback of the job.
This screen only appears if you selected the Send Email option in the Job
Notifications screen of the Wizard. e-Monitor requires either a MAPI or
SMTP-compliant email program to be installed to use the email options.
The Job Notifications - Email screen has the following options:

Address specifies the addresses to which to send the message. Separate

multiple addresses either with a comma or semicolon.


Subject specifies the text to appear in the subject line of the email

message.
Message specifies the body of the email message. e-Monitor

automatically inserts a default set of text and variables that provide


information about the occurrence of play back errors.

22

e-Monitor User Guide

Using the e-Monitor Wizard

Click the Next button to continue to the next Error Handling screen of
the e-Monitor Wizard as determined by your error notification selections,
or click Finish.

Specifying Executable Details


The Job Notifications Launch [Step 2b of 2] screen of the e-Monitor
Wizard is where you specify the executable file and program argument(s)
to run if an error occurs during playback of a Visual Script.
This screen only appears if you selected the Execute .EXE or .BAT option in
the Job Notifications screen of the Wizard.
The Job Notifications - Launch screen has the following options:

Configure OnOn-Error Launch of Executable specifies the name of the

program or batch file to execute.


File Name enter a file name or use the Browse button locate a file.
Launch Argument Format specifies the program arguments to use when

launching the specified file. You can enter fixed arguments or pass
arguments from the script variables.
Click the Next button to continue to the next Error Handling screen of
the e-Monitor Wizard as determined by your error notification selections,
or click Finish.
Chapter 3: Creating and Running Jobs

23

Using the e-Monitor Wizard

Specifying the SNMP Message


The Job Notifications - SNMP [Step 2b of 2] screen of the e-Monitor
Wizard is where you specify the SNMP Message format.
This screen only appears if you selected the Set SNMP Trap option in the
Job Notifications screen of the Wizard.
The Job Notifications - SNMP screen has the following options:

SNMP Message Format any text entered into this edit box will appear in
the message. You can insert variables to pass details from the script
playback to the message. See the Command Reference for more
information about using variables.

Click the Next button to continue to the next Error Handling screen of
the e-Monitor Wizard as determined by your error notification selections,
or click Finish.

24

e-Monitor User Guide

Editing Jobs

Finishing the Job


When you click Finish, the Save Job As dialog box is displayed so that
you can save the job.
1.

Enter a name for the job and click Save. You will be prompted to
schedule the job.

2.

Click Yes. The Scheduling Job dialog box is displayed to add the job
to the Current Schedule, defaulting to the current time.

3.

Adjust the time as necessary and click OK.

You can now edit the job, run the job manually, or activate the schedule.

Editing Jobs
Once you have created a job, you can edit it using the Job Editor. The
Job Editor displays the same windows as the e-Monitor wizard. It also
allows you to change the severity mappings and test the job.
To edit a job, select e-Monitor Open Open Job to select a job and
open the Job Editor window, or right-click on the job in the job tree of the
Current Schedule window and select View Job.

By default, the job details are displayed in the right pane. Click on the
node in the Job Tree to display the options you want to change:
Chapter 3: Creating and Running Jobs

25

Editing Jobs

Scripts displays the Workspace and Scripts screen of the e-Monitor


wizard for changing the scripts included in the job, the script order, and
data bank iteration.
Notification displays a screen for selecting whether you want to change
log or email notification. This screen has the following options.
Log displays the error log notification screen of the e-Monitor wizard

for changing or adding a log message.

EventLog displays the Eventlog notification screen of the e-Monitor

wizard for changing or adding a Windows NT Event log message.

Email displays the email notification screen of the e-Monitor wizard

for changing or adding email notification when an error occurs. Click

Advanced to specify the type of failures for which a message should be

sent, and the information to send on failure.


Executable displays the executable job notification screen of the

e-Monitor wizard for changing or adding an executable.

SNMP displays the SNMP trap message notification screen of the

e-Monitor wizard for changing or adding a message.

Severity Mapping displays the severity mappings for script errors.

To save the changes select Save Job from the Job Editor menu.

Setting Advanced Email Options


The advanced email options allow you to specify the type of failures and
how many of them must occur before email notification is sent, as well as
the amount of detail to send about the failures.
Note: Email notification must be enabled and set up before you can set

advanced email options.


To set advanced email options:
1.

Display the job in the Job Editor window by selecting e-Monitor

Open Open Job.

26

e-Monitor User Guide

Editing Jobs

2.

Click Advanced under Notification in the left pane.

The following options are available:


Job Failure lets you select which job failures to report. Job Failure has

the following options:


Report all job failures reports all failures
Report start/stop of job failures reports only start/stop job

failures. You can set the number of times failure or success must
occur before notification is sent for failures and resolutions.

On failure lets you select the information to send when an error occurs
during playback. On failure has the following options:
Send job summary
summary sends the job summary report.
Send failure details sends details about the failure. You can select

whether to report each failure, the first page failure, or all failures
at job end.

3.

Select the type of job failures for which you want to send email.

4.

Select the type of report.

5.

Save the changes by selecting Save Job from the Job Editor menu.

Chapter 3: Creating and Running Jobs

27

Editing Jobs

Changing the Severity Mapping


The severity mapping determines the outcome result of the Visual Scripts
in the job when an error occurs. Each possible visual script error is
assigned a severity of pass, warning, fail, or error. When the error occurs,
this result is assigned to the script. Severity mapping can be set for the
following play outcomes:
UNKNOWN an unexpected error occurred.
FINE script playback was successful.
TIMEOUT script playback timed out.
STOPPED_BY_USER script playback was stopped by the user.
END_OF_AUTOPLAY page playback was successful.
STOPPED_BY_SHELL_USER playback was stopped programmatically

by the user.
STOP_ONERR the script stopped because there was a page error and the
script was set to stop on errors.
EXCEPTION an internal error occurred.
IE_DIALOG a browser dialog that was not dismissed stopped playback.
NAVIGATION_FAILED navigation to the next page failed.
FAILED_TESTS a text matching, server response, or VBA test failed.
IEI_NOT_FOUND playback failed because a browser window could not

be found.
PAGE_CHANGED the page is not the one expected by the tester.

28

e-Monitor User Guide

Editing Jobs

To change the severity mapping:


1.

Click Severity Mapping in the left pane or click the toolbar button.

2.

Click the drop down in the Severity column and select the severity
that you want to assign to the play outcome.
To assign the same severity to more than one error, click and drag
over the errors that you want to change, select the severity that you
want to assign, right click and select Apply ttoo selected rows.
Note: To restore the default severity mapping, right click to display
the menu and click Reset to Default Settings.

Importing e-Monitor Shell Scripts


Using the Job Editor, you can import e-Monitor 5.0 shell scripts into
e-Monitor jobs that you can then include in a schedule. Refer to
Appendix C, Converting e-Monitor 5.0 Shell Scripts, for more
information.
1.

Select e-Monitor
Monitor Import Shell Script.
Script

2.

Select the script you want to import and click the Open button. The
Workspace and Scripts screen of the e-Monitor wizard is displayed.

3.

Edit the list of scripts to be included in the job, if necessary and click
Next.

Chapter 3: Creating and Running Jobs

29

Running Jobs

4.

Edit the Job Notifications, if necessary and click Next.

5.

Click Finish to complete the job in the Wizard.

Running Jobs
Once you have created a job, you can run it immediately. Once you have
created a schedule, you can activate the schedule so that it runs the jobs at
the scheduled times.

Starting a Job Manually


Jobs can be run manually from the Job Editor window.
1.

Create an e-Monitor job and open it by selecting e-Monitor Open

Open Job.
2.

If you want to view the pages as they are run in the Virtual User
Display, click the View Error HTML button.

3.

Select the Test Job toolbar button.

e-Monitor plays back the Visual Scripts in the order listed, displaying the
details in the Results pane.

4.

30

Double click on the job name in the results pane to show and hide the
job details.

e-Monitor User Guide

Viewing Job Reports

Viewing Job Reports


e-Monitor displays the Job Report in a browser window. This report shows
the results of the last playback of the job.
1.

Create an e-Monitor job.

2.

Run the e-Monitor job.

3.

In the Job Editor window, select the View Job Report button.

e-Monitor creates an HTML report for each iteration of a job. They are
saved to an HTML file in the format jobname_yyyymmddhhmmss.html
(year, month, day, hour, minutes, seconds). The HTML job report files are
stored in the workspace with the e-Monitor job file (.mjb).

Failed scripts are displayed first followed by scripts that passed. The
report contains the following columns:
Script the name of the script.
Page Number the number of the page.
Error Description the reason why the script failed.
Time the date and time that the script was run.
d-Tracker a link to d-Tracker that allows you to submit a bug. Some

fields are automatically completed based on the error.


Chapter 3: Creating and Running Jobs

31

Viewing Job Reports

Duration the length of time the script, page, or job ran, in seconds.
Result the result, failed, passed, or warning.

A warning may occur when

a script is halted before it is finished running.

Submitting Bugs to d-Tracker


1.

View the job report by selecting View Job Report.

2.

Click on the submit link in the row of the error for which you want to
submit a bug. A browser window is opened for d-Tracker and a new
bug report is generated.

3.

Complete the bug report and click Submit


Submit.

You can also submit bugs to d-Tracker from the Virtual User Display.

32

e-Monitor User Guide

Chapter 4

Working With Schedules


e-Monitor allows you to easily create schedules that include multiple jobs
using the Current Schedule window. Once you have created the schedule,
you can activate it, causing the jobs to run at their scheduled times.
Jobs can be scheduled to run continuously between a specified time period
or at specific times. Only one schedule can be open or activated at any one
time.

Adjusting the Schedule Display


The Current Schedule window has two view modes: week view and day
view. To toggle between the two modes, right click on the schedule and
select Week View or Day View.
Week view shows a grid of the week. Scheduled jobs are represented
either by a vertical green bar or a horizontal bar that is green on the left
and red on the right. Placing the cursor over a bar displays the time the
job is scheduled. The job names are shown to the left of the grid.

33

Adjusting the Schedule Display

Following is a sample of the Current Schedule window in week view.

Day view shows each day separately. Use the scroll bar to move forward
and back through the week. The following is a sample of the Current
Schedule window in day view.

You can display the Job Editor window for a job by selecting a job in the
job tree, and selecting View Job from the right-click menu.
34

e-Monitor User Guide

Creating Schedules

Creating Schedules
To create a schedule:
1.

Select e-Monitor New New Schedule to display the Current


Schedule window.
The jobs are shown in the left pane and the schedule is shown in the
right pane.

2.

Click on the job name and drag it onto the schedule. By default, the
job is scheduled to run continuously for the entire day.

3.

Change the scheduled time by double-clicking on the job or right


clicking on the job and selecting Edit.

Chapter 4: Working With Schedules

35

Creating Schedules

4.

Select the days and frequency at which you want to run the job or
click Advanced for more options.

5.

Select the frequency with which you want to run the job.

6.

Click Ok.

7.

Save the schedule by selecting e-Monitor Save Save Schedule or


Save Schedule As. e-Monitor uses the default name of
Schedule<next number>.mjs.

36

e-Monitor User Guide

Editing Schedules

Editing Schedules
To edit a schedule:
1.

Make the Current Schedule window active to edit the schedule that is
currently open or select e-Monitor Open Schedule to edit another
schedule.
Note: Only one schedule can be open at any one time.

2.

To change an already scheduled time, double-click on the job or right


click on the job and select Edit.

Chapter 4: Working With Schedules

37

Schedule Menus

3.

Select the days and frequency at which you want to run the job or
click Advanced for more options.

4.

Select the frequency with which you want to run the job.

5.

Click OK.

6.

To add a new job, click on the job name and drag it onto the
schedule. By default, the Current Schedule window schedules the job
to run continuously for the entire day. Edit the frequency by doubleclicking on the job or right clicking on the job and selecting Edit.

6.

Delete jobs by right clicking on the job and selecting Delete.

7.

Save the schedule by selecting e-Monitor Save Save Schedule or


Save Schedule As. e-Monitor defaults to the existing name; however,
you can save the schedule using a different name.

Schedule Menus
The Current Schedule window has several right click menus. The menus
differ based on whether you click on a scheduled job or in any
unscheduled area. Following is a description of the menus:

Right Click Menu in an Unscheduled Area


The right click menu in an unscheduled area has the following options:
Create displays the creating dialog box for scheduling a job.

38

e-Monitor User Guide

Activating the Schedule

Week View displays all jobs scheduled for the week. This option is only

available in day view.


Day View displays the jobs scheduled for the current day. This option is

only available in week view.


Save Schedule saves the schedule using the current name. This option is

only available when the schedule has been changed and not saved.

Right Click Menu on a Scheduled Job


The right click menu for a scheduled job has the following options:
Edit displays the Scheduling Job dialog box, allowing you to change the
selected playback time.
Delete deletes the selected playback time from the schedule.
Week View displays all jobs scheduled for the week. This option is only

available in day view.


Day View displays the jobs scheduled for the current day. This option is

only available in week view.


Save Schedule saves the schedule using the current name. This option is

only available when the schedule has been changed and not saved.

Activating the Schedule


When you active a schedule, e-Monitor automatically starts the scheduled
jobs on the scheduled days and times. As the jobs are run, the results are
displayed in the Job Summary pane of the Current Schedule window.
1.

Open the schedule you want to activate by selecting e-Monitor


Open Open Schedule or make the Current Schedule window active
by clicking on its menu bar.

2.

Select e-Monitor Activate Schedule.

3.

If you want to view the pages as they are run in the Virtual User
Display, make the Job Editor window active and click on the toolbar
button or click the Show Error HTML button.

Chapter 4: Working With Schedules

39

Activating the Schedule

4.

To view the progress of the current job as it is playing back, doubleclick on the name of the job in the Job Results pane to open the
Current Job window for the job.

The Job Summary pane of the Current Schedule window displays the
current and cumulative information resulting from job playback when a
schedule is activated.

The Job Summary pane displays the following information for each job as
it is played back:
The Job Summary pane in the Current Schedule window has the
following options:
Job Name displays the name of the job.
Iter displays the iteration being run.
Fail
Fail displays the number of failures.
Warn displays the number of warnings.
Status displays the last date on which the job was run.
Last Error indicates the last error encountered during job playback.
First Error indicates the first error encountered during job playback.
Show Job Details displays the Current Job window.
Clear Job Results clears the Last Error and Worst Error columns for the

selected job.
Show Job Log displays the job log.
Show Job Report displays the e-Monitor job report in a browser

window.
Show Job HTML displays the Virtual User Display.
40

e-Monitor User Guide

Activating the Schedule

The Job Summary pane also has the following right-click menu options:
Job Details displays the Current Job window.
Clear Job Results clears the Last Error and Worst Error columns for the

selected job.
Show Log displays the job log.
Show Error HTML displays the Virtual User Display.
Show Job Report displays the e-Monitor job report in a browser

window.
Remove Unscheduled Jobs removes jobs that are not scheduled from the

job list.
While a script is running, you can display the Job Editor window by
right-clicking on the job in the job tree and selecting View Job.
To stop playing back jobs, select e-Monitor Deactivate
Deactivate Schedule.

Chapter 4: Working With Schedules

41

Activating the Schedule

[This page intentionally left blank.]

42

e-Monitor User Guide

Appendix A

Command Reference
e-Monitor includes several objects, events, methods, and properties that
you can use to add custom programming code to e-Monitor jobs and
access various Visual Script playback information. They are described in
the following sections.

Notification Variables
The following variables can be used for e-Monitor error notification
messages.
%Time - returns the time the error occurred.
%curWorkspace - returns the name of the workspace in which the

script is located.

%curScript - returns the name of the current Visual Script.


%curPage - returns the index of the current page of the Visual Script.
%curRecord - returns the number of the current Data Bank record

being used for playback of the Visual Script.

%errNumber - returns the number of the error that occurred during

playback of the Visual Script.

%errDescription - returns a description of the error that occurred

during playback of the Visual Script.

%job

- returns the name of the e-Monitor job.

43

Script Execution and Event Triggering

Script Execution and Event Triggering


Script Queue
Scripts are placed in a queue in the order in which they are to be executed.
When adding scripts to the queue using the runNext and runNextScript
methods, the script is added after the current script and executed when the
current script is finished. If you add multiple scripts, the last script added
is executed first. For example, if you have the scripts A, B, and C in the
queue, and you use insert script X while playing back script A, the queue
order will be A, X, B, C. If you then insert script Y, again while playing
back script A, the queue order will be A, Y, X, B, C. This means that if
you then use skipNextScript from script A, script Y will be removed
from the queue and the order will be A, X, B, C.

Event Hierarchy
The VisualScript and ThisJob objects share some of the same events.
In these cases, the events in ThisJob are fired before the events in
VisualScript. For example, if you modify the Result object in
ThisJob, it can still be modified by VisualScript.

Script File Names


Occasionally, VBA may display a file name error. VBA cannot handle
Visual Script file names longer than 31 characters and that contain certain
special characters. If you experience a file name error, open the Visual
Script in e-Tester and save it to a new file name. Note that using
Windows Explorer to change the file name may not fix the problem.

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.

44

e-Monitor User Guide

Variables and Error Handling

Variables
Variables are typed and must be declared. Variables can be procedurelevel, module-level, or global declarations.
Declare procedure-level variables using the Dim statement in the
procedure, as follows:
Private Sub ThisJob_Failure()
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 ThisJob, or
VisualScriptName module, as follows:
Dim myModuleVar as String
Private Sub ThisJob_Failure()
'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 your own module that you add to the project, as
follows:
Public myGlobalVar As String
Public Function MySharedFunc (ret As String)
'Procedure code
End Function

Error Handling
When creating Custom VBA code, you can add custom error handling to
procedures using the On Error statement, Visual Basic Err object, and
e-Monitor errDescription and errNumber properties, as follows:
Private Sub ThisJob_Failure()
On Error GoTo ERRLBL
'Code for Sub procedure
ERRLBL:
'Some Error Handling Code
'log the description
Notifier.Log currentresult.errDescription
End Sub

Appendix A: Command Reference

45

Working With Visual Scripts and VBA in e-Monitor Jobs

By default, run-time errors that occur during playback of a Monitor Job


will invoke the Visual Script or Job Failure Events in Visual Basic.
You can use the currentResult.errDescription property to
determine the type of failed tests on a Visual Script page. The
errDescription property returns a String identifying the type of
failure(s). The following text strings can be returned for page failures.
Failed Text Matching Test: caseName
Failed Server Response Test: caseName(min,max,timerValue)
Page pageNumber does not exist
Window not found: IE dIsplayName
No window for playback
Programmatic failure
Navigation failed
Multiple failures on a single page are concatenated into a single
errDescription string separated by commas and semicolons. For example:
Failed Text Matching Test: caseName1, caseName2,caseName_n
Failed Server Response Test: caseName(min,max,timerValue); Failed
Text Matching Test: caseName1, caseName2,caseName_n

Working With Visual Scripts and VBA in


e-Monitor Jobs
In the VBA IDE, each e-Monitor job project has a job object and one or
more Visual Script objects(s). The e-Manager job can also have userdefined VBA, such as custom modules added to the project.
When you add VBA code to a job, the code is stored with the object or
module in which the code was added. For example, if you add custom
code to the ThisJob object, the code is associated with the overall job. If
you add custom code to a Visual Script object, the code is associated with
that Visual Script.

46

e-Monitor User Guide

Application Object

CAUTION: Removing a Visual Script from a Job in the e-Monitor

Wizard also removes any custom VBA code associated with that
Visual Script object in the VBA IDE. Save the job to a new file or
export your custom VBA code before removing Visual Scripts from a
job.
If you use custom VBA with e-Monitor jobs and want to be able to swap
Visual Scripts in the job, insert your custom VBA code in the ThisJob
object or in your own module.

Application Object
Provides access to the properties and methods of the application. The
following table lists the methods and properties of the Application
object.
Method
Method or Property

Description

AppendLog

Appends the current results log


information to the specified file.

CurrentResult

Returns the properties of the result


object.

DoRV

Runs the Resource Validation test and


returns the results.

ErrNumber

Returns and sets the error number for


the application object.

Notifier

Allows access to the notifier methods.

RunJob

Runs the specified job.

RunScriptNext

Places the specified script next in the


queue after the current script.

SaveLog

Save the results log to the current file


or a new file.

SkipNextScript

Skips the indicated number of scripts.

StopJob

Stops playback and halts the job.

Appendix A: Command Reference

47

Result Object

Method
Method or Property

Description

StopSchedule

Stops the currently active schedule.

StopScript

Stops playback of the current script


and starts the next script.

The syntax and usage for these properties and methods are in the
following sections.
The application object does not have to be specified.
Examples
Private Sub VisualScript_ScriptEnd()
'If script fails, stop the script
If currentResult.status = ZFAIL Then
Application.stopScript
End If
End Sub
Private Sub VisualScript_ScriptEnd()
'Write to the results log
Notifier.Log currentresult.PageTitle
End Sub

Result Object
Provides access to the result properties for a page. The following table
lists the properties and methods of the Result object.

48

Property

Description

CurrentScriptName

Returns the name of the script that is


currently running.

DatabankIndex

Gets the current record index of the


Data Bank file.

DatabankValue

Gets the current value of the specified


Data Bank variable.

ErrDescription

Sets the error description for an


individual page.
e-Monitor User Guide

ThisJob Object

Property

Description

JobName

Returns the name of the job including


the path.

LastDuration

Returns the length of time the last


script ran.

PageTitle

Gets and sets the current page title.

PageURL

Gets and sets the current page URL.

PlayIndex

Returns the page number of the page


being played back.

ScriptName

Gets and sets the current Script name.

Status

Returns the status of the current page.

Workspace

Returns the name of the workspace.

The syntax and usage for these properties and methods are in the
following sections.
Represents the result of a page playback. Use currentResult to access
the properties for a page.
Example
Private Sub VisualScript_ScriptEnd()
'If script fails, stop the script
If currentResult.status = ZFAIL Then
stopScript
End If
End Sub

ThisJob Object
Globally provides access to events for all scripts in the job. The following
table lists the methods and events of the ThisJob object.
Event

Description

Failure

Occurs when an error occurs in a script.

GetValue

Gets a user-defined value.

Appendix A: Command Reference

49

ThisJob Object

Event

Description

IterationsBegin

Occurs at the beginning of each


iteration.

IterationsEnd

Occurs at the end of each iteration.

JobBegin

Occurs when a job begins playback.

JobEnd

Occurs when a job ends.

PageBegin

Occurs when a page within a Visual


Script begins playback.

PageEnd

Occurs when a page in a Visual Script


ends playback.

RemoveValue

Removes a user-defined name ad


value from memory.

ScriptBegin

Occurs when a Visual Script begins


playback.

ScriptEnd

Occurs when a Visual Script ends


playback.

SetValue

Sets a user-defined name/value pair in


memory.

The syntax and usage for these properties and methods are in the
following sections.
The VisualScript and ThisJob objects share some of the same events.
In these cases, the events in ThisJob are fired before the events in
VisualScript.
Example
Private Sub ThisJob_Failure()
'Send email message and stop job
Notifier.SNMPTrap "This job failed and was
stopped."
stopJob
End Sub

50

e-Monitor User Guide

VisualScript Object

VisualScript Object
Provides access to VisualScript events and methods. The following
table lists the methods and events of the VisualScript object.
Method or Event

Description

Failure

Occurs when an error occurs in a script.

IterationsBegin

Occurs at the beginning of each


iteration.

IterationsEnd

Occurs at the end of each iteration.

PageBegin

Occurs when a page within a Visual


Script begins playback.

PageEnd

Occurs when a page in a Visual Script


ends playback.

RunNext

Places the specified script next in the


queue after the current script.

ScriptBegin

Occurs when a Visual Script begins


playback.

ScriptEnd

Occurs when a Visual Script ends


playback.

SetNextRunDatabank
Index

Sets the Data Bank record index for


the next run of the job.

The syntax and usage for these properties and methods are in the
following sections.
The VisualScript and ThisJob objects share some of the same events.
In these cases, the events in ThisJob are fired before the events in
VisualScript.

Appendix A: Command Reference

51

AppendLog Method

Example
Private Sub VisualScript_ScriptEnd()
'If script fails, stop the script
If currentResult.status = ZFAIL Then
stopScript
End If
End Sub

AppendLog Method
Purpose

Appends the current results log information to the specified file.

Syntax

[Application.]AppendLog filename$
Parameter
filename

Description

The name a file to which to append the


current results log information.

Remarks

If filename does not exist, AppendLog creates the file.

Example

If Application.errNumber <> 0 Then


currentResult.errDescription = myErrorDesc
Application.errNumber = myErrorNum 'anything
other than 0 causes application error
Application.errDescription = "My Custom
Application Error Description"
Notifier.Log "Error: " & CStr(myErrorNum) & " "
& myErrorDesc
AppendLog ("mytest.log")
End If

See Also

Application Object

ClearLog Method
Purpose

Clears the results log pane and the corresponding job log file.

Syntax

[Application.]ClearLog

Remarks

The Job log file has a .slg extension and is located in the same
workspace as the Monitor Job file.

Example

If Application.errNumber <> 0 Then


currentResult.errDescription = myErrorDesc
Application.errNumber = myErrorNum 'anything

52

e-Monitor User Guide

CurrentResult Property

other than 0 causes application error


Application.errDescription = "My Custom
Application Error Description"
Notifier.Log "Error: " & CStr(myErrorNum) & " "
& myErrorDesc
AppendLog ("mytest.log")
ClearLog
End If

See Also

Application Object

CurrentResult Property
Purpose

Returns the properties of the result object for the current page.

Syntax

[Application.]currentResult.property
Parameter
property

Description

The properties of the Result object.

Remarks

CurrentResult is initialized after the page plays but before the


PageEnd event is fired.

Example

Private Sub VisualScript_ScriptEnd()


'If script fails, stop the script
If currentResult.status = ZFAIL Then
stopScript
End If
End Sub

See Also

Result Object, errDescription, Status

CurrentScriptName Property
Purpose

Returns the name of the script that is currently running.

Syntax

[Application.]currentResult.currentScriptName

Example

Dim Script as string


Script = currentResult.currentscriptName

See Also

Result Object, Workspace

Appendix A: Command Reference

53

DatabankIndex Property

DatabankIndex Property
Purpose

Gets the current record index of the Data Bank file.

Syntax

[Application.]currentResult.databankIndex

Remarks

The record index is 1 based. If the Job plays back the Visual Script
with Data Banks/All records, the index increments for each iteration
of the Visual Script through the Data bank file. If the Job plays back
the Visual Script with Data Banks/Single record, the index increments
for each iteration of the entire job. If the Job plays back the Visual
Script without Data Banks, the index is the value specified as the
Current Record Number in the e-Tester Iterations parameters for the
Visual Script.

Example

Notifier.Log "DatabankIndex " &


currentResult.databankIndex

See Also

Result Object

DatabankValue Method
Purpose

Gets the current value of the specified Data Bank variable.

Syntax

[Application.]currentResult.databankValue(var_name$)
Parameter
var_name

Remarks

54

Description

The name of a Data Bank variable in the


Visual Script page.
External Data Bank variables must be mapped to Visual Script
parameters and bound to fields in a Data Bank file. You define Data
Bank variables in the Visual Script using the Data Bank Wizard in
e-Tester. Mapped and bound Data Bank variable names also appear
in the Parameters node of a Visual Script page that has recorded
HTML form results.

e-Monitor User Guide

DoRV Method

Example

Notifier.Log "FirstName: " &


currentResult.DatabankValue("var_FirstName")
Notifier.Log "LastName: " &
currentResult.DatabankValue("var_LastName")
Notifier.Log "eMail: " &
currentResult.DatabankValue("var_Mail")
Notifier.Log "Phone: " &
currentResult.DatabankValue("var_Phone")

See Also

Result Object

DoRV Method
Purpose

Runs the Resource Validation test and returns the results.

Syntax

[Application.]DoRV results
Parameter
results

Remarks

Description

An array that stores the Resource Validation


results.
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.
Resource Validation should be run only at the end of a Visual Script
run.

Example

Private Sub VisualScript_ScriptEnd()


'Set up variables for results
Dim rvHost
'Host
Dim rvResPath
'Resource Path
Dim rvCurStatus
'Current Status
Dim rvErrDesc
'Error Description
Dim rvResHandle
'Resource Handle
Dim rvIntStatCode
'Internet Status Code
Dim rvStats
'Statistics
Dim rvWininetErr
'WinInet Error Code
'Set up variable for Resource Validation array
'Dim rvArray
'Run Resource Validation and store results in an
'array of arrays
doRV rvArray
'Set up a variable to parse the Resource Validation

Appendix A: Command Reference

55

DoRV Method

'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 As Integer
Dim rvResult As String
'Set up a variable to parse the Resource
'Validation columns
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)
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
rvWininetErrCode = rvRow(rvCol)
End If
Next rvCol
'Do Resource error checking for the current
'results
'Label the current row of Resource Validation
'results
rvResult = "*****Resource Validation
Results*****" & vbCrLf & _
"Number: " & x & vbCrLf & _
"Host: " & rvHost & vbCrLf & _
"Path: " & rvResPath & vbCrLf & _
"Current Status: " & rvCurStatus & _
vbCrLf & _
"Error Description: " & rvErrDesc & _
vbCrLf & _
"Resource Handle: " & rvResHandle & _
vbCrLf & _
"Internet Status Code: " & _
rvIntStatCode & vbCrLf & _
56

e-Monitor User Guide

Email Method

"Statistics: " & rvStats & vbCrLf & _


"WinInet Error Code: " & rvWininetErr
'Write the results to the log
Notifier.Log Notifier.FmtStr(rvResult)
'get the next Resource Validation row
Next x
End Sub

See Also

Application Object

Email Method
Purpose

Sends an email message to the designated address.

Syntax

[Application.]Notifier.Email(recipient$, subject$,
message$, [sender$])
Parameter
recipient$

Description

message$

String. The email address of the person to


receive the message.
String. The text that will appear in the
subject line of the email.
String. The message text.

sender$

String. The sender.

subject$

Remarks

Used to send email messages during script playback. Server


information is obtained from the e-Manager settings.

Example

Private Sub ThisJob_Failure()


'Send email message and stop job
Notifier.Email "admin@empirix.com", "Job
Failure", "This job failed and was stopped."
stopJob
End Sub

See Also

Notifier, EventLog, FMTStr, Log, MsgBox, SNMPTrap

Appendix A: Command Reference

57

ErrDescription Property

ErrDescription Property
Purpose

Returns and sets the error description for the individual page.

Syntax

[Application.]currentResult.errDescription

Example

Dim errorDesc
errorDesc = currentResult.errDescription

See Also

Result Object, Status

ErrNumber Property
Purpose

Returns and sets the error number for the application object.

Syntax

[Application.]errNumber

Example

Dim myErrorDesc As String


Dim myErrorNum As Long
myErrorDesc = "My Custom Current Result Error
Description"
myErrorNum = 999 'My Custom Error Number
Application.errNumber = 1
If Application.errNumber <> 0 Then
currentResult.errDescription = myErrorDesc
Application.errNumber = myErrorNum
'anything other than 0 causes application error
Application.errDescription = "My Custom
Application Error Description"
Notifier.Log ("Error: " & CStr(myErrorNum) & _
" " & myErrorDesc)
End If

See Also

58

Application Object

e-Monitor User Guide

EventLog Method

EventLog Method
Purpose

Writes a user-specified string into the NT Application Event Log.

Syntax

[Application.]Notifier.EventLog(message$)
Parameter
message

Remarks

Description

String. The message to write to the


Application Event Log.
This can be used to track e-Manager events in the Event Log.

Example

Private Sub ThisJob_Failure()


'Send message and stop job
Notifier.EventLog "The job failed and was stopped."
stopJob
End Sub

See Also

Notifier, Eamil, FmtStr, Log, MsgBox, SNMPTrap

Failure Event
Purpose

Occurs when an error occurs in a page.

Syntax

object_Failure()
Parameter
object

Remarks
Example 1

Example 2

See Also

Description

An expression that evaluates to the ThisJob


or VisualScript object.
Used to execute code when a script fails during playback. The Failure
event is executed before the job, script, or page end events.
Private Sub VisualScript_Failure()
'Send message to log and continue playback
Notifier.Log ("VBA Message: Script Failed") +
CStr(playIndex)
End Sub
Private Sub ThisJob_Failure()
'Send message to log and stop job
Notifier.Log "Job Failed. Stopping Job."
stopJob
End Sub
Result Object, StopJob, StopScript

Appendix A: Command Reference

59

FmtStr Function

FmtStr Function
Purpose

Formats a text string as a single command parameter.

Syntax

[Application.]Notifier.FmtStr(InString$)
Parameter
InString$

Remarks

Description

Any text string.

You can use FmtStr to include the Notification variable values in


message strings, as follows:
Notifier.FmtStr("Current Script Name: %curScript")

Example

LogMessage = "Error in Script: " +


currentResult.playIndex
Notifier.Log FmtStr(LogMessage)

See Also

Notifier, Email, EventLog, Log, MsgBox, SNMPTrap

GetValue Method
Purpose

Gets a user-defined value.

Syntax

ThisJob.GetValue(var_name$)
Parameter
var_name

Description

Remarks

The name of a user-defined variable set


using the SetValue Method.
User-defined values can be used to keep track of data values outside
the scope of a Monitor job. For example, you can set a user-defined
value to count the job iterations.

Example

Private Sub ThisJob_JobBegin()


'Initialize external job counter
Dim myCounterValue As Long
Notifier.Log ("****** Begin Job *******")
'Set the maximum number of iterations
ThisJob.setValue "maxruns", 3 '
If ThisJob.getValue("myCounter") = Empty Then
ThisJob.setValue "myCounter", 0

60

e-Monitor User Guide

IterationsBegin Event

Notifier.Log ("Job Iteration Counter: _


INITIALIZED")
Else
myCounterValue = ThisJob.getValue("myCounter")
Notifier.Log ("Job Iteration Counter: " & _
myCounterValue)
End If
End Sub
Private Sub ThisJob_JobEnd(totalDuration As Long,
iterations As Long)
Notifier.Log ("****** End Job *******")
Dim myCounterValue As Long
Dim maxruns As Long
myCounterValue = ThisJob.getValue("myCounter")
maxruns = ThisJob.getValue("maxruns")
If myCounterValue = 0 Or myCounterValue >= Empty And
myCounterValue <> maxruns Then
myCounterValue = myCounterValue + 1
ThisJob.setValue "myCounter", myCounterValue
Notifier.Log ("Job Iteration Counter: " & _
myCounterValue)
ElseIf myCounterValue = maxruns Then
'Cleanup: remove the values
ThisJob.removeValue "myCounter"
ThisJob.removeValue "maxruns"
Notifier.Log ("Job Iteration Counter: MAX RUNS _
= " & CStr(maxruns) & ", UNINITIALIZED")
End If
End Sub

See Also

ThisJob Object

IterationsBegin Event
Purpose

Occurs at the beginning of each iteration.

Syntax

object_IterationsBegin()
Parameter
object

Appendix A: Command Reference

Description

An object expression that evaluates to a


ThisJob or VisualScript object.
61

IterationsEnd Event

Remarks

If iterations are enabled and the Visual Script is set up to use a


databank, then this event occurs.

Example

Private Sub VisualScript_IterationsBegin()


'Send message to log
Notifier.Log ("VBA Message: Iterating") +
CStr(playIndex)
End Sub

See Also

ThisJob Object, IterationsEnd

IterationsEnd Event
Purpose

Occurs at the end of each iteration.

Syntax

object_IterationsEnd()
Parameter
object

Remarks

Description

An object expression that evaluates to a


ThisJob or VisualScript object.
If iterations are enabled and the Visual Script is set up to use a
databank, then this event occurs.

Example

Private Sub VisualScript_IterationsBegin()


'Send message to log
Notifier.Log ("VBA Message: Finished iterating")
+ CStr(playIndex)
End Sub

See Also

ThisJob Object, IterationsBegin

JobBegin Event
Purpose

Occurs when a job begins playback.

Syntax

ThisJob_JobBegin()

Remarks

Used to execute code when a job starts.

Example

Private Sub ThisJob_JobBegin()


Notifier.Log ("VBA Message: Job beginning ") +
CStr(playIndex)
End Sub

See Also

ThisJob Object, JobEnd

62

e-Monitor User Guide

JobEnd Event

JobEnd Event
Purpose

Occurs when a job ends.

Syntax

ThisJob_JobEnd(totalDuration As Long, iterations As


Long)
Parameter
totalDuration
iterations

Description

Indicates the time, in seconds, that it took for


all scripts in the job to playback.
Indicates the number of iterations.

Remarks

Used to execute code when a job ends.

Example

Private Sub ThisJob_JobEnd(total Duration As Long,


iterations As Long)
'Send message to the log
Notifier.Log ("VBA Message: Script Finished") +
CStr(playIndex) + ("Duration: ") +
Duration +("Number of Iterations: ") + iterations
End Sub

See Also

ThisJob Object, JobBegin

JobName Property
Purpose

Returns the name of the job including the path.

Syntax

[Application.]currentResult.jobName

Example

Dim job as string


job = currentResult.jobName

See Also

Result Object, Status

Appendix A: Command Reference

63

LastDuration Property

LastDuration Property
Purpose

Returns the length of time, in seconds, that the page took to play back.

Syntax

[Application.]currentResult.lastDuration

Example

Dim length
length = currentResult.lastDuration

See Also

Result Object, Status

Log Method
Purpose

Displays a message in the Results log pane of e-Manager.

Syntax

[Application.]Notifier.Log(message$)
Parameter
message$

Description

String. The text of the log message.

Remarks

Log message text can be defined using a variable or explicitly in


quotations after the Log command. If the text is defined in a variable,
use FmtStr with the Log command.

Example

Private Sub VisualScript_PageEnd()


Notifier.Log ("VBA Message :Page ended ") +
CStr(playIndex)
End Sub

See Also

Notifier, Email, EventLog, FmtStr, MsgBox, SNMPTrap

64

e-Monitor User Guide

MsgBox Method

MsgBox Method
Purpose

Displays a message box.

Syntax

[Application.]Notifier.MsgBox(Message$)
Parameter
Message

Description

String. The text of the message.

Remarks

Message box text can be defined using a variable or explicitly in


quotations after the MsgBox command. If the text is defined in a
variable, use FmtStr with the MsgBox command.

Example

Private Sub VisualScript_PageEnd()


Notifier.MsgBox ("Script Finished.")
End Sub

See Also

Notifier, Email, EventLog, FmtStr, Log, SNMPTrap

Notifier Property
Purpose

Provides access to the methods for sending notifications.

Syntax

[Application.]Notifier.method

Example

Private Sub VisualScript_ScriptBegin()


Notifier.Log ("VBA Message: Script Started ") +
CStr(playIndex)
End Sub

See Also

Email, EventLog, FmtStr, Log, MsgBox, SNMPTrap

Appendix A: Command Reference

65

PageBegin Event

PageBegin Event
Purpose

Occurs when a page within a Visual Script begins playback.

Syntax

object_PageBegin(ByVal playIndex as Integer, ByVal


currentScriptName as String)
Parameter
object

Description

playIndex

An object expression that evaluates to a


ThisJob or VisualScript object.
The index number of the Visual Script page.

currentScriptName

The name of the current Visual Script.

Remarks

Used to execute code when playback of a Visual Script page begins.


When triggered from ThisJob, the event applies to all pages of all
scripts in the job. When triggered from VisualScript, the event
applies to only pages of the particular script. The PageBegin event for
ThisJob is triggered before the PageBegin event for VisualScript.

Example

Private Sub VisualScript.PageBegin(playIndex As


Integer, currentScriptName As String)
Notifier.Log ("VBA Message: Page Started ") +
CStr(playIndex)
End Sub

See Also

ThisJob Object, VisualScript Object, PageEnd

66

e-Monitor User Guide

PageEnd Event

PageEnd Event
Purpose

Occurs when a page in a Visual Script ends playback.

Syntax

object_PageEnd()
Parameter
object

Remarks

Description

An object expression that evaluates to a


ThisJob or VisualScript object.
Used to execute code when playback of a Visual Script page ends.
When triggered from ThisJob, the event applies to all pages of all
scripts in the job. When triggered from VisualScript, the event
applies to only pages of the particular script. The PageEnd event for
ThisJob is triggered before the PageEnd event for VisualScript.

Example

Private Sub VisualScript_PageEnd()


Notifier.Log ("VBA Message :Page ended ") +
CStr(playIndex)
End Sub

See Also

ThisJob Object, VisualScript Object, PageBegin

PageTitle Property
Purpose

Gets and sets the current page title.

Syntax

[Application.]currentResult.pageTitle

Example

Notifier.Log "Page Title " & currentResult.pageTitle


currentResult.pageTitle = "Set a page title"

See Also

Result Object

Appendix A: Command Reference

67

PageURL Property

PageURL Property
Purpose

Gets and sets the current page URL.

Syntax

[Application.]currentResult.PageURL

Example

Notifier.Log "Page URL" & currentResult.pageURL


currentResult.pageURL = "Set a page URL"

See Also

Result Object

PlayIndex Property
Purpose

Returns the page number of the page being played back.

Syntax

[Application.]currentResult.playIndex

Example

Dim pagenum
pagenum = currentResult.playIndex

See Also

Result Object, Status

RemoveValue Method
Purpose

Removes a user-defined name and value from memory.

Syntax

ThisJob.RemoveValue(var_name$)
Parameter
var_name

Description

Remarks

The name of a user-defined variable set


using the SetValue Method.
User-defined values can be used to keep track of data values outside
the scope of a Monitor job. For example, you can set a user-defined
value to count the job iterations.

Example

Private Sub ThisJob_JobBegin()


'Initialize external job counter
Dim myCounterValue As Long
Notifier.Log ("****** Begin Job *******")
'Set the maximum number of iterations

68

e-Monitor User Guide

RemoveValue Method

ThisJob.setValue "maxruns", 3 '


If ThisJob.getValue("myCounter") = Empty Then
ThisJob.setValue "myCounter", 0
Notifier.Log ("Job Iteration Counter: _
INITIALIZED")
Else
myCounterValue = ThisJob.getValue("myCounter")
Notifier.Log ("Job Iteration Counter: " & _
myCounterValue)
End If
End Sub
Private Sub ThisJob_JobEnd(totalDuration As Long,
iterations As Long)
Notifier.Log ("****** End Job *******")
Dim myCounterValue As Long
Dim maxruns As Long
myCounterValue = ThisJob.getValue("myCounter")
maxruns = ThisJob.getValue("maxruns")
If myCounterValue = 0 Or myCounterValue >= Empty _
And myCounterValue <> maxruns Then
myCounterValue = myCounterValue + 1
ThisJob.setValue "myCounter", myCounterValue
Notifier.Log ("Job Iteration Counter: " &
myCounterValue)
ElseIf myCounterValue = maxruns Then
'Cleanup: remove the values
ThisJob.removeValue "myCounter"
ThisJob.removeValue "maxruns"
Notifier.Log ("Job Iteration Counter: MAX RUNS _
= " & CStr(maxruns) & ", UNINITIALIZED")
End If
End Sub

See Also

ThisJob Object

Appendix A: Command Reference

69

RunJob Method

RunJob Method
Purpose

Runs the specified job.

Syntax

[Application.]RunJob (filename$)
Parameter
filename

Description

The path and filename of the job to run.

Example

application.RunJob
"c:\Empirix\eTEST\default!\myjob.mjb"

See Also

Application Object

RunNext Method
Purpose

Places the specified script next in the queue after the current script.

Syntax

object.runNext()
Parameter
object

Remarks

Description

An object expression that evaluates to a


VisualScript object.
Used to insert a script into the queue. The script will be executed
when the current script finishes. Events for VisualScript will be
triggered. The User Interface settings for this script, including
databank and iteration, are taken. Refer to the Script Execution and
Event Triggering section for an explanation of how the queue works.

Example

Private Sub VisualScript_ScriptEnd()


'If script fails, run another script
'to gather more information
If currentResult.status = ZFAIL Then
Script1.runNext
End If
End Sub

See Also

VisualScript Object, RunScriptNext, SkipNextScript

70

e-Monitor User Guide

RunScriptNext Method

RunScriptNext Method
Purpose

Places the specified script next in the queue after the current script.

Syntax

[Application.]runScriptNext(scriptName$, workspace$,
iterate)
Parameter
scriptName

Remarks

Description

String. The name of the script you want to


insert.
workspace
String. The workspace in which the script is
located.
iterate
Boolean. Indicates whether or not to enable
iteration.
Used to insert a script into the queue. The script will be executed
when the current script finishes. Events for ThisJob will be
triggered; VisualScript events will not. Refer to the Script
Execution and Event Triggering section for an explanation of how
the queue works.

Example

Private Sub VisualScript_ScriptEnd()


'If script fails, run another script to gather
more information
If currentResult.status = ZFAIL Then
runScriptNext "Script1", "RSWDemo", False
End If
End Sub

See Also

Application Object, RunNext Method, SkipNextScript

Appendix A: Command Reference

71

SaveLog Method

SaveLog Method
Purpose

Save the results log to the current file or a new file.

Syntax

[Application.]SaveLog ([filename$], overwrite)


Parameter
filename
overwrite

Description

The name of the file to which to save the


results log.
Specifies if any existing file of the same name
is overwritten. Valid values are True |

Example

False.
application.SaveLog "mylog.log",False

See Also

Application Object

ScriptBegin Event
Purpose

Occurs when a Visual Script begins playback.

Syntax

object_PageBegin()
Parameter
object

Remarks

Description

An object expression that evaluates to a


ThisJob or VisualScript object.
Used to execute code when playback of a Visual Script begins. When
triggered from ThisJob, the event applies to all scripts in the job.
When triggered from VisualScript, the event applies to only this
particular script. The ScriptBegin event for ThisJob is triggered
before the ScriptBegin event for VisualScript.

Example

Private Sub VisualScript_ScriptBegin()


Notifier.Log ("VBA Message: Script Started ") +
CStr(playIndex)
End Sub

See Also

ThisJob Object, VisualScript Object, ScriptEnd

72

e-Monitor User Guide

ScriptEnd Event

ScriptEnd Event
Purpose

Occurs when a Visual Script ends playback.

Syntax

object_ScriptEnd()
Parameter
object

Remarks

Description

An object expression that evaluates to a


ThisJob or VisualScript object.
Used to execute code when playback of a Visual Script finishes. When
triggered from ThisJob, the event applies to all scripts in the job.
When triggered from VisualScript, the event applies to only this
particular script. The ScriptEnd event for ThisJob is triggered
before the ScriptEnd event for VisualScript.

Example

Private Sub VisualScript_ScriptEnd()


'If script fails, run another script to gather
more information
If currentResult.status = ZFAIL Then
runScriptNext "Script1", "RSWDemo", False
End If
End Sub

See Also

ThisJob Object, VisualScript Object, ScriptBegin

ScriptName Property
Purpose

Gets and sets the current Script name.

Syntax

[Application.]currentResult.ScriptName

Example

Notifier.Log "Page URL" & currentResult.ScriptName


currentResult.ScriptName = "Set a page URL"

See Also

Result Object

Appendix A: Command Reference

73

SetNextRunDatabankIndex Method

SetNextRunDatabankIndex Method
Purpose

Sets the Data Bank record index for the next run of the job.

Syntax

object.SetNextRunDatabankIndex()
Parameter
object

Remarks

Description

An object expression that evaluates to an


object in the applies to list.
Used to set the Data Bank index for the next run of the job.

object is a name of a Visual Script object in the e-TEST Console


module of the Visual Basic Project.
Example

Private Sub VisualScript_PageEnd()


tutor4.setNextRunDatabankIndex 3
End Sub

See Also

VisualScript Object

SetValue Method
Purpose

Sets a user-defined name/value pair in memory.

Syntax

ThisJob.SetValue(var_name$, value)
Parameter
var_name

Description

The name of a user-defined variable to set.

Remarks

The value to store in the user-defined


variable.
User-defined values can be used to keep track of data values outside
the scope of a Monitor job. For example, you can set a user-defined
value to count the job iterations.

Example

Private Sub ThisJob_JobBegin()

value

'Initialize external job counter


Dim myCounterValue As Long
Notifier.Log ("****** Begin Job *******")
'Set the maximum number of iterations
ThisJob.setValue "maxruns", 3 '
74

e-Monitor User Guide

SkipNextScript Method

If ThisJob.getValue("myCounter") = Empty Then


ThisJob.setValue "myCounter", 0
Notifier.Log ("Job Iteration Counter: _
INITIALIZED")
Else
myCounterValue = ThisJob.getValue("myCounter")
Notifier.Log ("Job Iteration Counter: " & _
myCounterValue)
End If
End Sub
Private Sub ThisJob_JobEnd(totalDuration As Long,
iterations As Long)
Notifier.Log ("****** End Job *******")
Dim myCounterValue As Long
Dim maxruns As Long
myCounterValue = ThisJob.getValue("myCounter")
maxruns = ThisJob.getValue("maxruns")
If myCounterValue = 0 Or myCounterValue >= Empty _
And myCounterValue <> maxruns Then
myCounterValue = myCounterValue + 1
ThisJob.setValue "myCounter", myCounterValue
Notifier.Log ("Job Iteration Counter: " & _
myCounterValue)
ElseIf myCounterValue = maxruns Then
'Cleanup: remove the values
ThisJob.removeValue "myCounter"
ThisJob.removeValue "maxruns"
Notifier.Log ("Job Iteration Counter: MAX RUNS _
= " & CStr(maxruns) & ", UNINITIALIZED")
End If
End Sub

See Also

ThisJob Object

SkipNextScript Method
Purpose

Skips playback of the indicated number of scripts.

Syntax

[Application.]skipNextScript([numberOfScripts&])
Parameter
numberofScripts&

Appendix A: Command Reference

Description

Optional. Long. Indicates the number of


scripts to skip.
75

SNMPTrap Method

Remarks

Used to remove scripts from the playback queue starting with the
script that is next after the current script. Refer to the Script
Execution and Event Triggering section for an explanation of how
the queue works.

Example

Private Sub VisualScript_ScriptEnd()


'If script fails, skip the next 3 script
If currentResult.status = ZFAIL Then
skipNextScript 3
End If
End Sub

See Also

Application Object, RunNext, RunScriptNext

SNMPTrap Method
Purpose

Initiates an SNMP trap message to the system SNMP management


console.

Syntax

[Application.]Notifier.SNMPTrap(message$)
Parameter
message

Description

String. The message text for the SNMP trap.

Remarks

Used to set an SNMP trap message during script playback. The eMonitor system must be configured as SNMP management system to
receive SNMP trap messages.

Example

Private Sub ThisJob_Failure()


'Set SNMP trap message and stop job
Notifier.SNMPTrap "This job failed and was _
stopped."
stopJob
End Sub

See Also

Notifier, Email, EventLog, FmtStr, Log, MsgBox

76

e-Monitor User Guide

Status Property

Status Property
Purpose

Returns the status of the page.

Syntax

[Application.]currentResult.status
Constant

Value

Description

ZPASS

Indicates the page has passed.

ZWARNING

Indicates the page has a warning.

ZFAIL

Indicates the page has failed.

ZERROR

Indicates the page has an error.

Example

Private Sub VisualScript_ScriptEnd()


'If script fails, stop the script
If currentResult.status = ZFAIL Then
stopScript
End If
End Sub

See Also

Result Object, ErrDescription

StopJob Method
Purpose

Stops playback and halts the job.

Syntax

[Application.]stopJob()

Remarks

Used to clear the queue and stop playback of the job.

Example

Private Sub ThisJob_Failure()


'Send message to log and stop job
Notifier.Log "Job Failed. Stopping Job."
stopJob
End Sub

See Also

Application Object, StopScript

Appendix A: Command Reference

77

StopSchedule Method

StopSchedule Method
Purpose

Stops the currently active schedule.

Syntax

[Application.]StopSchedule

Example

application.StopSchedule

See Also

Application Object

StopScript Method
Purpose

Stops playback of the current script and moves to the next script in the
job.

Syntax

[Application.]stopScript()

Remarks

Used to stop playback of the current script. Script playback resumes


with the next script in the queue.

Example

Private Sub VisualScript_Failure()


'Send message to log and stop script
Notifier.Log "Script Failed. Stopping Script."
stopScript
End Sub

See Also

Application Object, StopJob

Workspace Property
Purpose

Returns the workspace in which the current script is located.

Syntax

[Application.]currentResult.workspace

Example

Dim location
location = currentResult.workspace

See Also

Result, CurrentScriptName

78

e-Monitor User Guide

Appendix B

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.

79

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

80

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-Monitor 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 B: Internet Status Codes

81

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

82

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-Monitor User Guide

Internet Codes

502

503

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.

504

Gateway TimeTime-out

505

HTTP Version not supported

The server, while acting as a gateway or proxy, did not receive a


timed-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.
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 B: Internet Status Codes

83

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

84

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-Monitor User Guide

Internet Codes

12020

Not P
Proxy
roxy 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 B: Internet Status Codes

85

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

86

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-Monitor 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 B: Internet Status Codes

87

Internet Codes

12131

Not File

12132

Data Error

12133

End of Data

12134

Invalid Locator

12135

Incorrect Locator Type


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

88

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-Monitor 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 B: Internet Status Codes

89

Internet Codes

12170

Sec Cert
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

90

e-Monitor User Guide

Appendix C

Converting e-Monitor 5.0 Shell


Scripts
e-TEST suite version 5.1 includes a completely redesigned version of
e-Monitor. In addition to a new Job Editor and Scheduler, e-Monitor 5.1
also uses the Microsoft Visual Basic for Applications Integrated
Development Environment (VBA IDE) for advanced event and error
handling.
If you have e-Monitor* 5.0 Shell Scripts, you can convert the Shell Scripts
to e-Monitor 5.1 Jobs and Schedules. If you have customized e-Monitor
5.0 Wizard-generated Shell Scripts, you will also have to convert your
customized code for use in the VBA environment.

e-Monitor 5.0 or earlier


91

Overview

Overview
The redesign of e-Monitor provides a more comprehensive and versatile
application for Web site or application monitoring. e-Monitor 5.1
provides the ability to schedule multiple jobs, with each job running
multiple Visual Scripts. The new version also provides more advanced
Reporting capabilities.
In e-Monitor 5.0*, scheduling, Visual Script execution, and error
handling and notification were all included within the Shell Scripts. In
e-Monitor 5.1, scheduling has been separated from Visual Script
execution and error handing/notifications. e-Monitor 5.1 also includes the
VBA IDE for advanced programming and error handling options.
While the e-Monitor changes provide more flexibility in scheduling
multiple e-Monitor jobs and custom error handling, there is a one-time
conversion process that e-Monitor 5.0 users need to complete to bring
existing Shell Script functionality into e-Monitor 5.1. If you have
e-Monitor 5.0 Shell Scripts that you want to use with e-Monitor 5.1,
you'll have to convert the Shell Script functionality to e-Monitor 5.1 Jobs
and Schedules.
e-Monitor 5.1 includes a utility for importing existing Shell Scripts
created by the e-Monitor 5.0 Wizard. However, because of the variety of
capabilities that users could program into Shell Scripts, the import utility
will only read Shell Script code generated by the e-Monitor 5.0 Wizard.
If you have customized e-Monitor 5.0 Wizard-generated Shell Scripts,
you will also have to convert your customized code for use in the VBA
environment.
The import utility does not alter existing Shell Script files. See the
Importing Shell Scripts topics for information about which Shell Script
functionality will be imported into e-Monitor 5.1 jobs.
See the Converting Custom code topic for information about a conversion
reference between 5.0 Shell Script commands and 5.1 VBA events,
methods, and properties.

92

e-Monitor 5.0 or earlier


e-Monitor User Guide

Importing Shell Scripts

Importing Shell Scripts


For existing e-Monitor 5.0* Shell Scripts generated by the Wizard, you
can use the e-Monitor Import Shell Script menu option in the e-TEST
Console to import Shell Script functionality.
Note: The Import Shell Script utility is limited to importing e-Monitor

5.0 Wizard-generated Shell Scripts. See Converting Customized


e-Monitor 5.0 Shell Scripts if you have customized e-Monitor Shell
Scripts with your own scheduling and error handling code.
To import e-Monitor 5.0 Shell Scripts:

1.

Select e-Monitor Import Shell Script.

2.

Select the script you want to import and click the Open button. The
Workspace and Scripts screen of the e-Monitor wizard is displayed.

3.

Edit the list of scripts to be included in the job, if necessary and click
Next.

4.

Edit the Job Notifications, if necessary and click Next.

5.

Click Finish to complete the job in the Wizard.

6.

Specify a file name for the new job and click Save.

7.

Click Yes to add the Job to a new schedule or click No to open the job
in the Job Editor window.

8.

If you select Yes, specify the Days and Frequency settings.

9.

Click OK.

10.

Select e-Monitor Activate Schedule.

e-Monitor 5.0 or earlier

Converting e-Monitor 5.0 Shell Scripts

93

Importing Shell Scripts

What is Imported
The following information will be imported into e-Monitor 5.1 jobs from
e-Monitor 5.0* Shell Scripts:
Scriptnames and Workspaces the import utility recognizes the Visual

Scripts names referenced within the Shell Script by the Play statement.
Visual Scripts names referenced within the Shell Script by the Iterate
statement are currently not recognized. This is a known limitation. As a
temporary workaround, you can edit your Shell Scripts to change
Iterate statement to Play statement before importing. You can specify
databank iteration options in the e-Monitor 5.1 Wizard after importing
the Shell Script.
Error Notification Methods the import utility recognizes all e-Monitor

5.0 Wizard-generated error notification methods, including the content,


which will be imported into e-Monitor 5.1 Wizard. e-Monitor 5.0 error
notification methods are identified in Shell Scripts by the variables:
LogMessage, EventLogMessage, MessageBoxMessage,
EmailMessage, ExeArguments. The import utility will specify an
equivalent e-Monitor 5.1 error notification method using the values of
these variables if they are found in the Shell Script.

What is Not Imported


The following information will NOT be imported into e-Monitor 5.1 jobs
from e-Monitor 5.0 Shell Scripts:
StartTime Shell Script start time is replaced by the e-Monitor 5.1

Scheduler options. At the end of importing a Shell Script, the e-Monitor


5.1 Wizard asks if you want to schedule the job. You can specify the start
time using the Scheduler options.
NumOfRuns, MaxNumOfRuns, PlaybackLoop, and RestartLabel - these

settings are no longer necessary in e-Monitor 5.1. The Scheduler


automatically handles system resource issues between job runs.

94

e-Monitor 5.0 or earlier


e-Monitor User Guide

Importing Shell Scripts

SleepTime Shell Script sleep time is replaced by the e-Monitor 5.1


Scheduler options. At the end of importing a Shell Script, the e-Monitor
5.1 Wizard asks if you want to schedule the job. You can specify time
between jobs using the Scheduler options.
ErrorLabel Shell Script error handling is entirely replaced by e-Monitor

5.1 built-in error handling and custom code in the VBA environment. The
VBA project for each Job contains an object for the overall job level and an
object for each Visual Script in the job. Each VBA project has a Failure
event for the Job object level and each Visual Script object level. Custom
On Error code can be added to these VBA event handlers.
Custom Message Names the import utility does not recognize

customized variable names for the Notification methods, such as


MyLogMessage or TestMessageBoxMessage and will not import them.
Multiple Email Notifications the import utility only recognizes the last
Email statement in a Shell Script. If your Shell Script has multiple Email

notifications to more than one address, only the last one in the Shell Script
will appear in the e-Monitor 5.1 Wizard. You can add multiple addresses
in the Wizard if you want all recipients to receive the same Email
message. If you want Email recipients to receive different messages based
upon various conditions, you can specify the condition in the VBA
environment and use the Email method to send multiple messages.

Custom Shell Scripting the import utility does not recognize custom code

in Shell Scripts. The import utility only converts e-Monitor 5.0* Wizardgenerated code. The import utility does not alter existing Shell Script files.
If you have custom code, you can convert the code to the VBA
environment to include any custom scripting such as error handling as
part of e-Monitor 5.1 jobs and schedules.

e-Monitor 5.0 or earlier

Converting e-Monitor 5.0 Shell Scripts

95

Converting Custom Code

Converting Custom Code


If you have customized you re-Monitor 5.0* Shell Scripts with custom
code, youll need to migrate your custom code manually to the VBA IDE
for each job.
The VBA project for each Job contains an object for the overall job level
and an object for each Visual Script in the job. Each VBA project has
several events for the Job object level and each Visual Script object level.
The code placed in the event procedures is executed during each Job and
Visual Script playback. The following event procedures are predefined for
each job and each Visual Script within a job:
ThisJob
ThisJob Object Events

VisualScript Object Events

Failure Event

Failure Event

IterationsBegin Event

PageBegin Event

IterationsEnd Event

PageEnd Event

JobBegin Event

ScriptBegin Event

JobEnd Event

ScriptEnd Event

PageBegin Event
PageEnd Event
ScriptBegin Event
ScriptEnd Event
Custom code can be added to theses VBA event handlers. The e-Monitor
e-PI includes the application object that you can use to access the
available methods and properties.
You can also add your own modules to the Visual Basic project. Custom
code added to ThisJob or VisualScript objects in the VBA project
becomes associated with that object.

96

e-Monitor 5.0 or earlier


e-Monitor User Guide

Converting Custom Code

CAUTION: Removing a Visual Script from a Job in the ee-Monitor Wizard


also removes any custom VBA code associated with that Visual Script
object in the VBA IDE.

Save the job to a new file or export your custom VBA code before
removing Visual Scripts from a job.
If you have VBA code that you want to able to use across Jobs and Visual
Scripts, you can create a template e-Monitor Job with VBA code only in
the ThisJob object or your own module. You can then add and remove
Visual Scripts to the template Job and save the job as a new name. Note
however, that Visual Script names define object names in the VBA project.
Your code will need to handle the references to Visual Script object
names.

e-Monitor 5.0 to 5.1 Conversion Reference


The following table cross-references the e-Monitor 5.0 Shell Script
commands to the e-Monitor 5.1 VBA methods, events, and properties and
Visual Basic procedures.
e-Monitor
Monitor 5.0 and Earlier

e-Monitor 5.1 and Higher

Cdate Function

VBA Cdate Function

ClearLog Statement

ClearLog Method

Close Statement

N/A

CloseWorkspace Statement

N/A

Cstr Function

VBA CStr Function

CurDatabank Function

N/A (Workaround available using


DatabankValue Method)

CurPage Function

PlayIndex Property

CurPageTitle Function

PageTitle Property

CurPageURL Function

PageURL Property

CurRecord Function

DatabankIndex Property

CurScript Function

CurrentScriptName Property
ScriptName Property

Converting e-Monitor 5.0 Shell Scripts

97

Converting Custom Code

e-Monitor
Monitor 5.0 and Earlier

e-Monitor 5.1 and Higher

CurWorkspace Function

Workspace Property

Date Function

VBA Date Function

Day Function

VBA Day Function

DBVarValueOf Function

DatabankValue Method

ElementValueOf Function

N/A

Email Statement

Email Method

Err.Description Function

ErrDescription Property

Err.Number Function

ErrNumber Property

ErrorPageDuration Function

Failure Event
LastDuration Property
Custom VBA Code

EventLog Function

EventLog Method

Exec Statement

Exec Method

Exit Statement

N/A

FmtStr Function

FmtStr Function

GetFailedTMNames Function Failure Event


ErrDescription Property
ErrNumber Property
Custom VBA Code

98

GetHtml Function

N/A

Goto Statement

VBA GoTo Statement

Hour Function

VBA Hour Function

IfThenElse Statement

VBA IfThenElse Statement

IsSuspended Function

N/A

Iterate Statement

e-Monitor Scheduler

e-Monitor User Guide

Converting Custom Code

e-Monitor 5.0 and Earlier

e-Monitor 5.1 and Higher

IterationCount Function

IterationsBegin Event
DatabankIndex Property
JobBegin Event
GetValue Method
RemoveValue Method
SetValue Method

Label

VBA line label

Log Statement

Log Method

Minute Function

VBA Minute Function

Month Function

VBA Month Function

MsgBox Statement

MsgBox Method

Now Function

VBA Now Function

On Error Statement

VBA On Error Statement

Open Statement

N/A

Play Statement

e-Monitor Scheduler
e-Monitor Job Editor

Quit Statement

N/A

Reset Statement

N/A

Restart Statement

N/A

Resume Statement

N/A

RSWLastError Function

Failure Event
ErrDescription Property
ErrNumber Property

RSWPageError_FE

Failure Event
ErrDescription Property
ErrNumber Property

Converting e-Monitor 5.0 Shell Scripts

99

Converting Custom Code

100

e-Monitor 5.0 and Earlier

e-Monitor 5.1 and Higher

RSWPageError_TM

Failure Event
ErrDescription Property
ErrNumber Property

RSWStat.Clear Function

RemoveValue Method

RSWStat.ErrorDescription
Function

ErrDescription Property

RSWStat.PageErrCount
Function

Failure Event
GetValue Method
RemoveValue Method
SetValue Method

RSWStat.ScriptErrCount
Function

Failure Event
GetValue Method
RemoveValue Method
SetValue Method

Save Statement

N/A

SaveAs Statement

N/A

SaveLog Statement

AppendLog Method
SaveLog Method

SetOptions Statement

N/A

SMTPMail Statement

Email Method

Stop Statement

StopJob Method
StopScript Method
StopSchedule Method

Suspend Statement

N/A

Time Function

VBA Time Function

TimeOf Function

VBA Time Statement

UCase Function

VBA UCase Function

WaitFor Statement

e-Monitor Scheduler
e-Monitor User Guide

Converting Custom Code

e-Monitor 5.0 and Earlier

e-Monitor 5.1 and Higher

WaitTill Statement

e-Monitor Scheduler

WeekDay Function

VBA Weekday Function

Workspace Statement

e-Monitor Job Editor

Year Function

VBA Year Function

See the e-Monitor reference documentation in the online help for


additional information about command syntax.

Converting e-Monitor 5.0 Shell Scripts

101

Converting Custom Code

[This page intentionally left blank.]

102

e-Monitor User Guide

Index
Activate Schedule menu option, 16
Activating Schedules, 39
Address of email, 22
AppendLog Method, 52
Application Object, 47
Changing Script Execution Order, 18
ClearLog Method, 52
Command, 43
Command Reference
AppendLog, 52
Application Object, 47
ClearLog, 52
CurrentResult Property, 53
CurrentScriptName Property, 53
DatabankIndex Property, 54
DatabankValue, 54
DoRV, 55
Email Method, 57
ErrDescription Property, 58
ErrNumber Property, 58
EventLog Method, 59
Failure Event, 59
FmtStr Function, 60
GetValue, 60, 74
IterationsBegin Event, 61
IterationsEnd Event, 62
JobBegin Event, 62
JobEnd Event, 63
JobName Property, 63
LastDuration Property, 64
Log Method, 64
MsgBox Method, 65
Notifier Property, 65
PageBegin Event, 66
PageEnd Event, 67
PageTitle Property, 67
PageURL Property, 68
PlayIndex Property, 68
RemoveValue, 68

Result Object, 48
RunJob, 70
RunNext Method, 70
RunScriptNext Method, 71
SaveLog, 72
ScriptBegin Event, 72
ScriptEnd Event, 73
ScriptName Property, 73
SetNextRunDatabankIndex, 74
SkipNextScriptMethod, 75
SNMPTrap Method, 76
Status Property, 77
StopJob Method, 77
StopSchedule, 78
StopScript Method, 78
ThisJob Object, 49
VisualScript Object, 51
Workspace Property, 78
Configure Mail Server menu option, 16
Create menu option, 38
Current Job Window
e-Monitor, 13
Current Schedule, 33
Current Schedule Window window
e-Monitor, 10
CurrentResult Property, 53
CurrentScriptName Property, 53
DatabankIndex Property, 54
DatabankValue Method, 54
Deactivate Schedule menu option, 16
Deactivating Schedules, 41
Delete menu option, 39
DoRV Method, 55
d-Tracker
Submitting Bugs, 32
Edit menu option, 39
Edit Notifications menu option, 16
Edit Severity Mapping menu option,
16
103

Index

Edit VBA menu option, 16


Editing
Jobs, 25
Schedules, 37
Email details
e-Monitor Wizard, 22, 24
Email Method, 57
e-Monitor
Current Job window features, 13
Current Schedule window features,
10
Features, 2
Job Editor menu, 16
Job Editor window features, 8
Job Summary window features, 12
Menu options, 15
Monitor Menu, 15
Sophisticated Error Reporting, 2
System requirements, 3
Using, 5
Windows NT Event Log Message,
21
Wizard, 17
e-Monitor Job
Email details, 22
e-Monitor Scripts
Importing, 29
e-Monitor Wizard
Address of email, 22
Email message body, 22
Executable file details, 23
File to execute on error, 23
Importing e-Monitor Scripts, 29
Job Notification options, 19
Launch with following arguments,
23
Subject of email, 22
Workspace and scripts, 17
ErrDescription Property, 58
ErrNumber Property, 58
Error Codes, 79
Error Handling, 44
Event Triggering, 44
EventLog Method, 59
Events
Failure, 59
IterationsBegin, 61
104

IterationsEnd, 62
JobBegin, 62
JobEnd, 63
PageBegin, 66
PageEnd, 67
ScriptBegin, 72
scriptEnd, 73
Executable file details, 23
Exit menu option, 16
Failure Codes, 81
Failure Event, 59
File Names, 44
File to execute on error, 23
FmtStr Function, 60
FTP API Error Codes, 87
Functions
FmtStr, 60
GetValue Method, 60, 68
Gopher API Error Codes, 87
HTTP API Error Codes, 88
Import Shell Script menu option, 16
Importing e-Monitor Scripts, 29
Information Codes, 79
Internet Error Codes, 83
Introduction, 1
IterationsBegin Event, 61
IterationsEnd Event, 62
Job Editor menu, 16
Job Editor Window
Status Bar, 15
Job Editor Window window
e-Monitor, 8
Job Notification Options
e-Monitor, 19
Job Report, 31
Job Summary Window, 40
e-Monitor, 12
JobBegin Event, 62
JobEnd Event, 63
JobName Property, 63
Jobs
Editing, 25
Running, 30
Selecting Visual Scripts, 18
LastDuration Property, 64
Launch with following arguments, 23
Log Method, 64
e-Monitor User Guide

Index

Menu options, 15
Activate Schedule, 16
Configure Mail Server, 16
Create, 38
Deactivate Schedule, 16
Delete, 39
Edit, 39
Edit Notifications, 16
Edit Severity Mapping, 16
Edit VBA, 16
e-Monitor, 15
Exit, 16
File, 15
Import Shell Script, 16
Job Editor menu, 16
New, 15
New Job, 15
New Schedule, 15
Open Job, 15
Open Schedule, 15
Overview, 15
Save, 15
Save Job, 16
Save Job, 15
Save Job As, 15, 16
Save Schedule, 15
Save Schedule, 39
Save Schedule As, 15
Scripts, 16
Week View, 39
Message body of email, 22
Methods
AppendLog, 52
ClearLog, 52
DatabankValue, 54
DoRV, 55
Email, 57
EventLog, 59
GetValue, 60
Log, 64
MsgBox, 65
RemoveValue, 68
RunJob, 70
RunNext, 70
RunScriptNext, 71
SaveLog, 72
SetNextRunDatabankIndex, 74
Index

SetValue, 74
SkipNextScript, 75
SNMPTrap, 76
StopJob, 77
StopSchedule, 78
StopScript, 78
Monitor menu, 15
MsgBox Method, 65
New Job menu option, 15
New menu option, 15
New Schedule menu option, 15
Notification Variables, 43
Notifier Property, 65
Objects
Application, 47
Result, 48
ThisJob, 49
VisualScript, 51
Open Job menu option, 15
Open Schedule menu option, 15
Order Scripts, 18
PageBegin Event, 66
PageEnd Event, 67
PageTitle Property, 67
PageURL Property, 68
PlayIndex Property, 68
Properties
CurrentResult, 53
CurrentScriptName, 53
DatabankIndex, 54
ErrDescription, 58
ErrNumber, 58
JobName, 63
LastDuration, 64
Notifier, 65
PageTitle, 67
PageURL, 68
PlayIndex, 68
ScriptName, 73
Status, 77
Workspace, 78
Redirection Codes, 80
Result Object, 48
Results Pane, 9
RunJob Method, 70
RunNext Method, 70
RunScriptNext Method, 71
105

Index

Save Job As menu option, 15, 16


Save Job As menu option, 15
Save Job menu option, 15, 16
Save menu option, 15
Save Schedule As menu option, 15
Save Schedule menu option, 15, 39
SaveLog Method, 72
Schedule Menus, 38
Schedules, 33
Activating, 39
Adding Jobs, 35
Creating, 33
Editing, 37
Script Execution, 44
ScriptBegin Event, 72
ScriptEnd Event, 73
Scriptlets, 43
ScriptName Property, 73
Scripts
Address of email, 22
Changing Execution Order, 18
Email details, 24
Email message body, 22
File to execute on error, 23
Pass arguments to executable, 23
Subject of email, 22
Scripts menu option, 16
Select Visual Script, 18
Select Workspace, 18
Server Error Codes, 82
Server Status codes, 79
SetNextRunDatabankIndex Method,
74

106

SetValue Method, 74
SkipNextScript Method, 75
SNMPTrap Method, 76
Sophisticated Error Reporting, 2
Starting e-Monitor Wizard, 17
Status Bar, 15
Status Property, 77
StopJob Method, 77
StopSchedule Method, 78
StopScript Method, 78
Subject of email, 22
Submitting Bugs, 32
Success Codes, 79
System Requirements, 3
ThisJob Object, 49
Toolbar, 9
Variables, 44
Visual Scripts
e-Monitor Wizard, 17
Executable details, 23
Selecting Workspace, 18
VisualScript Object, 51
Week View menu option, 39
Windows NT Event Log Message
e-Monitor Wizard, 21
Wizard
Email details, 24
Select Visual Script, 18
Select Workspace, 18
Workspace and scripts, 17
Workspace Property, 78
Workspaces
e-Monitor Wizard, 17

e-Monitor User Guide

Você também pode gostar