Forum Discussion

DouglasY's avatar
DouglasY
Occasional Contributor
8 years ago
Solved

Unexpected diffs: Automatic update of element id attributes in SoapUI obscures intentional changes

Is there a way to limit the automatic update of element identifier attributes so that they do not obscure intentional changes in a diff of the project files?

 

We are upgrading from SoapUI Pro 4.6.4 to SoapUI NG Pro 6.0.0 (in Ready!API 1.8.5).  We keep our SoapUI projects under source control (in a GIT repository).  I notice that when I open a SoapUI project in the new version, it adds an ID attribute for every element.  I see a note on the team testing support page that this is new since SoapUI 5.1, along with some added credentials elements as well as folder structure changes for composite projects. (https://www.soapui.org/soapui-projects/team-testing-support.html)

 

I expected that once I opened the project and saved it with the new structure and element identifier attributes that subsequent commit of changes would be limited to the elements I actually changed. But it appears that some and sometimes many of the ID attribute values get updated with a new generated GUID every time I open and save, whether or not I have made any other changes!  This is bad for tracking changes. 

 

Based on other things I have read, to try to limit this, I have tried the following:
- In Preferences->WSDL, check "Pretty print project files"

 

This seems to help with general formatting differences, but I'm still getting diffs in the GUID of elements I have not changed.


How to reproduce:
1. Launch Ready! API 1.8.5
2. Select "SoapUI NG Pro"
3. Import a composite project built with SoapUI 4.6.4
4. Save; Close Ready! API; commit or copy the project file structure on disk for future reference
5. Launch Ready! API 1.8.5
6. Select "SoapUI NG Pro"
7. File->Save All Projects
8. Diff the project folders (I use Beyond Compare)

 

I would accept minimal differences such as a timestamp of the last session. But I see multiple updates of ID's for various elements of some tests. For example, line 7 of one test file has changed over three different sessions. In one it looks like:


        <con:testStep type="groovy" name="DataExtractor" id="9e0d1ed7-9762-4dc0-8caa-13bde9d9139e">


On next save of the project, the line changed to:
        <con:testStep type="groovy" name="DataExtractor" id="86478262-d8d5-4ff5-ac4a-5663df67b9fd">


On a third viewing it changed to
        <con:testStep type="groovy" name="DataExtractor" id="f5a3cb98-f8de-42a2-82ca-32dac6637612">

 

This same test file has consistently had 22 of these kinds of updates today every time I save the project, even without making changes. 

 


 

  • I have solved this. The tests that were exhibiting the constant refresh of element id had testCase or testSuite name value identical to another test.  This apparently did not confuse SoapUI 4.6.4, but when importing into Ready-API 1.8.5, it confused it enough to mess up the project save, although no error message was detected.

     

    How did the test cases and suites get duplicate name?  The UI (even SoapUI 4.6.4) won't let you enter a duplicate name.  I speculate that this may have occurred when merging project edits, or by some hotshot who copied an existing test case or test suite folder with the intent of modifying it, but did not catch all the places where the name had to be modified when working outside the UI.  

     

    The fix was to edit the xml files to make the conflicting name elements were unique, then re-import the project into Ready-API. Now, when I make a change using the UI, only files related to that change show differences, and the differences look like the change I intended to make.  Hooray!

     

1 Reply

  • DouglasY's avatar
    DouglasY
    Occasional Contributor

    I have solved this. The tests that were exhibiting the constant refresh of element id had testCase or testSuite name value identical to another test.  This apparently did not confuse SoapUI 4.6.4, but when importing into Ready-API 1.8.5, it confused it enough to mess up the project save, although no error message was detected.

     

    How did the test cases and suites get duplicate name?  The UI (even SoapUI 4.6.4) won't let you enter a duplicate name.  I speculate that this may have occurred when merging project edits, or by some hotshot who copied an existing test case or test suite folder with the intent of modifying it, but did not catch all the places where the name had to be modified when working outside the UI.  

     

    The fix was to edit the xml files to make the conflicting name elements were unique, then re-import the project into Ready-API. Now, when I make a change using the UI, only files related to that change show differences, and the differences look like the change I intended to make.  Hooray!