jmeter自定义java,JMeter与自定义Java代码

I am new to JMeter and trying out certain sample code as part of my POC's. My requirement is pretty simple, I just need to attach a zip file to a SOAP message and fire the request. But to create the SOAP message we already have a framework that needs to be used. Now the problem I am facing is to include the framework JARs. I tried to add the library files into the project and create a JAR and paste it in /lib/ext folder and also by putting them in the class path. None of this works.

How do you use any existing framework JARs with the custom code you write for JMeter??

解决方案

Drop your jar to /lib folder of your JMeter installation

Restart JMeter. JMeter doesn't pick up new libraries or configuration file changes dynamically.

In Beanshell or JSR223 Sampler refer to your jar classes as:

import com.yourcompany.package.SomeClass;

import com.yourcompany.package.SomeMessage;

SomeClass myClass = new SomeClass(parameter1, parameter2);

SomeMessage message = myClass.createMessage();

message.send();

See WebSocket Testing With Apache JMeter guide as an example of using external jars in JMeter.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值