I hit a webservice in my devtest testcase, (Say S1). Now, the service S1 internally calls other services(Say S2 and then S3) with some input in a sequence. Now, I need to capture and validate the requests and responses of S2 and S3 as well.
Is this possible in DevTest, If yes, Please help me in this.
Thanks & Regards,
Duplicate question: Capture and validate the internal service calls that happen within a service? A few possibilities to consider are:
If you are able to change the endpoints for S2, S3, etc., you could consider having the app send the request to DevTest recorders. The recorders could record the transactions and forward them to the live backend application.
Or, you might consider CA Application Insight if the application server is running a compliant / supported version on which the Insight Agent could be installed. Refer to: https://docops.ca.com/devtest-solutions/10-0/en/using/using-application-insight/getting-started-with-application-insight
You could use request / response pairs, wsdls, etc. to create services -- although based on your query, it seems you probably do not have those artifacts for S2 and S3.
If the services are HTTP-based, you might be able to generate services from a packet capture utility such as tcpdump or Wireshark.
The requirement as posted in the linked question is:
My requirement here is not to create a virtual service. But to test the real service.
In this I need to validate the request and response of S2 and S3 using my devtest test case.
So what I infer is we might not be able to validate in services testing.
This requirement is technically outside the purview of a DevTest Test Case if the objective is to send a request to S1 from DevTest and, at runtime, intercept and validate the request/response pairs that originate throughout the downstream applications (i.e., calls to S2 and S3).
Having said that...
1) A Test Case can invoke S1, S2 and/or S3 directly. At a composite granularity, you know what the request/response to S1 looks like. Is it possible for you to back into the flow by calling S3 with a proper request, validate the response, call S2 with a proper request, validate the response, and then call S1 with a proper request to validate the entire flow? I know that sounds quirky, but intercepting and validating conditions that are occurring within applications, at runtime, and as a result of a high level API call would be extremely complex to achieve.
2) One of the capabilities of the CA InsightAgent is the ability to capture and store the request / response data for transactions in a flow and generate various artifacts. In the graphic below, consider that S1 is analogous to "root frame" and the subsequent "frames" are analogous to calls to S2 and S3.
If the test case fires S1 ("root frame") and the Insight Agent captures the R/R data for S2 and S3, the ability to understand the makeup of the request/response data at each step increases. If the call to S1 fails in DevTest, the information collected by the Agent enables testers and developers to review the input and output at the various steps in the captured flow. Since the actual R/R data is captured, the input can, in theory, be replayed by sending the data to S2 or S3 independently and verifying the results. Likewise, since the response data is captured, it can be reviewed to determine possible error situations. As an aside, you would need to determine if your licensing allows for the use of the Insight Agent. And, the Agent needs to be active on each of the App Servers where transactions are occurring to generate a complete mapping of the flow. There are several demos available on this subject if it seems like a good approach.