Skip to content

XML Processor

Refael Mizrahi edited this page Jan 27, 2022 · 3 revisions

XML [xml]

This processor allows you to parse XML documents into fields.

  • field
  • targetField
  • storeXml [boolean, default = true]
  • xpath [this is a json object with key:values where the key is the xpath, and the value is the field name you want for that path] EX

Example

{
  "steps": [{
    "xml": {
      "config": {
        "field": "message",
        "targetField": "xmldata",
        "store_xml": "false",
        "xpath": {
          "/testng-results/suite/test/class/@name": "test_name",
          "/testng-results/suite/test/@started-at": "start_time",
          "/testng-results/suite/test/@finished-at": "finish_time",
          "/testng-results/suite/test/@duration-ms": "total_time",
          "/testng-results/suite/test/class/test-method/@duration-ms": "time_testArray",
          "/testng-results/@total": "total_tests",
          "/testng-results/@passed": "total_passed",
          "/testng-results/@failed": "total_failed",
          "/testng-results/@skipped": "total_skipped",
          "//full-stacktrace": "error_logs"
        }
      }
    }
  }]
}
Clone this wiki locally