Forum Discussion

Knowledge's avatar
Knowledge
Contributor
8 years ago
Solved

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
    8 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