Creating Properties within a fileContents (Datasource) Property?
Hey,
Essentially I need to move my SoapUI project into the CI/CD environment, however because the web service I am posting to only supports create functions (I cannot update a record, I can only create it) this means that certain attribute values in my XML need to be altered slightly each time the test case is executed.
I've seen a couple of other posts about dynamically updating test data before posting to the web service but nothing that really handles what I need. I'm hoping the option I'm thinking about may get me around trying to code lots of groovy script. I'm sorry that this question is a little open - I know I'm supposed to ask specific questions - but hopefully I will be specific enough.
SO - what I'm thinking of is having a Datasource (Directory type) with a fileContents property containing the XML testdata with 'placeholder properties' for certain tags/tag attributes (e.g. SessionNumber tag)
I am then thinking of using a properties test step that points to a file (say an excel spreadsheet with a column that contains an incremental list of SessionNumber values (starting 'S00001' going to 'S999999'))
I would then have the SOAP test step publishing the request, followed by a Datasource Loop step to loop around to the next testdata record which (hopefully) picks up the NEXT SessionNumber value from the Excel spreadsheet to populate the SessionNumber tag for the next request.
I'm guessing the number of SessionNumber property values would need to equate to the number of testdata records sourced by the Datasource (Directory type)
In summary (apologies for the lengthy post - I just wanted to be as concise as possible) - my hierarchy would be as follows:
Datasource(Directorytype) - fileContents property (with SessionNumber property placeholders) Properties step - single SessionNumber property pointing to a properties file with a list of incremental SessionNumber values SOAP step - posts the fileContents property (with the updated SessionNumber property) Datasource Loop - loops back to pick up the next data file
Example XML (that I've greatly simplified is below) that would be contained within the Directory Datasource's fileContents property:
<Sessions>
<Session SessionNumber="${Properties#SessionNumber}" DateTime="20171023055848">
</Session>
</Sessions>
Does the above sound feasible?
Many thanks for any/all guidance help/comments that anyone can provide
richie