Skip to content

jordanlaforge/robotframework-mqttlibrary

 
 

Repository files navigation

MQTTLibrary for Robot Framework

image

Latest version

Number of downloads

MQTTLibrary is a Robot Framework library that provides keywords for testing on MQTT brokers. MQTT is a lightweight protocol for machine-to-machine communication, typically used for IoT messaging. This library uses the paho client library published by eclipse project.

Installation

MQTTLibrary can be installed using pip:

pip install robotframework-mqttlibrary

You can also install it from the source distribution by running:

python setup.py install

You may need to run the above command with administrator privileges.

Usage

Import the library:

*** Settings ***
Library          MQTTLibrary

Connect to the broker, publish and disconnect:

*** Test Cases ***
Publish
    Connect     127.0.0.1
    Publish     topic=test/mqtt_test    message=test message
    [Teardown]  Disconnect

Connect to the broker, subscribe and validate that a message is received:

*** Test Cases ***
Subsribe and Validate
    Connect                 127.0.0.1
    Subscribe and Validate  topic=test/mqtt_test    qos=1   payload=test
    [Teardown]              Disconnect

Keyword documentation is available at: http://randomsync.github.io/robotframework-mqttlibrary.

Also look at tests folder for examples.

For general information about using test libraries with Robot Framework, see Robot Framework User Guide.

About

MQTT Keyword Library for Robot Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%