[Webtest] Simple Test - visiting a web page

CF Wong webtest@lists.canoo.com
Mon, 17 May 2004 11:07:26 -0400


This is a multi-part message in MIME format.

------=_NextPart_000_0054_01C43BFF.2349E0C0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Lezoul, here is result of your sample test for http.
 
The test is working as per command prompt window. However, when I try to
open the generated response file with IE, it displays an error.  
 
I would appreciate your help or from other forum members. Thanks.
 
Best Regards,
CF
 
------------ sample script to visit a web page  test.xml -----------
<project name="testYcebt.xml" basedir="." default="checkWebTest">
 
<property name="base.dir" value="${basedir}"/>
<property name="webtest.home" value="${base.dir}/../.."/>
 
<taskdef file="${webtest.home}/webtestTaskdefs.properties">
   <classpath>
      <fileset dir="${webtest.home}" includes="**/lib/*.jar"/>
   </classpath>
</taskdef>
 
<target name="checkWebTest">
   <echo message="base dir is ${basedir}"/>
   <testSpec name="check calling and parsing a local file">
      <config
         host="webtest.canoo.com"
         port="80"
         basepath="/"
         saveresponse="true"
         protocol="http" />
      <steps>
         <invoke
            stepid="get local file"
            url="webtest"/>
         <verifytitle
            stepid="check the title is parsed correctly"
            text="Canoo WebTest Homepage" />
      </steps>
   </testSpec>
</target>
</project>
 
---------- message from command prompt ------------
D:\WebTest\doc\samples>ant -v -buildfile test.xml
Apache Ant version 1.5.4 compiled on August 12 2003
Buildfile: test.xml
Detected Java version: 1.4 in: D:\Sun\AppServer\jdk\jre
Detected OS: Windows XP
parsing buildfile test.xml with URI = file:D:/WebTest/doc/samples/test.xml
Project base dir set to: D:\WebTest\doc\samples
  [taskdef] Loading definitions from file
