Forum Discussion

larsn's avatar
larsn
Contributor
11 years ago

Where to store dynamic properties with scope TestCase?

Where to store dynamic properties with scope (at least) TestCase?

I have generated values that I need to access over the course of a test case run (and are used in groovy libraries) but I no longer want to store as test case properties.
The issue is that these values are then stored in the test case XML and show up as changes when committing the SoapUI project to source control.

I wanted to use the context object, but that doesn't have a setProperty() method. I could store these values at the project level but that would only minimize and not keep them from being saved in the XML.

I just started looking at what other objects implement the MutableTestPropertyHolder interface but figured that I would ask the community as well.
  • SiKing's avatar
    SiKing
    Community Expert
    larsn wrote:
    The issue is that these values are then stored in the test case XML and show up as changes when committing the SoapUI project to source control.

    I normally have a teardown script that resets these properties to something like "0". It's not pretty, but it does prevent irrelevant changes from going into source control.
  • Just to update what we've implemented. Ended up using the context object - properties stored there are not in the XML but have a scope larger than test case run (haven't actually checked how large the scope is).

    The context object does have a setProperty() method but all the other normal objects have setPropertyValue() - I didn't immediately notice the difference, so that was hindering initial switch.