[Webtest] RE: new user to webtest..
Colin O'Brien
webtest@lists.canoo.com
Tue, 19 Apr 2005 15:00:12 +0100
This is a multi-part message in MIME format.
------=_NextPart_000_003D_01C544F0.7C9F6D70
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Hi Swamy,
Check out the comprehensive syntax reference @
http://webtest.canoo.com/manual/syntax.html
Also with your canoo distribution there are lots of examples of these steps
in action in the ~canoo\selftests\tests directory. There is no user
interface as such, the tests are run from the command line through ANT
So install ANT
Set your ANT_HOME environment variable
Update your system path to include $ANT_HOME/bin
Install canoo
Set your webtest.home variable to point to the canoo root directory e.g.
c:\canoo
Install Java
Set the JAVA_HOME environment variable
Then write your xml files and run them through ANT as Vikram suggested in
his earlier mail...
Your results will be stored in XML format, the location and name of the file
is dependant on the resultfile and resultpath settings you configure in the
config section.
I have included the saveResults ANT script to format the XML results in HTML
so you can read the more easily, you can call this script using
ant -buildfile saveResults.xml then if you have everything in the correct
place is should all run ok for you... Be advised that you will need to
change the directory and file names referenced by parameters to what is
suitable for your host and canoo configuration....
Hopefully this will get you off the ground with canoo...
Regards,
Colin.
p.s. a little example, which comes as part of the canoo distribution... The
Definition.xml and Config.xml files are in another directory called
'includes' their contents are shown below also...
Example.xml
*****************************************************
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "../WebTest.dtd"[
<!ENTITY Definition SYSTEM "../includes/Definition.xml">
<!ENTITY Config SYSTEM "../includes/Config.xml">
]>
<project name="SimpleTest" basedir="." default="main">
&Definition;
<target name="main">
<testSpec name="myTest">
&Config;
<steps>
<invoke
stepid="get Login Page"
url="login" />
<verifytitle
stepid="we should see the login title"
text="Login Page" />
</steps>
</testSpec>
</target>
</project>
*****************************************************
Definition.xml
*****************************************************
<property name="webtest.home" value="${base.dir}/../.."/>
<taskdef file="${webtest.home}/webtestTaskdefs.properties">
<classpath>
<fileset dir="${webtest.home}" includes="lib/*.jar"/>
</classpath>
</taskdef>
*****************************************************
Config.xml
*****************************************************
<config
protocol="http"
host="chicago"
port="9090"
basepath="revenueoffice"
summary="true"
resultfile="Results.xml"
saveresponse="true"
resultpath="${webtest.home}\results"
haltonerror="false"
haltonfailure="false"
/>
*****************************************************
SaveResults.xml
*****************************************************
<project name="Saving results" basedir="." default="main">
<target name="main">
<xslt in="${resultsDir}\${projectName}.xml"
out="${resultsDir}\${projectName}.html"
style="..\resources\reportFromSummary.xsl"/>
</target>
</project>
*****************************************************
------=_NextPart_000_003D_01C544F0.7C9F6D70
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:v =3D=20
"urn:schemas-microsoft-com:vml" xmlns:o =3D=20
"urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
"urn:schemas-microsoft-com:office:word" xmlns:st1 =3D=20
"urn:schemas-microsoft-com:office:smarttags"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR><!--[if !mso]>
<STYLE>v\:* {
BEHAVIOR: url(#default#VML)
}
o\:* {
BEHAVIOR: url(#default#VML)
}
w\:* {
BEHAVIOR: url(#default#VML)
}
shape {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<![endif]--><o:SmartTagType downloadurl=3D"http://www.5iantlavalamp.com/"=
=20
name=3D"place"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagTyp=
e><o:SmartTagType=20
name=3D"country-region"=20
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"></o:SmartTagTyp=
e><!--[if !mso]>
<STYLE>st1\:* {
BEHAVIOR: url(#default#ieooui)
}
</STYLE>
<![endif]-->
<STYLE>@font-face {
font-family: Courier;
}
@font-face {
font-family: Tahoma;
}
@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
COLOR: purple; TEXT-DECORATION: underline
}
P {
FONT-SIZE: 12pt; MARGIN-LEFT: 0in; MARGIN-RIGHT: 0in; FONT-FAMILY: "Times =
New Roman"; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto
}
SPAN.emailstyle17 {
COLOR: windowtext; FONT-FAMILY: Arial
}
SPAN.emailstyle18 {
COLOR: navy; FONT-FAMILY: Arial
}
SPAN.EmailStyle21 {
COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply
}
DIV.Section1 {
page: Section1
}
</STYLE>
</HEAD>
<BODY lang=3DEN-US vLink=3Dpurple link=3Dblue>
<DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Hi=20
Swamy,</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Check=20
out the comprehensive syntax reference @</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2><A=20
href=3D"http://webtest.canoo.com/manual/syntax.html">http://webtest.canoo.c=
om/manual/syntax.html</A></FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Also=20
with your canoo distribution there are lots of examples of these steps in a=
ction=20
in the ~canoo\selftests\tests directory. There is no user interface as such=
, the=20
tests are run from the command line through ANT</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>So=20
install ANT</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Set=20
your ANT_HOME environment variable</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Update=20
your system path to include $ANT_HOME/bin</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>Install canoo</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Set=20
your webtest.home variable to point to the canoo root directory e.g.=20
c:\canoo</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>Install Java</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Set=20
the JAVA_HOME environment variable</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Then=20
write your xml files and run them through ANT as Vikram suggested in his ea=
rlier=20
mail...</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>Your=20
results will be stored in XML format, the location and name of the fil=
e is=20
dependant on the resultfile and resultpath settings you configure in the co=
nfig=20
section.</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>I have=20
included the saveResults ANT script to format the XML results in HTML so yo=
u can=20
read the more easily, you can call this script using ant -buildfile=20
saveResults.xml then if you have everything in the correct place is should =
all=20
run ok for you... Be advised that you will need to change the directory and=
file=20
names referenced by parameters to what is suitable for your host and canoo=
=20
configuration....</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>Hopefully this will get you off the ground with=20
canoo...</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>Colin.</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff si=
ze=3D2>p.s. a=20
little example, which comes as part of the canoo distribution... The=20
Definition.xml and Config.xml files are in another directory called 'includ=
es'=20
their contents are shown below also...</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2></FONT></SPAN> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>Example.xml</FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2><?xml version=3D"1.0"?><BR><!DOCTYPE project SYSTEM=20
"../WebTest.dtd"[<BR> <!ENTITY Definition SYSTEM=20
"../includes/Definition.xml"><BR> <!ENTITY Config SYSTEM=
=20
"../includes/Config.xml"></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>]><BR><project name=3D"SimpleTest" basedir=3D"."=20
default=3D"main"></FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2> &Definition;</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2> <target name=3D"main"><BR> &nb=
sp; =20
<testSpec=20
name=3D"myTest"><BR> =20
&Config;<BR> =20
<steps><BR> &nbs=
p; =20
<invoke=20
<BR>  =
; =20
stepid=3D"get Login=20
Page"<BR> =
=20
url=3D"login"=20
/><BR> =
=20
<verifytitle=20
<BR>  =
; =20
stepid=3D"we should see the login=20
title"<BR>  =
; =20
text=3D"Login Page" /><BR> &nbs=
p;=20
</steps><BR> =20
</testSpec><BR> =20
</target><BR></project></FONT></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><FON=
T=20
face=3DArial color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><FON=
T=20
face=3DArial color=3D#0000ff size=3D2>Definition.xml</FONT></SPAN></SPAN></=
DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff size=3D2><=
property=20
name=3D"webtest.home" value=3D"${base.dir}/../.."/><BR> <=
taskdef=20
file=3D"${webtest.home}/webtestTaskdefs.properties"><BR> &nbs=
p; =20
<classpath><BR> =20
<fileset dir=3D"${webtest.home}"=20
includes=3D"lib/*.jar"/><BR> =20
</classpath><BR> =20
</taskdef></FONT></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff size=3D2>Config.xml</FONT></SPAN></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></SPAN></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><FONT face=3DArial color=3D#0000ff=20
size=3D2> <config=20
<BR> =20
protocol=3D"http"<BR> =
=20
host=3D"chicago"<BR> &=
nbsp; =20
port=3D"9090"<BR> &nbs=
p; =20
basepath=3D"revenueoffice"=20
<BR> =20
summary=3D"true"<BR> &=
nbsp; =20
resultfile=3D"Results.xml"<BR> &nb=
sp; =20
saveresponse=3D"true"<BR> &n=
bsp; =20
resultpath=3D"${webtest.home}\results"<BR> &nb=
sp; =20
haltonerror=3D"false"<BR> &n=
bsp; =20
haltonfailure=3D"false"<BR> =
=20
/> =20
</FONT></SPAN></SPAN></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></SPAN></SPAN></SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff=20
size=3D2>SaveResults.xml</FONT></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></=
DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SP=
AN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff size=3D2><project name=3D"Saving results" basedir=3D"."=
=20
default=3D"main"><BR> <target=20
name=3D"main"></FONT></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff size=3D2> &n=
bsp;=20
<xslt in=3D"${resultsDir}\${projectName}.xml"=20
out=3D"${resultsDir}\${projectName}.html"<BR> =
=20
style=3D"..\resources\reportFromSummary.xsl"/><BR> &nb=
sp;=20
</target><BR></project> </FONT></SPAN></SPAN></SPAN>=
</SPAN></SPAN></SPAN></DIV>
<DIV><SPAN class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPA=
N=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><SPAN=20
class=3D929233513-19042005><SPAN class=3D929233513-19042005><FONT face=3DAr=
ial=20
color=3D#0000ff=20
size=3D2>*****************************************************</FONT></SPAN=
></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SP=
AN></DIV></DIV></BODY></HTML>
------=_NextPart_000_003D_01C544F0.7C9F6D70--