Having defined HTTPRequest with BeanShellPreProcessor with following code:
log.info(vars.get("view_state"));
props.put("view_state", vars.get("view_state"));
Following with configuration of HTTP Request which is:
However, the final request does not recognize this parameter and shows this:
...&javax.faces.ViewState=%24%28view_state%29...
Question is why it is not recognized as variable ?
You are putting values into JMeter Properties and trying to read them from JMeter Variables. Properties and Variables are different beasts and need to be accessed differently.
The solutions are in:
props.put
statement to vars.put
(the other syntax remains the same).vars
is a shorthand to JMeterVariables class, using it you will manipulate JMeter Variables instead of properties ${__P(view_state)}
More information: How to Use BeanShell: JMeter's Favorite Built-in Component