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.1.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

  • Download URL: ReadOutputXml-RobotFramework-0.0.5.1.tar.gz
  • Upload date:
  • Size: 9.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.5.1.tar.gz
Algorithm Hash digest
SHA256 89c74c46b5f428b033a843f13ab66e59a510936a1f58e30a6886d55e9e0c38ca
MD5 1bafe4f58ddeddf963865f9a69ad3d76
BLAKE2b-256 47e082f86f74a20bde370d9ceb39aeb785dfaef552301c5e8dcdca0b45be5111

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ReadOutputXml_RobotFramework-0.0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84cb3f3b74aaa3f693715b0266c217539ed9d424e7f396cc3890fd921d4ee7f2
MD5 7b02aa0787609b437b069edc0036df48
BLAKE2b-256 420dd54ce203324744631781cdb1439815f99ef65fe8afc45c9b3143760a0c9f

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