JMeter: Calling external classes and methods?
I have a Java test project that I would like to import in my JMeter test
so that I can call the existing methods in the test project. I did some
research, and came to know that I can create a jar of my Java project,
copy the jar into the JMETER_HOME/lib/ext folder, and then use the
BeanShell Processor to call the external methods.
I am trying to use the existing test project, and call its methods to
generate a JSON payload. I added a BeanShell PreProcessor, and did
something like:
import com.qa.base.services.user.User;
User user = User.generateSimpleUser();
user.setField("username", "testUsername");
user.setField("password", "testPassword");
vars.put("requestJsonPayload");
This does not seem to work, and I get an ERROR:
ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: eval
Sourced file: inline evaluation of: ``import
com.qa.base.services.user.User'' : Typed variable declaration : Method
Invocation User.generateSimpleUser()
Anybody know how I can achieve what I am trying to do? Any suggestions,
comments, links to tutorials, examples would be helpful. Thanks in
advance!
No comments:
Post a Comment