I am using Karate to validate xml responses from two Webmethods. We have an old webmethod that directly hits a data source. We are adding a layer above that datasource with a Webmethod and database to return the same data. The expectation is the old webmethod and new webmethod will return the same data. What I am stuck on is the responses are showing in a different formats, one is JSON and the other is XML.
My feature file setup.
Feature: Campare
Background:
* configure ssl = true
* def ddaAccounts = read(<list of test accounts>)
* configure printEnabled = false
Scenario Outline: Compare responses
Given url '<Old webmethod>'
Given request read('<request body>')
When method post
Then status 200
* xml hogan = response
* xml hogan = $response /Envelope/Body/AcctTrnInqRs
Given url '<new webmethod>'
Given request read('<request body>')
When method post
Then status 200
* xml oracle = response
* xml oracle = $response /Envelope/Body/AcctTrnInqRs
* match oracle == hogan
Examples:
| ddaAccounts |
The one thing we've notice is the one response that is returning as JSON has multiple account fields where the XML version has one.
Could that be causing the difference in formatting? Can this behavior be corrected?
Any thoughts/ help would be greatly appreciated.
Thank you, Joe