Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

robotframework-httpctrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services

Project description

HttpCtrl library for Robot Framework

RobotFramework-HttpCtrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services to make REST API testing easy.

License: GNU General Public License



Python version: >=3.4


Installation using pip3 tool:

$ pip3 install robotframework-httpctrl

Brief Overview of the Library Content

HttpCtrl contains following general libraries:


Send GET request to obtain origin IP address and check that is not empty:

*** Settings ***

Library         HttpCtrl.Client
Library         HttpCtrl.Json

*** Test Cases ***

Get Origin Address
    Initialize Client
    Send HTTP Request   GET   /ip

    ${response status}=   Get Response Status
    ${response body}=     Get Response Body

    ${expected status}=   Convert To Integer   200
    Should Be Equal   ${response status}   ${expected status}

    ${origin}=    Get Json Value From String   ${response body}   origin
    Should Not Be Empty   ${origin}

In this example HTTP client sends POST request to HTTP server. HTTP server receives it and checks incoming request for correctness.

*** Settings ***

Library         HttpCtrl.Client
Library         HttpCtrl.Server

Test Setup       Initialize HTTP Client And Server
Test Teardown    Terminate HTTP Server

*** Test Cases ***

Receive And Reply To POST
    ${request body}=   Set Variable   { "message": "Hello!" }
    Send HTTP Request Async   POST   /post   ${request body}

    Wait For Request
    Reply By   200

    ${method}=   Get Request Method
    ${url}=      Get Request Url
    ${body}=     Get Request Body

    Should Be Equal   ${method}   POST
    Should Be Equal   ${url}      /post
    Should Be Equal   ${body}     ${request body}

*** Keywords ***

Initialize HTTP Client And Server
    Initialize Client   8000
    Start Server   8000

Terminate HTTP Server
    Stop Server

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for robotframework-httpctrl, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size robotframework-httpctrl-0.1.6.tar.gz (11.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page