Forum Discussion

rutwij89's avatar
rutwij89
Occasional Contributor
7 years ago

Export project without any properties data

Hello all,

 

I have to give the API project manifest to a client without any internal passwords and such stored in the properties. Is there a way to export a project without any data from properties

 

 

8 Replies

  • avidCoder's avatar
    avidCoder
    Super Contributor

    Could you please elaborate little bit more? What exactly you want to achieve here?

  • depstein's avatar
    depstein
    New Contributor

    I solved this problem by writing a Groovy script (in a fake test suite/test case) that parses the project XML file, removes/replaces nodes with sensitive data, such as authentication profiles and properties with user names and passwords, and saves a copy of the file.

     

    Sorry, can't post the code, but each step in the above process has a straightforward solution that can be looked up/googled.

  • nmrao's avatar
    nmrao
    Champion Level 3
    rutwij89, do want to remove property names too along with values? or just remove the property values?

    By the way, what level the properties to be cleanedup? Project level? Please clarify.
  • rutwij89's avatar
    rutwij89
    Occasional Contributor

    nmrao Thanks for your reply. I want to remove just the property values and I want to remove them all levels (project, testsuite, testcase, call) 

    • nmrao's avatar
      nmrao
      Champion Level 3

      rutwij89,

       

      Thank you for your question. Felt somehow the question is interesting.

       

      Here is what it is:

       

      1. It is script, and best fit is to use it in Save Script at Project level. That means, the code is natural fit here as you want to save the project before giving to whom so ever by clearing the property values. So, copy the provided script into Save Script at Project level. As name says all, the script gets executed automatically when the project is saved.
      2. The next question would be "I am working on this project and wish this script to be run on demand only, not just on saving the project".
        • Don't have to worry if you just run the script based on some condition.
        • Say, define Project level property CLEAR_PROPERTIES and set its value as false while you are working on the project. It won't clear your data though the project is saved any number of times.
        • Once the project is ready and you want to provide it to different parties and that's when you need to clear those data. Now, just change the CLEAR_PROPERTIES value to true. And save the project. And see the magic!!

      Here is the script:

      https://github.com/nmrao/soapUIGroovyScripts/blob/d1bbad9684907195f2cd70ec60e417c414814a41/groovy/ClearPropertyValuesProjectSave.groovy

       

       

    • nmrao's avatar
      nmrao
      Champion Level 3
      Thank you for clarifying.

      What do you mean by "call"? Calling another test case? If so, Can't use property expansion there?
  • rutwij89's avatar
    rutwij89
    Occasional Contributor

    @mnrao Thanks a lot. I will give it a try and let you know