Forum Discussion

Knowledge's avatar
Knowledge
Contributor
9 years ago

Changing a value of project/test case property within REST Test Step

Hi,     Is it possible to change value of project/test case property within REST Test Step? For example: Custom property “MsgId” with certain initial value defined for SoapUI project. This prop...
  • KarelHusa's avatar
    9 years ago

    Yes, you can retrieve the property value and then modify it, please see the following code:

     

    <request1>${#TestCase#i}${=testCase.setPropertyValue("i", String.valueOf(Integer.parseInt(testCase.getPropertyValue("i")) + 1))}<request1>
    <request2>${#TestCase#i}${=testCase.setPropertyValue("i", String.valueOf(Integer.parseInt(testCase.getPropertyValue("i")) + 1))}</request2>

    Karel