Reputation: 58862
When running JMeter in GUI mode, sometimes request stuck or takes a long (minute or more) time to get a response
Is there a way to view request before response received?
Obviously Listeners are executed after Sampler finish because of Scoping rules, but is there another way?
Upvotes: 0
Views: 98
Reputation: 58862
Following Master Apache JMeter book, filling the Timeouts can prevent such issues:
Fill the Timeouts (milliseconds) option of HTTP Request allows you not to wait for a SUT response indefinitely.
This will provide the following benefits :
• Allow JMeter to stop at the end of the test without waiting indefinitely for hanged requests. By default the timeout is infinite in HTTP Request
Upvotes: 0
Reputation: 168157
A little bit more complicated option is printing the request details to jmeter.log file using JSR223 PreProcessor and Groovy which will query sampler
instance which is a shorthand for HTTPSamplerProxy class like:
log.info('URL: ' + (sampler.getUrl() as String) + sampler.getQueryString())
log.info('Parameters: ')
sampler.getArguments().each {arg ->
log.info(arg.getObjectValue() as String)
}
if (sampler.getCookieManager() != null) {
log.info('Cookies: ')
sampler.getCookieManager().getCookies().each { cookie ->
log.info(cookie.getObjectValue() as String)
}
}
if (sampler.getHeaderManager() != null) {
log.info('Headers:')
sampler.getHeaderManager().getHeaders().each {header ->
log.info(header.getObjectValue() as String)
}
}
//etc
Demo:
Upvotes: 1