Forum Discussion

krogold's avatar
krogold
Regular Contributor
7 years ago
Solved

How to write a property value in testSuite's setup script ?

Hello,

I'm using SoapUI 5.3.0

I'm trying to read and write properties in the setup script. In order to read a property, build a value from it and write this in a new property.

 

I did

current_password = testRunner.testCase.getPropertyValue.testSuite.getPropertyValue("PinCode")

but it failed, indicating "No such property: testRunner ..."

 

So I worked around this with

 

current_password = context.expand('${#TestSuite#PinCode}')

which works. Then I want to build my new prop and write it but, there, I don't know how to work around.

 

 

testRunner.testCase.testSuite.setPropertyValue( "my_prop", new_value )

I have the same problem.

Is there something required to be able to hit testRunner variable ? do I need to use ReadyAPI ? do I need to run the testSuite (though it fails) ?

 

thank you

 

info : I have a testCase in my testSuite that contains a groovy step which uses testRunner without any problem ...

  • Well,

    I did

    testSuite.setPropertyValue("my prop", new_value)

    and it worked.

     

    It is indicated, in the edit part, that "setup script is invoked with log, runner, context and testsuite variables"

    However, as runner is mentioned, I would have expected to be able to do it using the runner ...

     

    sorry for the time loss

     

    Alexandre

1 Reply

  • krogold's avatar
    krogold
    Regular Contributor

    Well,

    I did

    testSuite.setPropertyValue("my prop", new_value)

    and it worked.

     

    It is indicated, in the edit part, that "setup script is invoked with log, runner, context and testsuite variables"

    However, as runner is mentioned, I would have expected to be able to do it using the runner ...

     

    sorry for the time loss

     

    Alexandre