For some other testing purposes, the external jar package needs to be brought in, and here is a bit of my personal experience that will continue to add.
1, in the root directory of JMeter, create a new folder, to store their own import of the jar package, as shown in this folder is the folder I created to hold the jar package;
2, Configuration jmeter.properties.
Locate the Classpath configuration, and then add a line of code in the location as shown: plugin_dependency_paths=. /practicejar;
Here to pay attention to is: online Some people said directly to change user.calsspath, such as the next picture of the first red box labeled place; I tried, and found such a modification, will let jmeter load times wrong: jmeter.gui.util.MenuFactory:Missing Jar? Could not create Com.googlecode.jmeter.plugins.webdriver.sampler.gui.WebDriverSamplerGui. Java.lang.noclassdeffounderror:jsyntaxpane/defaultsyntaxkit
, this is because the location of the jar package that needs to be read when the JMeter starts is changed and the jar package cannot be found, so do not do so.
3, in the JMeter test plan, the need to import the jar package, as shown in the figure below, and then you can use BeanShell to call the test.
Problem Solving Process:
When testing, want to do a response data in the image URL address, you write a script to download the image to a local directory and rename.
Then in debugging scripts, encountered a lot of problems, for no programming experience for me, it is really difficult.
1, in order to verify that the written code is correct, you need to first debug in the local Java environment through. This step has been modified, finally debugging success, the picture has been downloaded to the local, happy.
2, the debugging through the script, put into my beanshell, execution times wrong, then I got stuck here, the error message is as follows:
2017/06/22 15:06:50 Error-jmeter.util.beanshellinterpreter:error invoking BSH method:eval Sourced file:inline Eva Luation of: "Import java.io.FileOutputStream; Import Java.io.InputStream; Import JAVA.IO.OUTP ... ": Typed variable Declaration:object constructor
2017/06/22 15:06:50 WARN - Jmeter.protocol.java.sampler.BeanShellSampler:org.apache.jorphan.util.JMeterException:Error Invoking BSH Method: Eval
3, appear above this question, actually is my log.info statement use has the question, cannot have the space, also cannot change the plus sign to the other symbol, changes the following style to be normal:
Log.info ("URL:" +url);