Forum Discussion

arandall's avatar
14 years ago

Simulating a failure to attach a file.

Based on this post: viewtopic.php?t=4173 I am able to attach a file using HTTP POST in soapUI.

I would like to create a test case to check the behaviour when a file is not attached and as a result expect that in the RAW output to see:
------=_Part_48_1440060721.1303890601024
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="verify_cert"; filename=""


I have tried just specifying "file:" as the value of the parameter in the request and it appears to work however any parameter after the file is not added in the request.

eg:
using media type: multipart/form-data
Name - value
testparam - hello
file - file:
action - upload

the following request is sent:
POST http://test/ HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/form-data; boundary="----=_Part_55_1560694082.1303891200440"
MIME-Version: 1.0


------=_Part_55_1560694082.1303891200440
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: form-data; name="testparam"

hello
------=_Part_55_1560694082.1303891200440
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Disposition: form-data; name="file"; filename=""


The following is missing! And the request is not closed correctly!
------=_Part_55_1560694082.1303891200440
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: form-data; name="action"

upload


Does anyone know how I can set a parameter to be an undefined file to similate a browser/user not attaching a file?
No RepliesBe the first to reply