[Webtest] New step - CompareToExpected

David Louvton webtest@lists.canoo.com
Tue, 31 Aug 2004 12:05:38 -0700


This is a multi-part message in MIME format.

------_=_NextPart_001_01C48F8D.80D6D5A4
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I uploaded a new step to the community site called CompareToExpected.=20

=20

http://webtest-community.canoo.com/wiki/space/CompareToExpected

=20

This step is a very powerful tool to compare the last response (the
actual html file) to the expected html.=20

In order to compare just the relevant data, you have the following
options: removing all html tags, or removing any dynamic content (like
date, time etc.) using regular expressions.

To make this step even more powerful, I used the JavaDiff library which
lets you see exactly the differences if the last response and the
expected result file differ.

Creating the expected results file couldn't be any easier. If the file
that you specified as the expected result file does not exist, then the
file will be created (it's a copy of the last response).

=20

Please let me know if you have any questions, or suggestions how to
enhance this step.

=20

David

=20


------_=_NextPart_001_01C48F8D.80D6D5A4
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=3D"Content-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;}
p.paragraph, li.paragraph, div.paragraph
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman";}
@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'>I uploaded a new step to the community site called
CompareToExpected. <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'><a
href=3D"http://webtest-community.canoo.com/wiki/space/CompareToExpected"
title=3D"http://webtest-community.canoo.com/wiki/space/CompareToExpected"=
>http://webtest-community.canoo.com/wiki/space/CompareToExpected</a><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'>This step is a very powerful tool to compare the last
response (the actual html file) to the expected html. =
<o:p></o:p></span></font></p>

<p class=3Dparagraph><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>In order to compare just the relevant data, you have =
the
following options: removing all html tags, or removing any dynamic =
content
(like date, time etc.) using regular =
expressions.<o:p></o:p></span></font></p>

<p class=3Dparagraph><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>To make this step even more powerful, I used the =
JavaDiff
library which lets you see exactly the differences if the last response =
and the
expected result file differ.<o:p></o:p></span></font></p>

<p class=3Dparagraph><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Creating the expected results file couldn't be any =
easier.
If the file that you specified as the expected result file does not =
exist, then
the file will be created (it's a copy of the last =
response).<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'>Please let me know if you have any questions, or =
suggestions
how to enhance this step.<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'>David<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>

</div>

</body>

</html>

------_=_NextPart_001_01C48F8D.80D6D5A4--