Forum Discussion
nmrao
12 years agoChampion Level 3
Can you clarify if the below understanding is correct?
For simplicity, let us say, a test case contains two steps -
1. groovy script which creates request xml
2. soap request step which actually has a request
Now the xml content in step 2 needs to be replaced.
Based on the above assumptions, it depends how much of the content varies each time.
case a: if the values to be replaced is still manageable, you can use the properties (testcase, suite, project level - project.setProperty('NODE_VALUE','new value to be replaced in xml content of step2')). Set these property values instead of updating the xml in step 2. And in the xml of step 2 use those properties where soapui takes care while sending the request (<node>${#Project#NODE_VALUE}</node>)
case b: if the xml content varies too much, unmanageable with properties for each node value, then in the groovy set the whole xml content string to a property like project.setProperty('REQUEST_XML_CONTENT', xmlString). In the step2,
<envalope>
<body>
${#Project#REQUEST_XML_CONTENT}
</body>
</envalope>
Though never tried this, let me know if this works.
For simplicity, let us say, a test case contains two steps -
1. groovy script which creates request xml
2. soap request step which actually has a request
Now the xml content in step 2 needs to be replaced.
Based on the above assumptions, it depends how much of the content varies each time.
case a: if the values to be replaced is still manageable, you can use the properties (testcase, suite, project level - project.setProperty('NODE_VALUE','new value to be replaced in xml content of step2')). Set these property values instead of updating the xml in step 2. And in the xml of step 2 use those properties where soapui takes care while sending the request (<node>${#Project#NODE_VALUE}</node>)
case b: if the xml content varies too much, unmanageable with properties for each node value, then in the groovy set the whole xml content string to a property like project.setProperty('REQUEST_XML_CONTENT', xmlString). In the step2,
<envalope>
<body>
${#Project#REQUEST_XML_CONTENT}
</body>
</envalope>
Though never tried this, let me know if this works.
Related Content
Recent Discussions
- 15 years ago