How to extract parameter in beanshell. Please give me some example or link. Thank you.
-
Have you tried something before asking? – Iske May 23 '17 at 15:42
2 Answers
I have only used the PostProcessor element 'JSON extractor' to extract a value from a response. There are other extractor elements in the PostProcessors. Once you extract the value into a variable, if you need it in another thread group, you can add it to a beanshell to make it a property, for example like this:
${__setProperty(clientId, ${clientId})};
Then when you need to use the clientId, you would just call it whereever you need like this:
${__property(clientId)}

- 302
- 1
- 6
- 23
First of all "usual" recommendation to use JMeter's built-in components where possible and avoid scripting unless it is absolutely required. If it is - consider using JSR223 Test Elements and Groovy language as other supported scripting languages have performance issues.
Coming back to your "question":
- What
parameter
? Request parameter? If yes, what is sampler type and parameter name? Response parameter? - From which Beanshell test elemenet (Pre/Post Processor, Assertion, Timer, Listener)?
We are not telepathic enough to guess what you are trying to achieve. See How to Use BeanShell: JMeter's Favorite Built-in Component for general information on Beanshell scripting in JMeter tests and/or elaborate your question providing more details.

- 159,985
- 5
- 83
- 133