Skip to main content

Reader the output xml from structure RobotFramework output

Project description

ReaderOutputXml-RobotFramework

This library is a reader output xml from robotframework.

  • convert xml to dictionary (by structure robotframework output)
I have made this for publishing a package to PyPI only!

Usage

Install package by using pip:

pip install ReadOutputXml-RobotFramework

Example

  • Read output xml to dictionary.
from ReaderOutputXmlRobotFramework.ReaderRobotFramework import ReaderRobotFramework

PATH_OUTPUT_XML: str = r'D:\Robot\All_Output.xml'

reader = ReaderRobotFramework(PATH_OUTPUT_XML, '/suite')
robot_result: dict = reader.read_output_xml_file_to_dict()
print(robot_result)
  • Get testsuite name from output xml.
testsuite_name: str = reader.get_testsuite_name()
print(testsuite_name)
  • Get source file from output xml.
source_file: str = reader.get_source_file()
print(source_file)

Structure Json (output xml to dictionary)

  • Support structure output xml. (suite xpath <= 2 levels)
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Rebot 4.0 (Python 3.8.3 on darwin)" generated="20210625 16:19:04.596" rpa="false" schemaversion="2">
<suite id="s1" name="Automate Test">
<suite id="s1-s1" name="Example Project1" source="/documents/path/robot/file.robot">...</suite>
<suite id="s1-s2" name="Example Project2" source="/documents/path/robot/file2.robot">...</suite>
...
</robot>
  • define main_suite_xpath for set level xpath to get name project.
reader = ReaderRobotFramework(PATH_OUTPUT_XML, './suite/suite')

Example Json Result

{
  "Example Project1": {
    "SourceFile": "/documents/path/robot/file1.robot",
    "TestcaseDetail": [
      {
        "testcase_name": "name test1",
        "documentation": "documentation",
        "tags": "tag1, tag2",
        "step_keyword": "1. keyword1\n2. keyword2",
        "test_result": "PASS",
        "keyword_fail": "",
        "date_time": "20210625 16:16:12.619",
        "msg_error": ""
      },
      {
        "testcase_name": "name test2",
        "documentation": "documentation",
        "tags": "tag1, tag2",
        "step_keyword": "1. keyword1\n2. keyword2",
        "test_result": "PASS",
        "keyword_fail": "",
        "date_time": "20210625 16:16:13.621",
        "msg_error": ""
      }
    ]
  },
  "Example Project2": {
    "SourceFile": "/documents/path/robot/file2.robot",
    "TestcaseDetail": [
      {
        "testcase_name": "name test1",
        "documentation": "documentation",
        "tags": "tag1",
        "step_keyword": "1. keyword1",
        "test_result": "FAIL",
        "keyword_fail": "keyword2",
        "date_time": "20210625 16:34:54.895",
        "msg_error": "cannot execute keyword2"
      }
    ]
  }
}

Uninstall package

pip uninstall ReadOutputXml-RobotFramework

Project details


Download files

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

Source Distribution

ReadOutputXml-RobotFramework-0.0.4.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

ReadOutputXml_RobotFramework-0.0.4-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file ReadOutputXml-RobotFramework-0.0.4.tar.gz.

File metadata

  • Download URL: ReadOutputXml-RobotFramework-0.0.4.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.9

File hashes

Hashes for ReadOutputXml-RobotFramework-0.0.4.tar.gz
Algorithm Hash digest
SHA256 48aba53e6530f158f7207085ac242e869ef927e8c0bbaf11dbbc90596fe6c4ad
MD5 2998b6bb6262fabf29eb1714d8c58a0d
BLAKE2b-256 d3d8d3c24a75b6e61babb511fb579ed516de663dffa4279eb748ec55a72c3105

See more details on using hashes here.

File details

Details for the file ReadOutputXml_RobotFramework-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: ReadOutputXml_RobotFramework-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.9

File hashes

Hashes for ReadOutputXml_RobotFramework-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 50035639267d171ffab37af19bc98823bda0f5ed89ffc95c7ea55f91b7e5479d
MD5 dce4eaa1b11992ea8da770175dddef7a
BLAKE2b-256 7b6190b7c985000aed330322bd554a3e0b7f6819e4203e72bb2a97043315550e

See more details on using hashes here.

Supported by

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