The JMeter Version is 5.3.
The BeanShell Server is opened at port 9000.
I try to run the apache-jmeter-5.3/extras/printvars.bsh, the command is java 
-jar ../lib/bshclient.jar localhost 9000 ./printvars.bsh
But I got the error messages. Below is it.
-------------Error Message Start--------------------

Connecting to BSH server on localhost:9000
Reading responses from server ...
BeanShell 2.0b6 - by Pat Niemeyer ([email protected])
bsh % >>>>
// Error: EvalError: Typed variable declaration : Attempt to resolve method: 
getIterator() on undefined variable or class name: vars : at Line: 21 : in 
file: <unknown file> : vars .getIterator ( )

// Error: EvalError: Attempt to resolve method: hasNext() on undefined variable 
or class name: i : at Line: 22 : in file: <unknown file> : i .hasNext ( )

<<<<
bsh % ... disconnected from server.
-------------Error Message END--------------------
The printvars.sh is under the extras directory.

------------Below is the contents of printvars.bsh.----------------
// Sample script to print JMeter variables
print(">>>>");
Iterator i = vars.getIterator();
while(i.hasNext())
{
      Map.Entry me = i.next();
       if(String.class.equals(me.getValue().getClass())){
             print(me);
      }
}
print("<<<<");

------------Above is the contents of printvars.bsh.----------------
Also I tried the functions like vars.get, vars.put. All of them did not work. 
It seems that they were not defined.
I want to know how to get/change the variables in the BeanShell Server.
Thanks.

Reply via email to