You could always remove the Scriptable from the Listen Step after the VSM is built. But, that is not hugely optimal.
One approach is to place an RR Sidecar file in the RR Pairs directory.
Request/Response Pairs - DevTest Solutions - 9.5 - CA Technologies Documentation
Only one sidecar file is required and it would be named: meta-req.properties.
- Add a single property in this file called RecordMode=Y.
- In your Scriptable DPH, add logic to check to see if the incoming request Meta Data it contains a property called RecordMode. If so, you know you are in Record mode. If not, you are in playback mode since the system under test would never send this element in the header. If in record mode, remove the RecordMode property from the META data so it will not appear in the recorded transactions.
For example: <pardon typos>
import com.itko.util.*;
ParameterList metadata = lisa_vse_request.getMetaData();
if ( ! metadata.containsKey("RecordMode") ){
return; // Get out of script we are not in Record mode
// and should not execute any more logic
}
metadata.removeParameter("RecordMode");
lisa_vse_request.setMetaData(metadata);
:
: // rest of Record Mode logic goes here