Hi Senthil, as with most solutions, there are multiple ways to handle this.
Option 1:
- In the VSI, replace the response with the text "404" without the comments (or use what ever you want). Also, you might consider making the same change in the Stateless Image Response to enable a technique where operations and signatures that do not match also branch to the Live Invocation step.
- In the VS Image Selection Step in the VSM, add a Scripted Assertion:
if ("404".equals( lisa_vse_response.get(0).getBodyAsString() ) )
return true;
else
return false;
Set the Assertion to branch to the Live Invocation Step if the Assertion returns true. If false, the VSM moves to the next step which is most likely the Responder Step.
(you might also be able to use an ensure property contains with Regex for your value)
Option 2:
I have seen some folks add a property to the Response's META data on the response and check it to determine if branching live or sending a virtual response. I prefer adding the value in the VSI response because it is easier for developers to spot. We don't tend to look at the response Meta data that often.
Option 3:
There may be a property that can be evaluated (for example, something like lisa vse transaction matched) that indicates a transaction was not found. I have never looked really hard for something like this.
Good luck.