In my project there is a requirement for dynamic test data creation from virtual service.
Below said is the sample test data,
0000000000000A2017007111322P003003GMAC020101301 -> Header1000000022001 00000250000 0001634129952017017 00A 0001 00002001Y -> Detail Record1000000001158 00000072000 0002634129932017017 00A 0201 00002001 -> Detail Record70000200199999999900000322000000002 -> Batch record1000000001149 00000070000 0001634129952017017 00A 0101 00002002 -> Detail Record70000200299999999900000070000000001 -> Batch Record999999999999900000392000000003000002 -> Footer
My input request is SOAP request with all the above inputs, along with fields and response is above Test data.#
Currently i have a virtual service that can create static test data as above. But my requirement is to create dynamic test data through virtual service based on the inputs.
For Example: Number of Detail Records and batch records vary based on the requirements, my virtual service should handle that and provide me the appropriate response. Anyhow Header and Footer will always remain same.
2 detail records, 1 batch record
10 detail records, 2 batch records etc
I do understand that i have to write Java script to handle it, but am having minimal experience in that.
Request, Is anyone there who can help me on this requirement.
Have you checked out documentation on Data-Driven virtual services. I would just record the different types of requests that your service is going to receive, and supplement them with a dataset.
For more detail, check out our documentation below. If you need further help, I would suggest opening a support ticket.
Create Data-Driven Virtual Services - DevTest Solutions - 10.1 - CA Technologies Documentation
Thanks for your reply.
I have gone through the documentation "https://docops.ca.com/devtest-solutions/10-1/en/using/…"
In the documentation, suggestion is to Add a new user defined signature to create a data driven virtual service, but when i checked DevTest portal am unable to fine the option to create a new signature, could you please share me the steps to do so or could you please redirect me to the URL where i can get the complete procedure.
Thanks in advance.
As mentioned by Support you can use the data-driven with XLS/CSV:
There is no "Add new signature" button/option in portal. The document says that to create a data-driven virtual service, you can start by adding a blank signature with an associated data set. The resulting signature does not have any request arguments. You add the arguments in a later procedure. So, you would need to create a data-driven virtual service and leave its signature blank.
Follow these steps: