Use this test step to simulate the actions of an MQTT publisher. The test step connects to the MQTT broker and sends the message to it.
You can modify the settings of a test step in its editor:
![]() |
Use the Configure Connection dialog to configure connections used by the test step. You use the same dialog to create a new connection or to update the connection from a legacy version.

Important
The connection may be used in any test case in the project, so only project-level property expansions will work correctly for connection settings.

Enable the check box if the MQTT server requires authentication.

If you enable storing Will messages on the MQTT server, this message will be sent to listeners if the "publisher" client disconnects from the server without sending the Disconnect message.

Note
You can connect by specifying the CA certificate without filling in the other parameters.
Besides the test step editor, you can adjust the test step’s behavior by using its properties in the Properties and Custom Publish using MQTT Test Step Properties panels in the Navigator.
Properties
Name | Description |
---|---|
Name | The test step’s name. |
Description | Text describing the test step. |
Custom Publish using MQTT Test Step Properties
Values on the Custom Publish using MQTT Test Step Properties tab are available to other test steps in your project. For instance, you can verify these property values with the Assertion test step, or check them and change the execution flow with the Conditional GoTo test step.
You can load values of custom properties from a file or save them to a file. To learn more, see About Properties.
This tab contains the following properties that provide access to the request and response data.
Name | Description |
---|---|
ServerURI | Specifies the MQTT server’s URL with the used protocols. NoteCorresponds to the ServerURL option specified on the General tab of the connection settings. |
Message | The contents of the message. NoteThe property corresponds to the Message option in the test step editor. |
Timeout | Specifies how long ReadyAPI waits for the connection to the MQTT broker (in milliseconds). NoteThe property corresponds to the Timeout option in the test step editor. |
CertKeyPEM | Specifies the fully-qualified path to the client key file. NoteCorresponds to the Key file option specified on the SSL Settings tab of the connection settings. |
CertSniServer | Specifies the host name of the server, to which you want to connect. NoteCorresponds to the Server host name option specified on the SSL Settings tab of the connection settings. |
Login | The user name for connecting to the MQTT server. NoteCorresponds to the Login option specified on the Authentication page of the connection settings. |
CertKeyPassword | Specifies the password for the client’s private key file. NoteCorresponds to the Key password option specified on the SSL Settings tab of the connection settings. |
CertCAPEM | Specifies the fully-qualified path to the CA certificate that was used to sign the server certificate. NoteCorresponds to the CA certificate option specified on the SSL Settings tab of the connection settings. |
QoS | Specifies the Quality of Service. Possible values:
NoteThe property corresponds to the Quality of Service option in the test step editor. |
ClientID | The client identifier is used by the server to identify a client. NoteThe property corresponds to the ClientID option specified in the connection settings. |
CertClientPEM | Specifies the fully-qualified path to the client’s certificate that will be used to sign messages. NoteCorresponds to the CA certificate option specified on the SSL Settings tab of the connection settings. |
Topic | The message’s topic. NoteThe property corresponds to the Topic option in the test step editor. |
MessageType | Encoding of the published message. NoteThe property corresponds to the Message type option in the test step editor. |
Password | The user password for connecting to the MQTT server. NoteCorresponds to the Password option specified on the Authentication page of the connection settings. |
If the test step is run as part of a test case, you can see the test log in the Transaction Log panel.