Forum Discussion

zsousa's avatar
zsousa
Contributor
9 years ago

Clear custom properties when saving

So, the way I developed my test cases is to copy my data source row to my test cases "Custom Properties", then I run my test. My test runs and it may modify existing custom properties which is fine. So if I save my project, my testcase.xml file shows up as a difference, which is correct behavior but a nightmare for me working with GIT, as I don't really care that my custom properties change. Basically, what I am asking is there a way to clear custom properties when I save my entire project.

 

3 Replies

  • KarelHusa's avatar
    KarelHusa
    Super Contributor

    The only ways I know is either to:

    • prevent the project from saving (disabling autosave function) or
    • you can "save as" the project to a different file and work with the new one.

    There is no such thing like snapshotting or versioning of the project. 

     

    Karel

     

  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1

    zsousa,

     

    How do you execute the tests?

     

    Like KarelHusa suggested, there is command line option if the tests are run using SOAPUI_HOME/bin/testrunner utility which does not save the project after tests are done.

     

    But if the tests are being executed using UI, then you may not have that luxury.

     

    And it is understandable the pain of this differences while working with repositories like git / svn/ cvs etc.,

     

    Anyways, it is possible to either clean the property values or remove them altogether easily by writing script and keep it at Project level "Save Script". That is, as soon as the project is saved, all the properties are cleaned or removed amazingly in a second.

     

    However, caveat is that it may clear certain properties which you not intended to clear for a test case. Of course, that can be handled by having a list of property names that can be excluded and filter them while clearing.

    And there is another issue is that whenever the project is saved, the properties are cleaned which again you may not want to do so or annoying at times.  Again clean of these properties can be done conditionally so that there is better control whether to run whole Save Script or not.

     

     

    • zsousa's avatar
      zsousa
      Contributor

      Rao, thanks for the  reply. I actually figured out the easiest way to clean up before saving my project. There is a tab called "Saved Script", under Project/Project Settings that runs a script before the project is saved. So what I do so clear out all my properties, etc.. This has helped.

       

      Regards,

       

       

      Zique