D:\WebTest\webtestTaskdefs.properties
Build sequence for target `checkWebTest' is [checkWebTest]
Complete build sequence is [checkWebTest]
 
checkWebTest:
     [echo] base dir is D:\WebTest\doc\samples
 
BUILD SUCCESSFUL
Total time: 4 seconds
 
------------------ browser error message --------------
The file lastResponse1084805112250.html was generated. 
On browsing the above file, an Alert pops up:
The file /D:/WebTest/doc/samples/manual/WebTestHome.html cannot be found.
Please check the location and try again.
 
------------  lastResponse1084805112250.html source -----------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Canoo WebTest Homepage</TITLE>
<META http-equiv="Refresh" content="0;URL=manual/WebTestHome.html">
 
</HEAD>
<BODY>
 
</BODY></HTML>


------=_NextPart_000_0054_01C43BFF.2349E0C0
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial><!--StartFragment -->Lezoul<SPAN=20
class=3D640005214-17052004>, here is result of your sample test for=20
http.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial><SPAN =
class=3D640005214-17052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><SPAN class=3D640005214-17052004>The test is =
working as per=20
command prompt window. However, when I try to open the generated =
response file=20
with IE, it displays an error.&nbsp; </SPAN></FONT></DIV>
<DIV><FONT face=3DArial><SPAN =
class=3D640005214-17052004></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><SPAN class=3D640005214-17052004>I would =
appreciate your=20
help or from other forum members. Thanks.</SPAN></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>Best Regards,</FONT></DIV>
<DIV align=3Dleft><FONT face=3DArial size=3D2>CF</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>------------ sample=20
script to visit a web page&nbsp; test.xml =
-----------</FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>&lt;project=20
name=3D"testYcebt.xml" basedir=3D"." =
default=3D"checkWebTest"&gt;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>&lt;property=20
name=3D"base.dir" value=3D"${basedir}"/&gt;<BR>&lt;property =
name=3D"webtest.home"=20
value=3D"${base.dir}/../.."/&gt;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>&lt;taskdef=20
file=3D"${webtest.home}/webtestTaskdefs.properties"&gt;<BR>&nbsp;&nbsp;=20
&lt;classpath&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;fileset=20
dir=3D"${webtest.home}" includes=3D"**/lib/*.jar"/&gt;<BR>&nbsp;&nbsp;=20
&lt;/classpath&gt;<BR>&lt;/taskdef&gt;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>&lt;target=20
name=3D"checkWebTest"&gt;<BR>&nbsp;&nbsp; &lt;echo message=3D"base dir =
is=20
${basedir}"/&gt;<BR>&nbsp;&nbsp; &lt;testSpec name=3D"check calling and =
parsing a=20
local file"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;config<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
host=3D"webtest.canoo.com"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
port=3D"80"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
basepath=3D"/"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
saveresponse=3D"true"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
protocol=3D"http" /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;steps&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;invoke<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
stepid=3D"get local=20
file"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
url=3D"webtest"/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

&lt;verifytitle<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
stepid=3D"check the title is parsed=20
correctly"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
text=3D"Canoo WebTest Homepage" /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/steps&gt;<BR>&nbsp;&nbsp;=20
&lt;/testSpec&gt;<BR>&lt;/target&gt;<BR>&lt;/project&gt;<BR>&nbsp;</FONT>=
</SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>---------- message=20
from command prompt ------------</FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial=20
size=3D2>D:\WebTest\doc\samples&gt;ant -v -buildfile test.xml<BR>Apache =
Ant=20
version 1.5.4 compiled on August 12 2003<BR>Buildfile: =
test.xml<BR>Detected Java=20
version: 1.4 in: D:\Sun\AppServer\jdk\jre<BR>Detected OS: Windows =
XP<BR>parsing=20
buildfile test.xml with URI =3D =
file:D:/WebTest/doc/samples/test.xml<BR>Project=20
base dir set to: D:\WebTest\doc\samples<BR>&nbsp; [taskdef] Loading =
definitions=20
from file D:\WebTest\webtestTaskdefs.properties<BR>Build sequence for =
target=20
`checkWebTest' is [checkWebTest]<BR>Complete build sequence is=20
[checkWebTest]</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial=20
size=3D2>checkWebTest:<BR>&nbsp;&nbsp;&nbsp;&nbsp; [echo] base dir is=20
D:\WebTest\doc\samples</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial size=3D2>BUILD=20
SUCCESSFUL<BR>Total time: 4 seconds</FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>------------------=20
browser error message --------------</FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial size=3D2>The =
file=20
lastResponse1084805112250.html was generated. </FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial size=3D2>On =
browsing the=20
above </FONT></SPAN><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>file,=20
an </FONT></SPAN><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>Alert=20
pops up:</FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial size=3D2>The =
file=20
/D:/WebTest/doc/samples/manual/WebTestHome.html cannot be found. Please =
check=20
the location and try again.</FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>------------&nbsp;=20
lastResponse1084805112250.html source -----------</FONT></SPAN></DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial =
size=3D2>&lt;!DOCTYPE HTML=20
PUBLIC "-//W3C//DTD HTML 4.0=20
Transitional//EN"&gt;<BR>&lt;HTML&gt;&lt;HEAD&gt;&lt;TITLE&gt;Canoo =
WebTest=20
Homepage&lt;/TITLE&gt;<BR>&lt;META http-equiv=3D"Refresh"=20
content=3D"0;URL=3Dmanual/WebTestHome.html"&gt;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial=20
size=3D2>&lt;/HEAD&gt;<BR>&lt;BODY&gt;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=3D640005214-17052004><FONT face=3DArial=20
size=3D2>&lt;/BODY&gt;&lt;/HTML&gt;<BR></FONT></SPAN></DIV></BODY></HTML>=


------=_NextPart_000_0054_01C43BFF.2349E0C0--