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.

SOAtest - Can an expected difference in a field be ignored dynamically using the Diff tool?

Devi
Devi Posts: 5
edited August 19 in SOAtest

Using SOAtest, our team has used Regression Control and Suppress Task using the Diff tool to pass a test by ignoring differences where an expected difference shows up in the comparison.

However, we would like to dynamically ignore differences in a comparison for an expected field, as there are many different messages to be tested with differences expected on different lines.

Using Regression Control, we would like the difference to be handled dynamically without having to specify the line on which the difference is expected to occur.

Also, if using Suppress Task in Quality Tasks view, we would like to suppress an expected difference in a field in the comparison dynamically.

Is there a way in which this can be achieved?

We would appreciate any help with this query, many thanks!

Answers

  • benken_parasoft
    benken_parasoft Posts: 1,374 ✭✭✭

    What type of content are you diffing? Is it XML or JSON? For most cases, I do not recommend using Suppress Task... for violations from the Diff tool. Instead, you should use the Ignore Difference (JSON) or Ignore XPath (XML) option. This will automatically update the Diff tool's Ignored Differences tab with the ignored item.

  • Devi
    Devi Posts: 5

    Hi benken_parasoft, thank you for your response.

    We use the Diff tool to compare various types of data, therefore we use Text as the Diff Mode.

    Instead of ignoring differences for every type of message, in every suite, we would like to dynamically ignore the expected fields in the messages during the reading and comparing of all messages, no matter which type of message is being compared.

    Can we have a set of fields stored and accessed, so the Diff tool can access those fields to ignore the expected differences?

    Appreciate your help, thanks!

  • benken_parasoft
    benken_parasoft Posts: 1,374 ✭✭✭

    I can suggest something if you can tell me what type of message you are diffing. You say it has "fields" which suggests there is some type of structure and that it isn't just arbitrary text. Part of the solution is to not use "Text" as the diff mode and I can suggest how to do that if you can provide more detail.

  • Devi
    Devi Posts: 5

    Hi @benken_parasoft , thank you for you response.

    There is a collection of different types of messages, such as XML, DEX, Text, etc.

    Each message type is in a different test suite. We are able to ignore differences individually.

    However, instead of ignoring every message in every test suite at least once, we are looking for a generic way to globally ignore expected differences in all tests, irrespective of what the message type is.

    In order to achieve this, we would like to know if a field or variable could be used rather than the line number to ignore the difference. For example, a date time value.

    Thanks for your help.

  • benken_parasoft
    benken_parasoft Posts: 1,374 ✭✭✭
    edited August 21

    The closest thing to what you describe is Global Ignored XPath Properties:

    there may be instances when you have multiple Diff tools that use the same XPath settings.You might want multiple Diff tools to use the same XPath settings.Rather than manually entering the same information into each Diff tool or copying and pasting settings between Diff tools, it may be easier to create XPath settings that each Diff tool can reference. In this case, you can create global XPath Properties at the action or test suite level.

    You can add the Ignored XPath property to the top of any .tst file that needs it. You can copy-paste the Ignored XPaths property from the Test Case Explorer.

    The ability to ignore differences for something totally unstructured like plain text would be very limited. So, I was going to suggest that you consider the possibility of converting the document into another format like XML so that you can define more intelligent Ignored Differences.

    The alternative is to use the Suppress Task... option. In particular, see Manually Defining Suppression Files. You can change the "file" to match whatever you like. You would use an asterisk (*) as a wildcard to match multiple .tst files. You can also try removing "test-id" if you want to match multiple test cases.