JMeter SFTP Request

In my previous post, we have seen how to utilize an external groovy script to make some FTP Requests.

Now there is slight change in the requirement. FTP got changed to SFTP, which means it’s more secure.

We can’t use our FTP Samplers to create a SFTP request to authenticate using SSH.

Originally I built the SSH FTP Sampler using the instructions in HOW TO BUILD SSH SFTP SAMPLER FOR JMETER? (BY IMPLEMENTS TESTBEAN)

We have to check out the source code from https://github.com/yciabaud/jmeter-ssh-sampler and then generating the target by building it using maven.

Also we need Jsch. JSch is a java implementation of SSH. This allows us to connect to an FTP server for file transfer. http://sourceforge.net/projects/jsch/files/jsch.jar/0.1.53/jsch-0.1.53.jar/download

But just to make this process simpler, I checked-in the two jar files required for creating SSH FTP request here – https://github.com/linkeshkanna/Jmeter.SSH.FTP.Request

This contains two jar files.

  1. jmeter-ssh-sampler-1.0.2-SNAPSHOT.jar
  2. jsch-0.1.53.jar

To install this in Jmeter,

  1. Copy the jmeter-ssh-sampler-1.0.2-SNAPSHOT.jar to the “Jmeter/Lib/ext” directory.
  2. Copy the “jsch-0.1.53.jar” to the “Jmeter/Lib” directory
  3. Restart Jmeter.

I have also added a sample test to list of the directory contents in a Public SFTP Server – https://github.com/linkeshkanna/Jmeter.SSH.FTP.Request/blob/master/SSH-FTP.jmx

Open this JMX file in your JMeter and run it to see this in action.

Advertisements

2 thoughts on “JMeter SFTP Request

  1. Hello!

    First of all thanks for the great plug-in. We used it but now all the sessions opened by during the test is not killed. is this the expected behavior. Can we have some work around to kill the session once the file is closed.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s