# ReportPortal integration for RobotFramework
A RobotFramework Listener to report test results to ReportPortal
> **DISCLAIMER**: We use Google Analytics for sending anonymous usage information such as agent's and client's names,
> and their versions after a successful launch start. This information might help us to improve both ReportPortal
> backend and client sides. It is used by the ReportPortal team only and is not supposed for sharing with 3rd parties.
[](https://pypi.python.org/pypi/robotframework-reportportal)
[](https://pypi.org/project/robotframework-reportportal)
[](https://github.com/reportportal/agent-Python-RobotFramework/actions/workflows/tests.yml)
[](https://codecov.io/gh/reportportal/agent-Python-RobotFramework)
[](https://slack.epmrpp.reportportal.io/)
[](http://stackoverflow.com/questions/tagged/reportportal)
[](http://reportportal.io?style=flat)
* [Installation](https://github.com/reportportal/agent-Python-RobotFramework#installation)
* [Usage](https://github.com/reportportal/agent-Python-RobotFramework#usage)
* [Send attachement (screenshots)](https://github.com/reportportal/agent-Python-RobotFramework#send-attachement-screenshots)
* [Integration with GA](https://github.com/reportportal/agent-Python-RobotFramework#integration-with-ga)
* [Copyright Notice](https://github.com/reportportal/agent-Python-RobotFramework#copyright-notice)
## Installation
First you need to install RobotFramework:
pip install robotframework
The latest stable version of library is available on PyPI:
pip install robotframework-reportportal
## Usage
### Properties
For reporting results to ReportPortal you need to pass some variables
to `robot` run:
REQUIRED:
```
--listener robotframework_reportportal.listener
--variable RP_API_KEY:"your_user_api_key"
--variable RP_ENDPOINT:"your_reportportal_url"
--variable RP_LAUNCH:"launch_name"
--variable RP_PROJECT:"reportportal_project_name"
```
NOT REQUIRED:
```
--variable RP_CLIENT_TYPE:"SYNC"
- Type of the under-the-hood ReportPortal client implementation. Possible values: [SYNC, ASYNC_THREAD, ASYNC_BATCHED].
--variable RP_LAUNCH_UUID:"id_of_existing_rp_launch"
- ID of existing ReportPortal launch
--variable RP_LAUNCH_DOC:"some_documentation_for_launch"
- Description for the launch
--variable RP_LAUNCH_ATTRIBUTES:"RF tag_name:tag_value"
- Space-separated list of tags/attributes for the launch
--variable RP_LAUNCH_UUID_PRINT:"True"
- Default value is "False", enables printing Launch UUID on test run start.
--variable RP_LAUNCH_UUID_PRINT_OUTPUT:"stderr"
- Default value is "stdout", Launch UUID print output. Possible values: [stderr, stdout].
--variable RP_TEST_ATTRIBUTES:"key1:value1 key1:value2 tag key2:value3"
- Space-separated list of tags/attributes for the tests
--variable RP_CONNECT_TIMEOUT:"20"
- Default value is "10.0", connection timeout to ReportPortal server.
--variable RP_READ_TIMEOUT:"20"
- Default value is "10.0", response read timeout for ReportPortal connection.
--variable RP_LOG_BATCH_SIZE:"10"
- Default value is "20", affects size of async batch log requests
--variable RP_LOG_BATCH_PAYLOAD_SIZE:"10240000"
- Default value is "65000000", maximum payload size of async batch log
requests
--variable RP_RERUN:"True"
- Default is "False". Enables rerun mode for the last launch.
--variable RP_RERUN_OF:"xxxxx-xxxx-xxxx-lauch-uuid"
- Default is "None". Enables rerun mode for the launch with the specified
UUID. Should be used in combination with the RP_RERUN option.
--variable RP_SKIPPED_ISSUE:"True"
- Default value is "True", marks skipped test items with 'To Investigate'
--variable RP_ATTACH_LOG:"True"
- Default value is "False", attaches Robot Framework HTML log file to
the launch.
--variable RP_ATTACH_REPORT:"True"
- Default value is "False", attaches Robot Framework HTML report file to
the launch.
--variable RP_ATTACH_XUNIT:"True"
- Default value is "False", attaches Robot Framework XUnit result file to
the launch.
--variable RP_VERIFY_SSL:"True"
- Default value is "True", disables SSL verification for HTTP requests.
Also, you can specify a full path to your certificate as the value.
--variable RP_REMOVE_KEYWORDS:"True"
- Default value is "False", remove keywords from reporting, passed with '--remove-keywords' Robot's argument.
--variable RP_FLATTEN_KEYWORDS:"True"
- Default value is "False", flatten keywords on reporting, passed with '--flatten-keywords' Robot's argument.
```
### Logging
Custom logger which supports attachments can be used in Python keywords.
Usage of this logger is similar to the standard robot.api.logger with addition
of an extra kwarg "attachment":
```python
import subprocess
from robotframework_reportportal import logger
def log_free_memory():
logger.debug("Collecting free memory statistics!")
logger.debug(
"Memory consumption report",
attachment={
"name": "free_memory.txt",
"data": subprocess.check_output("free -h".split()),
"mime": "text/plain",
},
)
```
## Test case ID
It's possible to tag tests the following way `test_case_id:12345` using default
Robot Framework tagging functionality. ID specified after `:` will be sent to
ReportPortal.
## Send attachment (screenshots)
https://github.com/reportportal/client-Python#send-attachement-screenshots
## Copyright Notice
Licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
license (see the LICENSE.txt file).
Raw data
{
"_id": null,
"home_page": "https://github.com/reportportal/agent-Python-RobotFramework",
"name": "robotframework-reportportal",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "testing, reporting, robot framework, reportportal, agent",
"author": "ReportPortal Team",
"author_email": "support@reportportal.io",
"download_url": "https://files.pythonhosted.org/packages/ba/0b/f8c1c01146e2fa1be9482f3d63ff9fd885eb934a44d5bcc27583bb53f9bc/robotframework_reportportal-5.6.2.tar.gz",
"platform": null,
"description": "# ReportPortal integration for RobotFramework\n\nA RobotFramework Listener to report test results to ReportPortal\n\n> **DISCLAIMER**: We use Google Analytics for sending anonymous usage information such as agent's and client's names,\n> and their versions after a successful launch start. This information might help us to improve both ReportPortal\n> backend and client sides. It is used by the ReportPortal team only and is not supposed for sharing with 3rd parties.\n\n[](https://pypi.python.org/pypi/robotframework-reportportal)\n[](https://pypi.org/project/robotframework-reportportal)\n[](https://github.com/reportportal/agent-Python-RobotFramework/actions/workflows/tests.yml)\n[](https://codecov.io/gh/reportportal/agent-Python-RobotFramework)\n[](https://slack.epmrpp.reportportal.io/)\n[](http://stackoverflow.com/questions/tagged/reportportal)\n[](http://reportportal.io?style=flat)\n\n\n* [Installation](https://github.com/reportportal/agent-Python-RobotFramework#installation)\n* [Usage](https://github.com/reportportal/agent-Python-RobotFramework#usage)\n* [Send attachement (screenshots)](https://github.com/reportportal/agent-Python-RobotFramework#send-attachement-screenshots)\n* [Integration with GA](https://github.com/reportportal/agent-Python-RobotFramework#integration-with-ga)\n* [Copyright Notice](https://github.com/reportportal/agent-Python-RobotFramework#copyright-notice)\n\n## Installation\n\nFirst you need to install RobotFramework:\n\n pip install robotframework\n\nThe latest stable version of library is available on PyPI:\n\n pip install robotframework-reportportal\n\n## Usage\n\n### Properties\n\nFor reporting results to ReportPortal you need to pass some variables\nto `robot` run:\n\nREQUIRED:\n\n```\n--listener robotframework_reportportal.listener\n--variable RP_API_KEY:\"your_user_api_key\"\n--variable RP_ENDPOINT:\"your_reportportal_url\"\n--variable RP_LAUNCH:\"launch_name\"\n--variable RP_PROJECT:\"reportportal_project_name\"\n```\n\nNOT REQUIRED:\n\n```\n--variable RP_CLIENT_TYPE:\"SYNC\"\n - Type of the under-the-hood ReportPortal client implementation. Possible values: [SYNC, ASYNC_THREAD, ASYNC_BATCHED].\n--variable RP_LAUNCH_UUID:\"id_of_existing_rp_launch\"\n - ID of existing ReportPortal launch\n--variable RP_LAUNCH_DOC:\"some_documentation_for_launch\"\n - Description for the launch\n--variable RP_LAUNCH_ATTRIBUTES:\"RF tag_name:tag_value\"\n - Space-separated list of tags/attributes for the launch\n--variable RP_LAUNCH_UUID_PRINT:\"True\"\n - Default value is \"False\", enables printing Launch UUID on test run start.\n--variable RP_LAUNCH_UUID_PRINT_OUTPUT:\"stderr\"\n - Default value is \"stdout\", Launch UUID print output. Possible values: [stderr, stdout].\n--variable RP_TEST_ATTRIBUTES:\"key1:value1 key1:value2 tag key2:value3\"\n - Space-separated list of tags/attributes for the tests\n--variable RP_CONNECT_TIMEOUT:\"20\"\n - Default value is \"10.0\", connection timeout to ReportPortal server.\n--variable RP_READ_TIMEOUT:\"20\"\n - Default value is \"10.0\", response read timeout for ReportPortal connection.\n--variable RP_LOG_BATCH_SIZE:\"10\"\n - Default value is \"20\", affects size of async batch log requests\n--variable RP_LOG_BATCH_PAYLOAD_SIZE:\"10240000\"\n - Default value is \"65000000\", maximum payload size of async batch log\n requests\n--variable RP_RERUN:\"True\"\n - Default is \"False\". Enables rerun mode for the last launch.\n--variable RP_RERUN_OF:\"xxxxx-xxxx-xxxx-lauch-uuid\"\n - Default is \"None\". Enables rerun mode for the launch with the specified\n UUID. Should be used in combination with the RP_RERUN option.\n--variable RP_SKIPPED_ISSUE:\"True\"\n - Default value is \"True\", marks skipped test items with 'To Investigate'\n--variable RP_ATTACH_LOG:\"True\"\n - Default value is \"False\", attaches Robot Framework HTML log file to\n the launch.\n--variable RP_ATTACH_REPORT:\"True\"\n - Default value is \"False\", attaches Robot Framework HTML report file to\n the launch.\n--variable RP_ATTACH_XUNIT:\"True\"\n - Default value is \"False\", attaches Robot Framework XUnit result file to\n the launch.\n--variable RP_VERIFY_SSL:\"True\"\n - Default value is \"True\", disables SSL verification for HTTP requests.\n Also, you can specify a full path to your certificate as the value.\n--variable RP_REMOVE_KEYWORDS:\"True\"\n - Default value is \"False\", remove keywords from reporting, passed with '--remove-keywords' Robot's argument.\n--variable RP_FLATTEN_KEYWORDS:\"True\"\n - Default value is \"False\", flatten keywords on reporting, passed with '--flatten-keywords' Robot's argument.\n```\n\n### Logging\n\nCustom logger which supports attachments can be used in Python keywords.\nUsage of this logger is similar to the standard robot.api.logger with addition\nof an extra kwarg \"attachment\":\n\n```python\nimport subprocess\nfrom robotframework_reportportal import logger\n\n\ndef log_free_memory():\n logger.debug(\"Collecting free memory statistics!\")\n logger.debug(\n \"Memory consumption report\",\n attachment={\n \"name\": \"free_memory.txt\",\n \"data\": subprocess.check_output(\"free -h\".split()),\n \"mime\": \"text/plain\",\n },\n )\n```\n\n## Test case ID\n\nIt's possible to tag tests the following way `test_case_id:12345` using default\nRobot Framework tagging functionality. ID specified after `:` will be sent to\nReportPortal.\n\n## Send attachment (screenshots)\n\nhttps://github.com/reportportal/client-Python#send-attachement-screenshots\n\n## Copyright Notice\n\nLicensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)\nlicense (see the LICENSE.txt file).\n",
"bugtrack_url": null,
"license": null,
"summary": "Agent for reporting RobotFramework test results to ReportPortal",
"version": "5.6.2",
"project_urls": {
"Download": "https://github.com/reportportal/agent-Python-RobotFramework/tarball/5.6.2",
"Homepage": "https://github.com/reportportal/agent-Python-RobotFramework"
},
"split_keywords": [
"testing",
" reporting",
" robot framework",
" reportportal",
" agent"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f0e523c445ffbdc7e4afdd9ef459a912b8efcf27a173016c83055c54f57fb705",
"md5": "0595afb12b61c3cbbbd936f373e13f00",
"sha256": "a5c4e371f91da72b20d42b0c652a2d11444ff6934da202c8b930546203748195"
},
"downloads": -1,
"filename": "robotframework_reportportal-5.6.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0595afb12b61c3cbbbd936f373e13f00",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 32901,
"upload_time": "2025-01-17T13:18:34",
"upload_time_iso_8601": "2025-01-17T13:18:34.744444Z",
"url": "https://files.pythonhosted.org/packages/f0/e5/23c445ffbdc7e4afdd9ef459a912b8efcf27a173016c83055c54f57fb705/robotframework_reportportal-5.6.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ba0bf8c1c01146e2fa1be9482f3d63ff9fd885eb934a44d5bcc27583bb53f9bc",
"md5": "70533c405396283496811ed9455bd43d",
"sha256": "a2f650c26bb021eece6b4d23b9d7505291c7f60ca8382cc03941ae99dfc96af7"
},
"downloads": -1,
"filename": "robotframework_reportportal-5.6.2.tar.gz",
"has_sig": false,
"md5_digest": "70533c405396283496811ed9455bd43d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 28021,
"upload_time": "2025-01-17T13:18:36",
"upload_time_iso_8601": "2025-01-17T13:18:36.912776Z",
"url": "https://files.pythonhosted.org/packages/ba/0b/f8c1c01146e2fa1be9482f3d63ff9fd885eb934a44d5bcc27583bb53f9bc/robotframework_reportportal-5.6.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-17 13:18:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "reportportal",
"github_project": "agent-Python-RobotFramework",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "python-dateutil",
"specs": [
[
"~=",
"2.9.0.post0"
]
]
},
{
"name": "reportportal-client",
"specs": [
[
"~=",
"5.6.0"
]
]
},
{
"name": "robotframework",
"specs": []
}
],
"tox": true,
"lcname": "robotframework-reportportal"
}