Forum Discussion

7V's avatar
7V
Occasional Contributor
6 years ago

Question on SoapUI projects XML "id"

Hi,

Looking at some SoapUI project XML we observe that a lot of elements got an "id" as the form of an UUID (I guess?).

Example:

<con:testCase id="5a707623-0251-4526-8b09-d9762d77c3ff" [......]>
OR 
<con:interface xsi:type="con:RestService" id="2b3b5225-a503-4e19-9e0a-bf39f8cc0cc3" [.......]>

I looked for info but can't find any that helps me. How are these "id" used internally in SoapUI ?

What is the risk if I manipulate the project's XML and create duplicate ID's?

Can I create new components manually and generate a UUID with a UUID v4 generator ?

 

Thank you,

7v

2 Replies

  • JHunt's avatar
    JHunt
    Community Hero

    Hi, SoapUI uses the id internally for a variety of different purposes in its methods. I don't recommend you modify the XML, instead, use the API and let SoapUI deal with the details.

     

    For instance, at a higher level, you can use cloneTestCase on a WsdlTestSuite. Here, you'll specify the destination and everything in your method call.

     

    Or, you could get more low level, and do what that method is doing. Get the TestCase Config (this is basically the XML, but even SoapUI uses a library to read and generate it) and then use it to build a new TestCase ,which doesn't need to be added to a TestSuite just yet. The advantage of this is you can just have a test case in memory that will run just fine and you can run it to produce a test result, but won't be saved as a permanent part of your project XML.

    • 7V's avatar
      7V
      Occasional Contributor

      Hi, thank you for you answer.

       

      My use case is: I have a lot of REST APIs (17, in development) to test in SoapUI. There are hundreds of methods.

      There are unitary projects and test cases for each API. Then I have to create a project common to multiples API to do some tests on chaining API calls from differents API.

      I want to develop mainly in each individual API project then copy/paste the interfaces into the common APIs test project and do as few modifications as possible.

       

      That is the reason why I wanted to copy and paste some API configurations (and so their IDs) into new project(s).

      No test case from unitary projects will be imported and new test cases would be developed in the common APIs project.

       

      Does this implementation seems problematic to you ?

      And please excuse me, I am no expert of the type of documentation you linked me to and it looks a bit cryptic to me, even though I can ask colleagues to help me if the right way of implementing this solution is to use some methods of the SoapUI API.