Setting up the "Collapse whitespace" option for the "Graphical XML Side-by-Side Comparison" Assertion.
search cancel

Setting up the "Collapse whitespace" option for the "Graphical XML Side-by-Side Comparison" Assertion.

book

Article ID: 70163

calendar_today

Updated On:

Products

CA Application Test CA Continuous Application Insight (PathFinder)

Issue/Introduction

Question:
In the DevTest Manual, the explanation for the "XML Compare Options" for the "Graphical XML Side-by-Side Comparison" Assertion is as follows:
....
•    Whitespace

  • Trim whitespace
    During a comparison, all leading and trailing whitespace is removed from element text and attribute values (enabled by default).
  • Collapse whitespace
    In addition to trimming whitespace, any sequence of one or more whitespace characters inside text is converted to a single space character.
  • Normalize whitespace
    Any sequence of one or more whitespace characters is converted to a single space character.
  • Ignore all whitespace
    All whitespace is ignored during the comparison.


But when checking the "XML Compare Option" for the "Graphical XML Side-by-Side Comparison" Assertion at a test step from the workstation,
then we can see only these whitespace options:

  • Compare all whitespace
  • Normalize whitespace
  • Trim whitespace
  • Ignore all whitespace

 

 

How do we set up the "Collapse whitespace" option for the "Graphical XML Side-by-Side Comparison" Assertion?

Environment

All supported DevTest versions

Resolution


Please do the following steps:

1. Open the project which includes the test cases with "Graphical XML Side-by-Side Comparison" Assertion from the Workstation.

2. Open the test case which uses the "Graphical XML Side-by-Side Comparison" Assertion.

3. Click step which includes the "Graphical XML Side-by-Side Comparison" Assertion.

4. Click the  "Graphical XML Side-by-Side Comparison" Assertion.

5. Click the "Use Property" tab in the "Setting" tab in setting GUI for the "Graphical XML Side-by-Side Comparison" Assertion.

6. Check the check box named "Use Property for XML diff" options".

 

7. Push the button named "Create Config Property".

 

8. Make sure the field named "XML diff options property name:" was filled in the value "xmlDiffOptions1".

 

9. Save and close the test case.

10. Open the project.config file.

You can see the property which key name is "xmlDiffOptions1" and value is:
<xmlDiffOptions>
<ignoreNamespaces>false</ignoreNamespaces>
<ignoreNamespacePrefixes>true</ignoreNamespacePrefixes>
<caseSensitive>true</caseSensitive>
<trimWhitespace>true</trimWhitespace>
<normalizeWhitespace>false</normalizeWhitespace>
<collapseWhitespace>false</collapseWhitespace>
<ignoreWhitespace>false</ignoreWhitespace>
<ignoreAttributes>false</ignoreAttributes>
<ignoreElementText>false</ignoreElementText>
<ignoreAttributeValues>false</ignoreAttributeValues>
<ignoreElementOrdering>false</ignoreElementOrdering>
<ignoreAttributeOrdering>true</ignoreAttributeOrdering>
</xmlDiffOptions>

11. So please edit inside the value from:
<collapseWhitespace>false</collapseWhitespace>
to
<collapseWhitespace>true</collapseWhitespace>


12. After that, save and close the project.config file.

13. Open the test case which includes the "Use Property" option for the "Graphical XML Side-by-Side Comparison" Assertion and execute the assertion.

14. Even if you set the options in the "Compare Options" tab, the assertion ignores this setting in the "Compare Options" tab when you use properties for this assertion.

Attachments

1558618881930000070163_sktwi1ysjvsbg6e7.jpeg get_app
1558618880016000070163_sktwi1ysjvsbg6e6.jpeg get_app
1558618877811000070163_sktwi1ysjvsbg6e5.jpeg get_app
1558618875721000070163_sktwi1ysjvsbg6e4.jpeg get_app
1558618873835000070163_sktwi1ysjvsbg6e3.jpeg get_app
1558618871850000070163_sktwi1ysjvsbg6e2.jpeg get_app