Reputation: 888
I want to re-use the Response Data received in Listener as show in Image below.
I would like to know, how can I capture overall response so that I can re-use the same for uploading.
Scenario is:
Download 1KB of string data using TCP Sampler (Port: XYZW)
Upload the text response received (Port: ASDF)
Upvotes: 1
Views: 1450
Reputation: 168157
As per How to Extract Data From Files With JMeter the relevant Regular Expression should be:
(?s)(^.*)
Entire configuration:
Upvotes: 2
Reputation: 46
With Http sampler, I add a BeanShell PostProcessor
as a child of Http sampler and use below script to retrieve all response data, I think it's the same with TCP sampler, let's try:
// get all response data
String dashboardData = prev.getResponseDataAsString();
// do something with the data
// and then put the retrieved data into parameter to use later
vars.put("dataTobeUsed", dashboardData);
and we can use ${dataTobeUsed}
for other samplers
If you want to get the response data via regular expression extractor, you can use the pattern ([^"]+)
Hope it's helpful!
Upvotes: 1
Reputation: 73
Hope I understood your question right,
You can use regular exp [a-z0-9]* with any reference name lets say "TCP_Data" in your first TCP request. Now you can use the same reference name in TCP request 2, by ${TCP_Data}.
Upvotes: 0