morciani
16 years agoOccasional Contributor
data driven Test Case - saving requests / responses to an external folder
Hi All,
I've built a data driven test case that works nicely. It looks like this:
Test Case1
1. Properties (global data)
2. DataSource (request specific data from an Excel sheet)
3. DataGen (some data that needs to be calculated on the fly)
4. TestRequest (with a handful of assertions)
5. Groovy Script (logs results and transfers some properties from the response to the following step)
6. Properties_Response (holds properties from the latest response)
7. DataSource Loop (keeps submitting requests until it runs out of data)
Pretty standard, and it works well, but I'd like it to do a bit more. I would like to be able to collect the actual requests sent and responses received in an external location ('c:/soapUI_requests_responses' for example). Take this example:
My Excel sheet in Step 2 contains the following 3 requests (rows):
01_AK_001
02_AL_001
03_AR_001
If run with this data, my Test Case will iterate 3 times. I would like a way to save the requests / responses externally, so that 'c:/soapUI_requests_responses' contains the actual requests / responses passed to the service, like this:
01_AK_001_Request.xml
01_AK_001_Response.xml
02_AL_001_Request.xml
02_AL_001_Response.xml
03_AR_001_Request.xml
03_AR_001_Response.xml
Any ideas on some Groovy scripting (or other means) that would accomplish this? Thanks in advance for any help!
-Mike
I've built a data driven test case that works nicely. It looks like this:
Test Case1
1. Properties (global data)
2. DataSource (request specific data from an Excel sheet)
3. DataGen (some data that needs to be calculated on the fly)
4. TestRequest (with a handful of assertions)
5. Groovy Script (logs results and transfers some properties from the response to the following step)
6. Properties_Response (holds properties from the latest response)
7. DataSource Loop (keeps submitting requests until it runs out of data)
Pretty standard, and it works well, but I'd like it to do a bit more. I would like to be able to collect the actual requests sent and responses received in an external location ('c:/soapUI_requests_responses' for example). Take this example:
My Excel sheet in Step 2 contains the following 3 requests (rows):
01_AK_001
02_AL_001
03_AR_001
If run with this data, my Test Case will iterate 3 times. I would like a way to save the requests / responses externally, so that 'c:/soapUI_requests_responses' contains the actual requests / responses passed to the service, like this:
01_AK_001_Request.xml
01_AK_001_Response.xml
02_AL_001_Request.xml
02_AL_001_Response.xml
03_AR_001_Request.xml
03_AR_001_Response.xml
Any ideas on some Groovy scripting (or other means) that would accomplish this? Thanks in advance for any help!
-Mike