I. Preface
In the process of testing the interface, it may sometimes be necessary to use a third-party jar package to generate some test data (such as sometimes need to use a third-party jar to encrypt the input values of the parameters), the common practice is to manually call the jar package to get the desired value, The values are then assigned to one of the parameters in the JMeter. This is tedious, and JMeter has the ability to invoke the jar package, which we can use to implement embedded calls to the jar package.
Below we will write a simple cryptographic program and then implement the call to this jar package. Two. Operation Procedure
1. Write a simple encryption message, the content is as follows (where the hex packet is an algorithm package, can not find the words to write a small algorithm instead);
2, select the program, then right-click "Export", in the pop-up screen select the export mode as "JAR file", click "Next"
3. In the next step, select the output resource mode, file storage path and file name
4. Put the exported jar package and the Tea-hex-1.0.jar file required by the previous project into the Lib/ext of the JMeter folder for easy management
5. Create a new test script and import the generated jar package under the test plan
6. Add a sampler, the path is "thread group----ADD----Sampler----Bean Shell Sampler"
7. Write the Java code under the Bean Shell Sampler, implement the call to the jar package, and assign the encrypted content to Mypara (the statement usage please Baidu, the tutorial is very much)
8. Mypara the assigned parameter to another interface reference
9. Add "View results tree" To view the call situation