In BeanShell Assertion, I want to check whether current HTTP Sampler failed, if it failed, then collect the failure information.
SampleResult.isSuccessful() is used to check the whole Sampler status first.
If it doesn't return true, then call SampleResult.getFirstAssertionFailureMessage().
However, error message points HTTPSampleResult doesn't have this method.
ERROR o.a.j.u.BeanShellInterpreter: Error invoking bsh method: eval Sourced file: inline evaluation of: ``//PostProcessors are executed before any assertions import org.apache.jmeter.sam . . . '' : Typed variable declaration : Error in method invocation: Method getFirstAssertionFailureMessage() not found in class'org.apache.jmeter.protocol.http.sampler.HTTPSampleResult'
HTTPSamperResult api:http://jmeter.apache.org/api/org/apache/jmeter/protocol/http/sampler/HTTPSampleResult.html
SamperResult api: https://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html
In my script, method isSuccessful(), getSampleLabel(true), getSamplerData(), getResponseDataAsString() work fine, but not getFirstAssertionFailureMessage().
It really confuses me, does it mean HTTPSampleResult can only invoke part of the methods from SampleResult?
If yes, how can we identify the method list?