Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get response message HTTP Request on Beanshell Jmeter

Hi actually I want to test web service using Jmeter. but I am stuck when I want try to get response message from http request. actually I want to get the response message from beanshell post processor. How should I do to get the response code?

like image 318
Hendrione Avatar asked Oct 19 '25 06:10

Hendrione


2 Answers

You can also use context(ctx) variable to get the previous result data:

ctx.getPreviousResult().getResponseCode();
ctx.getPreviousResult().getResponseHeaders();
ctx.getPreviousResult().getResponseData();
like image 120
Svp57 Avatar answered Oct 20 '25 18:10

Svp57


It is as simple as

prev.getResponseMessage();

where prev is a shorthand to parent SampleResult class

Demo:

Beanshell Response Message Demo

See How to Use BeanShell: JMeter's Favorite Built-in Component article for more information on using Beanshell in JMeter

like image 24
Dmitri T Avatar answered Oct 20 '25 18:10

Dmitri T



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!