Forum Discussion

tiratirador's avatar
tiratirador
Occasional Contributor
14 years ago

How to assign a value to a properties teststep using groovy?

I was able to assign a value to testCase.properties using this:

testRunner.testCase.properties["TCNAME"]

but how about assigning it to a properties teststep?

2 Replies

  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Assuming properties step name is 'Properties' and property name is 'prop1':

    testRunner.testCase.getTestStepByName('Properties').setPropertyValue('prop1','123')

    or

    def gu = new com.eviware.soapui.support.GroovyUtils( context )
    gu.setPropertyValue('Properties','prop1','123')