Hi there!
 I have a Problem with File Upload tests.
i debbuged the test and found , that the Site i get responsed 
is the site after the login and not the expected site after a file upload.
 I've had the problem bevore with other test, to. 
The reason was a wrong "enctype=..." parameter in the form tag of my jsp file.
but in a file upload i need to use " enctype="multipart/form-data" " 
to make the upload work. Can anybody help me?? 
It were nice to add an method for fileuploads in the next Version of JWebUnit. 

Here My JSP Source: 
  
...         
<html:form action="/Upload.do" method="post" enctype="multipart/form-data" 
focus="File" onsubmit="popupOpen()">
<table width="400" border="0" cellpadding="0" cellspacing="0" class="content" 
align="center">
  <tr>
    <td align="center" class="fieldlabel"><c:out 
value="${controllerResponse.namedInputs['File'].label}" />&nbsp;</td>
  </tr>
  <tr>
    <td align="center"><html:file property="File" size="40" /></td>
  </tr>
  <tr align="center">
    <td><hr /><html:submit property="processUpload" /></td>
  </tr>
</table>
</html:form>
   
  
My testsource:

 ... 
File file = new File( "C:\\temp\\upload.zip" ); 
UploadFileSpec[] ufs = {new UploadFileSpec(file)}; 
try { 
tester.getDialog().getResponse().getForms()[0].setParameter("File",ufs); 
} catch (SAXException e) {
 e.printStackTrace(); } 
... 
THX

_________________________________________________________________________
Mit der Gruppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle 
Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to