Copy request, response and assertion to transaction sampler upon failure
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.3k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 5
Description
**Wanjun Wang** ([Bug 59831](https://bz.apache.org/bugzilla//show_bug.cgi?id=59831&redirect=false)):
To make BackendListenerClient's handle failures more easily, TransactionSampler should include the response and assertion from latest failed sub-sampler. This can be done by adding the following code to the end of addSubSamplerResult(SampleResult res) in org.apache.jmeter.control.TransactionSampler:
if (res.getErrorCount()>0) {
// Copy response and assertion for failure
transactionSampleResult.setRequestHeaders(res.getRequestHeaders());
transactionSampleResult.setResponseCode(res.getResponseCode());
transactionSampleResult.setResponseHeaders(res.getResponseHeaders());
transactionSampleResult.setResponseData(res.getResponseData());
for (AssertionResult a : res.getAssertionResults()) {
transactionSampleResult.addAssertionResult(a);
}
}
Currently, TransactionSampler's SampleResult doesn't use those fields right now, so there's minimum impact.
OS: All
Contributor guide
Assessment
This issue has not been assessed yet.