I create some features/functions from first Thread Group and put them into a JMeter Property:
props.put("FUNCTIONS", new function());
Then I would like to call those features/functions in WebDriver Sampler of the other Thread Groups.
In normal way (BSF, Beanshell or JSR223), just using:
props.get("FUNCTIONS")
But how to do this in WebDriver Sampler?
There is the same question related to vars
here :
Could anyone please help me?
Thanks in advance.
Per the JMeter user guide __property(): The property function returns the value of a JMeter property. If the property value cannot be found, and no default has been supplied, it returns the property name.
JMeter Web Driver Sampler is used to measure end user experience of the system under test while it receives load from traditional JMeter samplers such as HTTP or JDBC Samplers.
Variables are local to a thread; properties are common to all threads, and need to be referenced using the __P or __property function. When using \ before a variable for a windows path for example C:\test\${test}, ensure you escape the \ otherwise JMeter will not interpret the variable, example: C:\\test\\${test}.
ctx is the most powerful variable exposed to BeanShell. It represents the org. apache. jmeter. threads.
A little bit weird to hear such a question from someone who is familiar with Beanshell, however here you go:
Something like:
var props = org.apache.jmeter.util.JMeterUtils.getJMeterProperties()
will provide you read/write access to JMeter Properties.
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With