In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
You can customize classes and methods in jmeter beanshell, and you can also call external existing java files, class files, and jar packages.
Here we will talk about calling external java files, class files, and jar packages respectively.
First, call java file
Syntax:
Source ("java file path")
The file path can be either absolute or relative.
Example:
Source ("E:\ eclipse\ workspace\ MD5\ src\ jmeter\ MD5.java")
Or:
Source ("MD5.java");-- the file is located in the jmeter bin directory
String strMd5 = MD5.GetMD5Code ("123456")
Second, call class file
Syntax:
AddClassPath ("directory where the class file is located")
Import class name
Example:
AddClassPath ("C:");-"can be a parent directory or an ancestor directory"
Import com.MD5
String strMd5 = MD5.GetMD5Code ("123456")
The path path of the imported class file is different from that of the imported java file. The comparison is as follows:
Source ("E:\ eclipse\ workspace\ MD5\ src\ jmeter\ MD5.java");-- you must specify the full path to the file when using an absolute path.
AddClassPath ("C:");-- the class file is fine as long as it is on disk C, not necessarily in the root directory of disk C. you don't have to specify the full path.
3. Call jar package
Usage:
Import the jar package in the test plan, or put the jar package in the jmeter lib directory ahead of time and restart it
Import class name
Example:
Import com.MD5
String strMd5 = MD5.GetMD5Code ("123456")
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.