Jmeter Uploading a file

1,305 views
Skip to first unread message

Babu.M Bhagyaraj

unread,
Dec 4, 2013, 6:20:17 AM12/4/13
to seleniu...@googlegroups.com
Dear all while  i uploading a csv file using Jmeter during recording its showing the following issue after file uploads :plz help me to rectify the issue 


java.io.FileNotFoundException: 40connection.csv (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at org.apache.http.entity.mime.content.FileBody.writeTo(FileBody.java:92)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$ViewableFileBody.writeTo(HTTPHC4Impl.java:773)
    at org.apache.http.entity.mime.HttpMultipart.doWriteTo(HttpMultipart.java:206)
    at org.apache.http.entity.mime.HttpMultipart.writeTo(HttpMultipart.java:224)
    at org.apache.http.entity.mime.MultipartEntity.writeTo(MultipartEntity.java:183)
    at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:98)
    at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
    at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:122)
    at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:271)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.sendRequestEntity(ManagedClientConnectionImpl.java:197)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:257)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:717)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:522)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
    at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.

Thanks and regards
Babu




Dmitri T

unread,
Dec 4, 2013, 8:38:39 AM12/4/13
to seleniu...@googlegroups.com
Hi Babu,

It looks like that JMeter is unable to locate your file - "40connection.csv" 

Make sure that you:

  1. Make sure that you have following box checked under your file-uploading HTTP Sampler: "Use multipart/form-data for POST"
  2. Make sure that your "File Path" bit has correct path to your 40connection.csv file
JMeter uses FileServer class to work with filesystem items. You can use a Beanshell Sampler with following code

log.info("MY BASE DIR = " + FileServer.getFileServer().getBaseDir());

To determine current directory JMeter looks files in. 

Look into your jmeter.log file for a line containing "MY BASE DIR" in my case it's 

2013/12/04 16:37:21 INFO  - jmeter.util.BeanShellTestElement: MY BASE DIR = /home/glinius/Applications/jmeter/extras
Message has been deleted

Lusitha Perera

unread,
Jun 2, 2014, 5:01:19 AM6/2/14
to seleniu...@googlegroups.com
Hi Babu i Had the same problem in recording Jmeter File Content upload

Solution is :- Copy the files to upload in bin folder of JMeter
Reply all
Reply to author
Forward
0 new messages