Forum Discussion

cc's avatar
cc
New Contributor
8 years ago
Solved

testRunner.testCase.getTestStepByName("my").setPropertyValue("id","42") not working in script ...

Hello,   I tried to write a groovy script an to set values of a testrequest, and to excecute that afterwards. It looks like this:   testRunner.testCase.getTestStepByName("my").setPropertyValue("i...
  • PaulMS's avatar
    PaulMS
    8 years ago

    <id> is not defined as a property of the test step but it is included within the request property.

     

    You can create a custom property at the test case level

    testRunner.testCase.setPropertyValue("id", "42")

     

    then to use the property in the request

    <id xsi:type="xsd:string">${#TestCase#id}</id>

     

    https://www.soapui.org/functional-testing/properties/working-with-properties.html