Is there a way to achieve the below using CA Application Test or any other Devtest solution.
Moving this thread into the CA Devtest community for visibility with our Devtest experts.
What are your requirements for determining if a VS is up to date to the back-end application?
We recently implemented a solution for a customer which deals with a similar problem as your question. On a high-level there is a similarity. Not sure if what we did will work for your use case. Marcy is right to ask for more details about your requirements.
It is a recent implementation, I do not yet have good visual material to present the solution, so I'll try to describe it as simple as possible.
This particular "Virtual Service Validation" solution is a specific implementation of a Low-code API Test Generation framework that we have built.
The objective of the framework is to easily build a whole suite of test cases (.tst files) without having to manually adapt test steps, and filters, and assertions. The functionality of a test case (i.e. the steps, filters, assertions ...) is created based on a template test case. So, this means that the generated test case can be quite complex - meaning rich in functionality - if needed, but every test case has a similar structure, i.e. functionality, as it created from the same template. So, this is ok for API Tests where every testcase is similar, i.e. sending a request payload to the API, and then running some assertions on the response to validate it is as expected. So, this type of test we implemented via the "Template_APITest" template.
Something similar to your requirement was implemented via our "Template_VSValidation" template. The functionality of a generated VS Validation testcase is as follows:
The definition of such a test suite would be done completely by editing some files in a directory, it would look something like this:
The -req.xml files would contain a request to be sent to the API, it would look something like this:
The -val.xml files would contain the definition of the filters and assertions as they would be defined/required by the "Template_APITest" template, it would look something like this:
After creating a test definition like above for every test you want to generate, we would run a batch file which eventually would use testrunner to execute another test - i.e. CreateTestV3 - which would write out a .tst file for every pair of -req.xml + -val.xml file.
The generated testcase would look like:
The actual API calls are done inside a subprocess (doesn't have to be but here that is how the template is built). I selected the "Filter Live Response Payload" step, you can see it has 2 filters created (those are the ones defined in the "LiveCallFilters" Filters element of the -val.xml file. You can see the 2 assertions created in the final "Validate Filtered Data Equal".
So, the above is the long answer, the short answer to your question is 'yes, this is achievable'.
Thanks for providing such an in depth explanation. It would be really helpful if you can share me the project in zip so that I can play it around. I would also require the Template_VSValidation to look into it.
I am looking for something similar bit in a more simpler and quickest way. Something like the steps mentioned below :-
1) Create a virtual service from Live.
2) Based on the transactions recorded during VS recording, on click of a button it will generate tests with Request / Response artifacts at one shot for all transactions with assertion on Response. The same tests were collected and a Test Suite will be created for Test Run on the VS as part of Regression testing the same against the New Live Environment.
More particularly this part is an answer to your requirement "... It is basically a testcase that opens a VSI file - which in itself is XML - and processed all the transactions defined in that VSI file. Each transaction becomes a testcase for the consumer of the contract fired against the System Under Test ..."
I will make both frameworks available (for the whole community), I will put them on github where they can not only be downloaded/consumed but I would hope that any corrections and/or additions made would be uploaded again such that the frameworks grow in features and functionalities. I will let you know the link asap.
Could you please share the frameworks so that I can have a look into it?