User Paul Grossman ( posted:

Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable


Sounds like this is your first stab at the Exception Handling feature.
Took me 6 months to write one that worked.=20
Best advice: use the wizard to simply close the window.
Look at the generated code from the wizard and work from there.

Best guess: WR is not recognizing the window that pops up as "Oasis Message=
Check with GUI Spy.

I found one bug in your code but it should not effect the window close.
I think you want a comparison in your if statement:
if (alivFlag =3D=3D FALSE) # <-- Also use Global constants for clarit=
y and low maintainance.

not an assignment:
if (alivFlag =3D 1)

For aestetic value, add spaces to your tl_step, or the output will likly ru=
n together.
tl_step("Pop Up Error Check",1,"Either the Verbiage "&alsvErr_msg" =
is wrong for test case " &slsvTest_case" and account number "&slsvAcctnum" =
or Fatal error has occured");

A few other comments:
Don't hardcode when you can use variables.
First assign your flag and cut the if code in half inside your for statemen=

alivFlag =3D TRUE;
Use the ? command to replace if/else that only sets a variable.
Makes much more efficient code.=20=20
Also use the for/ in statements, no more maintenance when you
add more error messages to the slavExp_arr array to the 6 that are in there=

for (i in slavExp_arr) {
alivFlag =3D (slavExp_arr[i] =3D=3D alsvErr_msg) ? FALSE : TRUE
if (alivFlag =3D=3D FALSE)

This code was re-written at home without the benefit of a WR compiler to ch=
eck my acuracy.
So I expect I might have a glitch in the syntax somewhere.

Good luck,


----- Original Message -----=20
From: shreehemant <>=20
Sent: Saturday, December 07, 2002 9:36 PM
Subject: [winrunner] Exception Handling

I am facing a lot of problem while using Exception Handling feature=20
of WR.

Here is the code in test script to define exception

define_popup_exception ("Exception_fatal", "pfnExceptionHandle", "Oasis M=


and the pfnExceptionHandle is in a compiled module.=20

public function pfnExceptionHandle(inout slavExp_arr[], in slsvTest_case,=
in slsvAcctnum)
auto alsvErr_msg,i,alivFlag;
static slivlen;

win_activate("Oasis Message");
set_window("Oasis Message",2);
static_get_text("Notification Message",alsvErr_msg);
for (i=3D0;i<=3D6;i++)
if (slavExp_arr[i] =3D=3D alsvErr_msg)
alivFlag =3D 0;
alivFlag =3D 1;

if (alivFlag =3D 1)
tl_step("Pop Up Error Check",1,"Either the Verbiage"&alsvErr_msg"=
is wrong for test case" &slsvTest_case"and account number"&slsvAcctnum"or F=
atal error has occured");


After all these WR doesn't do anything when the exception occurs.
Is there anything in the settings I'll have to change.

Please help.

Questions, View
Moderater: Ed Badger

Your use of Yahoo! Groups is subject to

Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4728.2300" name=GENERATOR>
<BODY bgColor=#ffffff>

face="Times New Roman" size=3>Exception Handling feature.</FONT></FONT></DIV>
pops up as <FONT face="Times New Roman" size=3>"Oasis