[Webtest] Support for uploading a file?

webtest@lists.canoo.com webtest@lists.canoo.com
Thu, 10 Oct 2002 09:25:39 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C27060.86523120
Content-Type: text/plain;
	charset="iso-8859-1"

Stef,
Thanks for your reply..  I looked into httpunit, and was looking at the
Canoo SetInputField.java class...  It seems that a SetFileField or
SetInputFileField could be created relatively simply..  It looks (from some
sample code) like all I need to do is:


     webform.getRequest("form").setParameter("file",new UploadFileSpec[]
{new UploadFileSpec(theTestFile)});

However, my understanding of HTTPUnit and Canoo is too limited to figure it
all out..  I looked at the Test case for the UploadFile code in httpunit,
and it seems relatively straight forward..  But getting my "canoo" knowledge
on top may take a while.

Thanks again, and if anyone has any other testing suggestions, I would love
to hear them...
Eric



-----Original Message-----
From: Stefan G. Renz [mailto:StefanRenz@web.de]
Sent: Thursday, October 10, 2002 8:50 AM
To: webtest@lists.canoo.com; EPugh@upstate.com
Subject: Re: [Webtest] Support for uploading a file?


On Wednesday 09 October 2002 23:09, EPugh@upstate.com wrote:
> Hi all,
>
> I looked over the docs, so I expect this to be a negative result, but is
> there anyway to test a page that requires uploading a file?  I was looking
> at the setinputfield tag, but couldn't get it to pass a file, I guess
> because HTTPUnit doesn't support file uploads?

HttpUnit _does_ support file uploads...

>
> Are there any other cool tricks around this issue?
>
> Eric Pugh

Ciao
	Stef

------_=_NextPart_001_01C27060.86523120
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.89">
<TITLE>RE: [Webtest] Support for uploading a file?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Stef,</FONT>
<BR><FONT SIZE=3D2>Thanks for your reply..&nbsp; I looked into =
httpunit, and was looking at the Canoo SetInputField.java =
class...&nbsp; It seems that a SetFileField or SetInputFileField could =
be created relatively simply..&nbsp; It looks (from some sample code) =
like all I need to do is:</FONT></P>
<BR>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp; =
webform.getRequest(&quot;form&quot;).setParameter(&quot;file&quot;,new =
UploadFileSpec[] {new UploadFileSpec(theTestFile)});</FONT>
</P>

<P><FONT SIZE=3D2>However, my understanding of HTTPUnit and Canoo is =
too limited to figure it all out..&nbsp; I looked at the Test case for =
the UploadFile code in httpunit, and it seems relatively straight =
forward..&nbsp; But getting my &quot;canoo&quot; knowledge on top may =
take a while.</FONT></P>

<P><FONT SIZE=3D2>Thanks again, and if anyone has any other testing =
suggestions, I would love to hear them...</FONT>
<BR><FONT SIZE=3D2>Eric</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Stefan G. Renz [<A =
HREF=3D"mailto:StefanRenz@web.de">mailto:StefanRenz@web.de</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, October 10, 2002 8:50 AM</FONT>
<BR><FONT SIZE=3D2>To: webtest@lists.canoo.com; =
EPugh@upstate.com</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Webtest] Support for uploading a =
file?</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>On Wednesday 09 October 2002 23:09, EPugh@upstate.com =
wrote:</FONT>
<BR><FONT SIZE=3D2>&gt; Hi all,</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; I looked over the docs, so I expect this to be =
a negative result, but is</FONT>
<BR><FONT SIZE=3D2>&gt; there anyway to test a page that requires =
uploading a file?&nbsp; I was looking</FONT>
<BR><FONT SIZE=3D2>&gt; at the setinputfield tag, but couldn't get it =
to pass a file, I guess</FONT>
<BR><FONT SIZE=3D2>&gt; because HTTPUnit doesn't support file =
uploads?</FONT>
</P>

<P><FONT SIZE=3D2>HttpUnit _does_ support file uploads...</FONT>
</P>

<P><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; Are there any other cool tricks around this =
issue?</FONT>
<BR><FONT SIZE=3D2>&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; Eric Pugh</FONT>
</P>

<P><FONT SIZE=3D2>Ciao</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>Stef</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C27060.86523120--