如何在jmeter中创建用户定义的功能

时间:2014-12-12 13:20:02

标签: java jmeter

我想在jmeter中创建一个函数,需要使用Function helper Dialog调用此函数,当我谷歌这个时,我发现了一个链接

http://www.javacodegeeks.com/2013/06/jmeter-custom-function-implementation.html

但仍然没有在对话框中显示创建的函数。

有人会帮忙吗?

提前致谢....

我的Jmeter日志是:

2014/12/18 10:48:00 INFO  - jmeter.util.JMeterUtils: Setting Locale to en_US 
2014/12/18 10:48:00 INFO  - jmeter.JMeter: Loading user properties from: E:\apache-jmeter-2.12\apache-jmeter-2.12\bin\user.properties 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Loading system properties from: E:\apache-jmeter-2.12\apache-jmeter-2.12\bin\system.properties 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Copyright (c) 1998-2014 The Apache Software Foundation 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Version 2.12 r1636949 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: java.version=1.7.0_51 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: java.vm.name=Java HotSpot(TM) Client VM 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: os.name=Windows XP 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: os.arch=x86 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: os.version=5.1 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: file.encoding=Cp1252 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Default Locale=English (United States) 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: JMeter  Locale=English (United States) 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: JMeterHome=E:\apache-jmeter-2.12\apache-jmeter-2.12 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: user.dir  =E:\apache-jmeter-2.12\apache-jmeter-2.12\bin 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: PWD       =E:\apache-jmeter-2.12\apache-jmeter-2.12\bin 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: IP: 10.206.0.106 Name: himanshuj2 FullName: himanshuj2.newvisionsoftware.com 
2014/12/18 10:48:01 INFO  - jmeter.JMeter: Loaded icon properties from org/apache/jmeter/images/icon.properties 
2014/12/18 10:48:03 INFO  - jmeter.engine.util.CompoundVariable: Note: Function class names must contain the string: '.functions.' 
2014/12/18 10:48:03 INFO  - jmeter.gui.action.LookAndFeelCommand: Using look and feel: javax.swing.plaf.metal.MetalLookAndFeel [Metal, CrossPlatform] 
2014/12/18 10:48:04 INFO  - jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22 
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default 
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is  
2014/12/18 10:48:05 INFO  - jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser 
2014/12/18 10:48:05 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.http.control.gui.WebServiceSamplerGui 
2014/12/18 10:48:05 INFO  - jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.http.modifier.gui.ParamModifierGui 
2014/12/18 10:48:06 INFO  - jorphan.exec.KeyToolUtils: keytool found at 'keytool' 
2014/12/18 10:48:06 INFO  - jmeter.protocol.http.proxy.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that support embedded 3rd party resources in file E:\apache-jmeter-2.12\apache-jmeter-2.12\bin\proxyserver.jks 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: sampleresult.useNanoTime=true 
2014/12/18 10:48:08 INFO  - jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000 

1 个答案:

答案 0 :(得分:0)

您必须确保您的函数位于包含其名称的包中:

  • .functions。并且不包含.gui。

这是jmeter.properties中的这个属性:

  • classfinder.functions.contain = .functions。

  • classfinder.functions.notContain = .gui。