joakimrosendahl
15 years agoNew Contributor
Temporarily remove optional elements
Hi,
I'm trying to setup a test case where I can temporarily remove optional elements from the request. I've setup a test case that reads input data from an excel data source and executes a call to a web service for each row in the excel source:

Now we are creating more complex tests, setting the optional elements in an arbitrary way. I need help with seting up my test case to support this. I have a worksheet in the excel for each optional element. For each row in the worksheet there is a field representing whether or not to use the optional input or not. What I want to do in soapui is:
read the excel source -> loop through the data source -> databind property to the request -> remove the optional elements from the current request according to the field mentioned above -> call the web service.
Any ideas how to solve this? The only idea I have is to have to two SOAP call test steps: One that is the complete call inlcuding all optional elements and this one will work as a template. Then a second call step that will be used for the actuall call, but will be modified prior to the call. After the call I want to restore the second call to match the template (copy and replace?). I know that I can modify the request using a script, but I don't know how to restore it afterwards. Is this a proper solution?
Regards,
Joakim.
I'm trying to setup a test case where I can temporarily remove optional elements from the request. I've setup a test case that reads input data from an excel data source and executes a call to a web service for each row in the excel source:
Now we are creating more complex tests, setting the optional elements in an arbitrary way. I need help with seting up my test case to support this. I have a worksheet in the excel for each optional element. For each row in the worksheet there is a field representing whether or not to use the optional input or not. What I want to do in soapui is:
read the excel source -> loop through the data source -> databind property to the request -> remove the optional elements from the current request according to the field mentioned above -> call the web service.
Any ideas how to solve this? The only idea I have is to have to two SOAP call test steps: One that is the complete call inlcuding all optional elements and this one will work as a template. Then a second call step that will be used for the actuall call, but will be modified prior to the call. After the call I want to restore the second call to match the template (copy and replace?). I know that I can modify the request using a script, but I don't know how to restore it afterwards. Is this a proper solution?
Regards,
Joakim.