Skip to main content

Robot Framework MITM Library

MitmLibrary Icon

Keyword

Keyword documentation

Overview

The Robot Framework MITM Library is a custom library for Robot Framework that enables integration with the Python package mitm. This library allows you to automate and test scenarios involving Man-in-the-Middle (MITM) proxy functionality within your Robot Framework test suites.

If you need help, have suggestions or want to discuss anything, feel free to contact through the slack channel.

Features

  • Interact with MITM proxy using Robot Framework keywords.
  • Manipulate network traffic for testing purposes.
  • Easily simulate different network conditions and responses.
  • Integrate MITM proxy capabilities into your existing Robot Framework tests.

Installation

  1. Install Robot Framework (if not already installed):
  2. Install mitm library using pip:
pip install robotframework-mitmlibrary

Usage

  1. Import the MITM Library in your Robot Framework test suite:
*** Settings ***
Library       MitmLibrary
  1. Use the available keywords to interact with the MITM proxy and manipulate network traffic as needed:
*** Settings ***
Library       MitmLibrary

*** Test Cases ***
Block and Delay Websites
    Start Mitm Proxy

    # Block requests to Robot Framework website
    Add To Blocklist    robotframework.org

    # Delay requests to Google
    Add Response Delay  GoogleDelay   https://www.google.com  5  # Delay for 5 seconds

    # Perform tests that involve network traffic manipulation
    # ...

    Stop Mitm Proxy

By default the proxy listens on 127.0.0.1:8080. Pass a different host explicitly if the proxy must be reachable from another machine or container:

Start Mitm Proxy    0.0.0.0    8080

Be aware that 0.0.0.0 exposes an intercepting proxy on every network interface, so anyone who can reach the machine can route their traffic through it.

Why use Mitm?

Mitm allows manipulation on single browser instance, by using a proxy. It does not require you to set up stubs or mocks that might influence the entire application at once, also resulting in stubbed/mocked behaviour while manual testing.

Examples where Mitm is useful:

  • When running in parallel, if you do not want your other instances to be influenced.
  • Manipulate the response of a request to see how the front end handles it
  • When stubs or mocks are not available or their behaviour is not sufficient for your testing needs.
  • When you want to have full control as tester, without dependency on a developer

Mitm Certificates

To test with SSL verification, or use a browser without ignoring certificates, you will need to set up the certificates related to mitm. Follow the guide on the Mitm website

Documentation

For detailed information on the available keywords and usage examples, please refer to the Keyword Documentation

Contributing

Contributions are welcome! If you encounter any issues, have suggestions for improvements, or would like to add new features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Note: This project is not officially affiliated with or endorsed by the mitmproxy project or robotframework.

Download files

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

Source Distribution

robotframework_mitmlibrary-0.3.0.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_mitmlibrary-0.3.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_mitmlibrary-0.3.0.tar.gz.

File metadata

File hashes

Hashes for robotframework_mitmlibrary-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8e6a6b43a0728d2701cbe2599a8ea517b5384bb6d8fc83a3a5e3d0d3b82fcacd
MD5 70627b73ef19444c2ceabb9e9b10eeb6
BLAKE2b-256 e8b37a06df83da09007a5d2a991ed99e24b3be769bb2a1344e30b82b4d28de3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for robotframework_mitmlibrary-0.3.0.tar.gz:

Publisher: release.yml on MobyNL/robotframework-mitmlibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file robotframework_mitmlibrary-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_mitmlibrary-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a5e69401c83a180dd37ccddfd5c92d77ff086b4a13223dc8bdc7fbd25786c4f
MD5 a1368a1a95ce5bef9e1866df90b2d2e5
BLAKE2b-256 82b5d8529380f55b99c4ed57c0396c3406092071ef14c33f442226f53ab1ac08

See more details on using hashes here.

Provenance

The following attestation bundles were made for robotframework_mitmlibrary-0.3.0-py3-none-any.whl:

Publisher: release.yml on MobyNL/robotframework-mitmlibrary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.0.0

2 files

This release

0.3.0 This release

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.8

2 files

0.1.6

1 file

0.1.5

1 file

0.1.3

2 files

0.1.1

1 file

0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page