Testing a Database Server

A few things you will need before proceeding to build a Database Test Plan are:
  1. A working database driver. Following the database that you are using on your database server, copy the .jar file contained in the database driver and pastes it in the lib folder of your JMeter installation path.
  2. A valid database-schema.
  3. Valid non-empty database table(s).
  4. A valid user-level access to the database. It is important for the database to have a user other than the root user for testing purpose, in order to prevent any potential data misuse.
As usual we will start off by adding a thread group to the Test Plan. You may need to configure in order to have 1000 threads, with minimal start-up time, e.g. 3 seconds, with multiple repeats just to demonstrate how far we can test a database in this manner. Then, add a JDBC Connection Configuration as the thread's first child. You may choose to use the default values or configure as you wish in tandem with the database in use.

For this Test Plan, configure as following:

JDBC Connection Configuration
JDBC Connection Configuration
Add a JDBC Request sampler to the thread, and create an SQL statement that serves your testing purpose. I used a simple SQL query for this example.

JDBC Request
JDBC Request
You may want to add assertions to the sampler to verify that it returns the expected results. Save and Run the Test Plan as needed.

Testing an FTP Server

What you will need before proceeding to build a FTP Test Plan includes:
  1. A running FTP server on the target machine.
  2. A valid path to the shared files in your FTP server.
  3. Valid non-empty files in the FTP installation path.
  4. A valid user-level access to the files.
As usual we will start off by adding a Thread Group to the Test Plan. You may need to configure in order to have multiple threads, with minimal start-up time, with multiple repeats—just to demonstrate how far we can test a file server in this manner. Then, add an FTP Request Defaults element as the thread's first child. You may choose to use the default values or configure as you wish in tandem with the file server in use.

Add an FTP Request sampler to the thread, and configure as seen in the following snapshot:


FTP Request
FTP Request
Note that this sampler requests a file located in the FTP Share folder of the file server, downloads it and saves it using a different file name in the download path. The downloaded file names are created following the thread number generated by each thread that makes the file request. This effect is achieved by appending the __threadNum function—a JMETER built-in function—to the thread's own copy of the downloaded file.

You may want to add assertions to the sampler to verify that it returns the expected results. Save and Run the Test Plan as needed.