[Webtest] Always failing when some text is found on page

Curelea, Alexandru Curelea, Alexandru" <acurelea@northnetwork.com
Mon, 20 Nov 2006 17:03:18 -0500


This is a multi-part message in MIME format.

------_=_NextPart_001_01C70CEF.B036C34B
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

Hi all,=20

=20

I suspect the following isn't possible in Webtest, but I thought I'd ask
anyway:

=20

Is there a way to specify (preferably in a central location like a
config file) some text, such as "Internal server error", which will
always cause a page load containing that text to fail?

=20

My reasoning is the following:

=20

Since Webtest simulates a user's actions, there are certain errors (such
as the above-mentioned "internal server error") that the user should
never be able to cause.  If such an error is caused by any of the tests,
it should be fixed (eg. it is never "expected behaviour" for the test).
When the error is given, it might not always be caught by the checks on
that page, but it will invariably cause the test to fail later on - it
would save a lot of time when reading the test results if it failed
right away.

=20

I could, of course, put a VerifyText inside a Not after every page
load.... but that isn't really an attractive option, since our test
suite numbers in the thousands of steps by now.  This is why I'm hoping
for a way to tell Webtest to always fail when it encounters that text,
no matter where.

=20

As I said, I can't really see any way to do this, so I will most likely
end up just adding that check in all of our key modules.  But any ideas
are very welcome!

=20

Thanks,

=20

Alex


------_=_NextPart_001_01C70CEF.B036C34B
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hi all, <o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I suspect the following isn&#8217;t possible in =
Webtest, but
I thought I&#8217;d ask anyway:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Is there a way to specify (preferably in a central =
location
like a config file) some text, such as &#8220;Internal server =
error&#8221;, which
will always cause a page load containing that text to =
fail?<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>My reasoning is the =
following:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Since Webtest simulates a user&#8217;s actions, there =
are
certain errors (such as the above-mentioned &#8220;internal server =
error&#8221;)
that the user should never be able to cause.&nbsp; If such an error is =
caused
by any of the tests, it should be fixed (eg. it is never &#8220;expected
behaviour&#8221; for the test).&nbsp; When the error is given, it might =
not
always be caught by the checks on that page, but it will invariably =
cause the
test to fail later on &#8211; it would save a lot of time when reading =
the test
results if it failed right away.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I could, of course, put a VerifyText inside a Not =
after
every page load&#8230;. but that isn&#8217;t really an attractive =
option, since
our test suite numbers in the thousands of steps by now.&nbsp; This is =
why I&#8217;m
hoping for a way to tell Webtest to always fail when it encounters that =
text,
no matter where.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>As I said, I can&#8217;t really see any way to do =
this, so I
will most likely end up just adding that check in all of our key =
modules.&nbsp;
But any ideas are very welcome!<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Thanks,<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Alex<o:p></o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01C70CEF.B036C34B--