Skip to main content

HttpCtrl library for Robot Framework

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

License: The 3-Clause BSD License

Documentation: https://annoviko.github.io/robotframework-httpctrl/

Dependencies

Python version: >=3.8

Installation

Installation using pip3 tool:

$ pip3 install robotframework-httpctrl

Brief Overview of the Library Content

HttpCtrl contains following general libraries:

Examples

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   www.httpbin.org
    Send HTTP Request   GET   /ip

    ${response status}=   Get Response Status
    ${response body}=     Get Response Body
    ${response body}=     Decode Bytes To String   ${response body}   UTF-8

    ${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         String
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
    ${body}=     Decode Bytes To String   ${body}   UTF-8

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

*** Keywords ***

Initialize HTTP Client And Server
    Initialize Client   127.0.0.1   8000
    Start Server        127.0.0.1   8000

Terminate HTTP Server
    Stop Server

Metadata

Release files for robotframework-httpctrl 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robotframework-httpctrl 0.3.3
File Size Uploaded
robotframework_httpctrl-0.3.3.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for robotframework-httpctrl 0.3.3
File Interpreter ABI Platform
robotframework_httpctrl-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 42.0 kB

Release files / robotframework_httpctrl-0.3.3.tar.gz

Download URL robotframework_httpctrl-0.3.3.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
47a49c8df27897e637061b9dc849ea6bf9c6aba075afd1d1ce4ff58c18380fbd
BLAKE2b-256 checksum
How to use checksums
207e36918484783f1ee996ddec6ffec9b7e1679280c041524ef14525c14a5ef9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / robotframework_httpctrl-0.3.3-py3-none-any.whl

Download URL robotframework_httpctrl-0.3.3-py3-none-any.whl
Size 22.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4594e9274895c950289b3ce5bb967d8344f3cfed07a0b8d5c656e5c070a2e4b
BLAKE2b-256 checksum
How to use checksums
33920724088275562e29ccee908a51e08416451e369b2034626516baee662cba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

1 release file

0.3.0

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page