Previous Topic

Next Topic

Book Contents

Book Index

Use Case 2: Load testing a non-http protocol

With the rise of connected objects in our day-to-day life, performance engineers need to increasingly take IoT (Internet of Things) oriented applications into account. But how is performance testing different with IoT? As a performance engineer, the most significant difference between traditional and IoT performance testing lies in the communication protocol. While traditional performance testing uses standard protocols (HTTP, SOAP…) to communicate, IoT also introduces new and sometimes non-standard protocols such as MQTT, CoAP, AMQP, etc.

NeoLoad has the ability to test MQTT out-of-the-box (for more information, see MQTT). For that reason we will spend some time here on CoAP, and more specifically on building an Advanced action using CoAP.

In This Chapter

What is CoAP?

The application

The Advanced action

See Also

How to extend NeoLoad capacities using Custom Advanced Actions

Understand the Use Cases

Set up the environment for Advanced actions

Use Case 1: Handling an MD5 authentication

Use Case 3: Sending my load test data to a third-party tool

What is CoAP?

CoAP (Constrained Application Protocol) is, like HTTP, a document transfer protocol. CoAP is however designed for use with resource constrained devices.

As CoAP is designed to interoperate with HTTP, both protocols have a lot in common:

The main challenge we will have with NeoLoad is communicating with CoAP. It is very close to HTTP, but uses UDP instead of TCP. This is the reason we will have to develop our own Advanced action in order to communicate with a CoAP server.

As we will be using Java for the implementation of CoAP, we will use Californium. You can find information about Californium here:

The application

As we will be building CoAP Advanced actions, we will need an application to test it against. You can either:

We will use the provided test server at coap://

The Advanced action

The code of the Advanced action in this use case is on GitHub here:

Prepare the action

As you are now familiar with eclipse and creating custom actions, we will go straight into the code. This tutorial will describe the implementation of the CoAP GET method.

We now have our skeleton for the Advanced action.

Configure the interface with NeoLoad

We will now configure how the Advanced action is presented. As shown in the previous action, you can change the default name, icon, etc. For more information, see Configure the interface of the Advanced action). We will be specifying the parameters, as well as a description for the Advanced action.

The file can be found on GitHub:

Code the behavior of the Advanced action

For the time being we will stick to sending simple requests to see how Californium works. We have four types of requests: GET, POST, PUT and DELETE.

The final action engine can be found here:

Push the action to NeoLoad

Once you have finished developing your Advanced action, you can push it to NeoLoad and try it as explained in Check the behaviour of the Advanced action.