Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Record on both connections

I'm interested in recording a traffic file that contains responses from both the primary and secondary connections in my message proxy Connection. My approach is to send back a fake bad HTTP response code with the primary response in order to invoke the secondary connection so I can capture that response.

I have my virtual asset configured in the primary connection and I have a live service endpoint configured in the secondary connection. My objective is to turn on recording and capture the response from the virtual asset in the traffic file, pass back a custom HTTP response code > 400 (to cause the secondary connection to be invoked) and then include the response from the secondary connection in the traffic file. My goal is to capture the request and both virtual and live responses so that I can create a process to validate my virtual asset.

I've set this up but it doesn't seem to be working. Is this possible and maybe my implementation is just not correct? I have he Recording Session set to "Append new session data". The behavior I see is that the traffic file contains only the request and the response from the secondary connection.

Comments

  • williammccusker
    williammccusker Posts: 642 ✭✭✭

    Hi,

    Make sure under recording that you select the option to record on both the primary and the secondary connection is selected. I believe in that case it might record only the successful response from the secondary connection rather than the "bad" response from the virtual asset in addition to the successful secondary response

    Does that sound like it would help? Or am I missing something?

  • jefftuckerbofa
    jefftuckerbofa Posts: 229

    That's how I have it set up and the behavior I am seeing is what you describe. It's only saving the valid response from the secondary connection. Sounds like it may not be possible to do this. I've used a different responder product here at work in the past and it gave us an option to "validate" the responder image. Was hoping to build some type of solution where I could generate a single artifact containing both virtual and live responses for that same type of purpose. IOW, run a process that can be used to confirm all of my stored responses are still up to date.

    I can see a number of other potential ways to skin this cat. But, I wanted to explore the traffic recording feature first.

    JT

  • williammccusker
    williammccusker Posts: 642 ✭✭✭

    It sounds like the desire is to find out if the virtual asset needs to be updated? Is the goal to find if during a given test run if the virtual asset ever failed to provide a response and the live service had to be used?

    In that case would it be sufficient to just record the traffic on the secondary connection? Any traffic that would be recorded would indicate a request came in that could not be served. Only if the traffic file was empty would it mean that the virtual asset was able to provide all the data.

    Or are there some cases where the traffic going to live doesn't mean missing data from the virtual asset?

  • jefftuckerbofa
    jefftuckerbofa Posts: 229

    Thanks for that info. It gives me an approach on a different topic I need to address at some point... reporting any "misses" from the primary connection.

    For this particular need, I would like to periodically "validate" the stored responses against what's coming from the live backend. For the purposes of illustration, imagine that the service that has been virtualized returns the customer profile. In this customer profile there could be flags that indicate whether the customer is eligible to see some type of feature in the web application. As new features are added to the web application, the dev team likely adds new flags to the customer profile response.

    If a new feature is added to the application and the only way to access it is by using a customer whose profile has the new flag, there is a good chance that the feature would not be available if the response being used is outdated (IOW created and stored before the new feature flag was even designed).

    At the start of each new testing cycle, I would like to run a test of the application with some type of mechanism to capture and compare my stored response with what is actually coming from the live service so that I can tell if there are any new elements of the response. If there were it would indicate that my stored response is out of date and should be updated.

    JT

  • williammccusker
    williammccusker Posts: 642 ✭✭✭

    I see, so it's about detecting changes to the live data that are missing from the virtual data.

    One idea might be that the proxy could be configured to just go to the live system and record all the traffic. Then use SOAtest to create test with regression controls from the recorded traffic.

    Then set the proxy to only send to the virtual asset and run the SOAtest test. If the regression controls detect any difference between the live responses and the virtual responses the test will fail and show how the data was different.

    Does that sound like it might work for the process you described?

  • jefftuckerbofa
    jefftuckerbofa Posts: 229

    Yes. I think that sounds promising. My team doesn't currently do all that much with SOAtest. We use other test clients to drive traffic, but I would be open to exploring the ideas you have provided. We do find, from release to release, that some of our regression tests "break" and I have to believe at least part of that is due to changes in the responses to our virtualized responses.

    I'd like to learn more about creating tests with regression controls from the recorded traffic.

    JT

  • williammccusker
    williammccusker Posts: 642 ✭✭✭

    Hi,

    Here is some documentation for creating clients. Its very similar to using the traffic wizard in Virtualize and there is an option you can check to enable the automatic creation of regression controls based on the traffic.

    https://docs.parasoft.com/display/SOA20202/Creating+Fixed+Message+Test+Clients+from+Traffic

    There is also another traffic wizard in SOAtest that can be used if there is data that needs to flow from response to request, e.g. dynamically created ids, etc.

    https://docs.parasoft.com/display/SOA20202/Creating+Smart+API+Tests+from+Traffic

    Hope these help!

  • jefftuckerbofa
    jefftuckerbofa Posts: 229

    Awesome. I'll share this with my team in our next brainstorming session. JT