Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to compare values present in XML databank and textdatabank

Teja
Teja Posts: 10

Hi all,

Can anyone help me how to compare the values present in XML databank & Text databank I tried with Diff but it's allowing only 1 value per once

I need all the values present in 2 databanks to be compared at a time

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭
    edited December 2023

    Create a Diff tool as a new test. You can select one of the data bank columns from the test's Input tab and the other on the tool's Regression Control tab. Both the Input tab and Regression Control tab have a "data source" option.

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭

    The "data source" option on test Input tabs should be visible if you are using SOAtest 2020.2 or later.

  • Teja
    Teja Posts: 10

    Hi @benken_parasoft I tried with diff but its taking only one datasource column not accepting other columns, could you please suggest how to compare all columns present in a datasource with single Diff tool.

  • benken_parasoft
    benken_parasoft Posts: 1,302 ✭✭✭

    Instead of diffing two values, consider constructing two messages containing all the values you want to compare. They could be two simple JSON messages that reference your data bank (or data source) columns. For example:

    [
      "${actual_val1}",
      "${actual_val2}",
      "${actual_val3}"
    ]
    

    and

    [
      "${expected_val1}",
      "${expected_val2}",
      "${expected_val3}"
    ]
    

    You can configure the first message using a Messaging Client tool with Transport set to None and Request set to Literal with MIME type of application/json. Then you can chain a Diff tool to "Request > Traffic" with Diff mode set to JSON with the second message defined as the Regression Control.