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.5.tar.gz (10.9 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.5-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ReadOutputXml-RobotFramework-0.0.5.tar.gz
  • Upload date:
  • Size: 10.9 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.5.tar.gz
Algorithm Hash digest
SHA256 b43cf84ffdb3ede4d9f89f1af78b9004246af605f1684b5691c2d64d22f8abfa
MD5 22f3e98dd6a17cbfed813f6b79b694ff
BLAKE2b-256 bfee289fd8f7ec2f90cf59359f31a056d74e8bc19691ff86de60bddb6ea62281

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ReadOutputXml_RobotFramework-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 12.1 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b83113d3966144fafc0a5da20807587700a82eb372bc14e3b53678604d9dc135
MD5 2a951f19882d146be73fac75b147fe7a
BLAKE2b-256 f9686ebf0711643d6e39b1c6a773c771f0fc67abe1feaa64edfea1b4db532060

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