Forum Discussion

mcbootus's avatar
mcbootus
Contributor
15 years ago

[Res] Globally clearing all properties values at test start

Dear Support,


I have around 40 properties steps in my test suite which contain around 500 rows of property "names" and corresponding "values". Is there a simple way to clear all property values from the property steps while keeping all the property names ? This is to prevent old values left over from a previous test run affecting the current test execution. At the moment I have to visit each property step and clear the values manually. Ideally I want to place some groovy code in a top level script which will erase all property values from all scripts automatically. Is such a thing easily possible?



Thank you in advance.



Armen

3 Replies

  • Hi Armen,

    you could add the following to the setup script of your TestCases:

    for( s in testCase.testStepList )
    {
    if( s instanceof com.eviware.soapui.impl.wsdl.teststeps.WsdlPropertiesTestStep )
    s.clearPropertyValue()
    }

    or if you always want it to happen for all your testcases you can put this in a project level TestRunListener.beforeRun event

    Does that help?

    regards!

    /Ole
    eviware.com
  • Dear Ole,

    Thank you very much for the advice - I will try it and get back to you.

    Best regards,
    Armen
  • Hi Ole,

    I think all I needed was this code:


    testRunner.testCase.testSteps['PropertiesDB'].clearPropertyValues()
    testRunner.testCase.testSteps['PropertiesXML'].clearPropertyValues()


    Thanks for your help.

    Armen