Jmeter include controller relative path - jmeter

We are using Jmeter-maven-plugin and created a maven project in eclipse. My test file (MainTest.jmx) is in src/test/jmeter folder, in this test we used "include controller" to reuse test fragments. These fragments are stored in src/test/jmeter/fragments. We tried following relative path in include controller
../fragments/FragmentA.jmx
src/test/jmeter/fragments/FragmentA.jmx
Tried propertiesUser option in pom.xml
<propertiesUser>
<fragments.directory>src/test/jmeter/fragments</fragments.directory>
</propertiesUser>
Include controller failing to load .jmx file. Getting following
ERROR
o.a.j.c.IncludeController: Include Controller 'Include Controller'
can't load '${__P(fragments.directory)}/fragmentA.jmx' - see log for
details.
java.io.IOException: loadIncludedElements -failed for:
E:\Luna\ADXJmeter\target\jmeter\bin\${__P(fragments.directory)}\FragmentA.jmx and E:\Luna\ADXJmeter\target\jmeter\testFiles\${__P(fragments.directory)}\FragmentA.jmx
Complete Log
> 2017-05-24 12:14:39,442 INFO o.a.j.c.IncludeController: loadIncludedElements -- try to load included module: E:\Luna\ADXJmeter\target\jmeter\bin\FragmentA.jmx
> 2017-05-24 12:14:39,442 INFO o.a.j.c.IncludeController: loadIncludedElements -failed for: E:\Luna\ADXJmeter\target\jmeter\bin\FragmentA.jmx
> 2017-05-24 12:14:39,442 INFO o.a.j.c.IncludeController: loadIncludedElements -Attempting to read it from: E:\Luna\ADXJmeter\target\jmeter\testFiles\FragmentA.jmx
> 2017-05-24 12:14:39,442 ERROR o.a.j.c.IncludeController: Include Controller 'Include Controller' can't load 'FragmentA.jmx' - see log for details
> 2017-05-24 12:14:39,443 ERROR o.a.j.u.JMeterUtils: Including file "FragmentA.jmx" failed for Include Controller "Include Controller", unexpected error - see log for details
> 2017-05-24 12:14:39,443 WARN o.a.j.c.IncludeController: Including file "FragmentA.jmx" failed for Include Controller "Include Controller", unexpected error
> java.io.IOException: loadIncludedElements -failed for: E:\Luna\ADXJmeter\target\jmeter\bin\FragmentA.jmx and E:\Luna\ADXJmeter\target\jmeter\testFiles\FragmentA.jmx
> at org.apache.jmeter.control.IncludeController.loadIncludedElements(IncludeController.java:139) [ApacheJMeter_components-3.2.jar:3.2 r1790748]
> at org.apache.jmeter.control.IncludeController.resolveReplacementSubTree(IncludeController.java:111) [ApacheJMeter_components-3.2.jar:3.2 r1790748]
> at org.apache.jmeter.JMeter.runNonGui(JMeter.java:936) [ApacheJMeter_core-3.2.jar:3.2 r1790748]
> at org.apache.jmeter.JMeter.startNonGui(JMeter.java:910) [ApacheJMeter_core-3.2.jar:3.2 r1790748]
> at org.apache.jmeter.JMeter.start(JMeter.java:538) [ApacheJMeter_core-3.2.jar:3.2 r1790748]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
> at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]

Have you read the documentation prior to attempting to use Include Controller this way?
This element does not support variables/functions in the filename field.
However, if the property includecontroller.prefix is defined, the contents are used to prefix the pathname.
The same chapter provides the clue: you have includecontroller.prefix property and JMeter will attempt to find the file under the path of includecontroller.prefix + Filename
So you should amend your configuration as follows:
<propertiesUser>
<includecontroller.prefix>src/test/jmeter/fragments</includecontroller.prefix>
</propertiesUser>
And use just FragmentA.jmx in the Include Controller.
Check out How to Manage Large JMeter Scripts With JMeter Test Fragments for more information on working with modular JMeter tests.

Related

How do I fix JMeterPluginsCMD "Exception in thread "main" java.lang.ExceptionInInitializerError" error

I'm trying to use the JMeterPluginsCMD on Windows to generate load test result graphs after a JMeter run. I installed the plugin from the JMeter Plugins Manager.
When I run a command, I get an error message. What can I do about this error message?
`JMeterPluginsCMD.bat --generate-png "test.png" --input-jtl "...\test-3.jtl" --plugin-type ResponseTimesOverTime --width 800 --height 600`
The plugin JMeterPluginsCMD.bat existed in JMETER_home/bin
I am getting the following error:
2021-11-17 09:54:35,131 WARN o.a.j.u.JMeterUtils: Exception 'Cannot invoke "java.util.Properties.getProperty(String, String)" because "org.apache.jmeter.util.JMeterUtils.appProperties" is null' occurred when fetching String property:'sampleresult.default.encoding', defaulting to: ISO-8859-1
2021-11-17 09:54:35,137 WARN o.a.j.u.JMeterUtils: Exception 'Cannot invoke "java.util.Properties.getProperty(String)" because "org.apache.jmeter.util.JMeterUtils.appProperties" is null' occurred when fetching String property:'jmeterPlugin.prefixPlugins'
2021-11-17 09:54:35,138 INFO k.a.j.PluginsCMDWorker: Using JMeterPluginsCMD v. N/A
2021-11-17 09:54:35,139 INFO o.a.j.u.JMeterUtils: Setting Locale to en_US
2021-11-17 09:54:35,147 INFO k.a.j.JMeterPluginsUtils: Loading user properties from: E:\Outcode\ProtocolNow\apache-jmeter-5.3\bin\user.properties
2021-11-17 09:54:35,148 INFO k.a.j.JMeterPluginsUtils: Loading system properties from: E:\Outcode\ProtocolNow\apache-jmeter-5.3\bin\system.properties
ERROR: java.lang.ExceptionInInitializerError
*** Problem's technical details go below ***
Home directory was detected as: E:\Outcode\ProtocolNow\apache-jmeter-5.3\lib
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:990)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:593)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:515)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:484)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:430)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:383)
at org.apache.jmeter.save.SaveService$XStreamWrapper.<init>(SaveService.java:82)
at org.apache.jmeter.save.SaveService$XStreamWrapper.<init>(SaveService.java:80)
at org.apache.jmeter.save.SaveService.<clinit>(SaveService.java:113)
at org.apache.jmeter.save.CSVSaveService.processSamples(CSVSaveService.java:144)
at org.apache.jmeter.reporters.ResultCollector.loadExistingFile(ResultCollector.java:380)
at kg.apc.jmeter.PluginsCMDWorker.doJob(PluginsCMDWorker.java:138)
at kg.apc.cmdtools.ReporterTool.processParams(ReporterTool.java:255)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:62)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:21)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:115)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module #75c072cb
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:40)
at com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit>(TreeMapConverter.java:50)
... 20 more
The right place to seek for help with this regards is JMeter Plugins Support Forum
Coming back to your question:
In the JMeterPluginsCMD.bat change this line:
java -jar %~dp0\..\lib\cmdrunner-2.2.jar --tool Reporter %*
to this one:
java --add-opens=java.base/java.util=ALL-UNNAMED -jar %~dp0\..\lib\cmdrunner-2.2.jar --tool Reporter %*
Be aware that according to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article you should always be using the latest version of JMeter so consider upgrading to JMeter 5.4.1 (or whatever is the latest stable version which is available at JMeter Downloads page) on next available opportunity.

How do I fix JMeterPluginsCMD "Missing plugin type specification" error

I'm trying to use the JMeterPluginsCMD on Windows to generate load test result graphs after a JMeter run. I installed the plugin manually because I can't use the JMeter Plugins Manager. (I don't have the network information I need to configure it). When I run a simple command .\JMeterPluginsCMD.bat, I get an error message. What can I do about this error message?
Here's the error message ERROR: java.lang.IllegalArgumentException: Missing plugin type specification
Here's the full error output:
~\Desktop\apache-jmeter-5.1.1\bin> .\JMeterPluginsCMD.bat
2019-08-12 12:10:29,564 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'sampleresult.default.encoding', defaulting to: ISO-8859-1
2019-08-12 12:10:29,571 WARN o.a.j.u.JMeterUtils: Exception 'null' occurred when fetching String property:'jmeterPlugin.prefixPlugins'
2019-08-12 12:10:29,572 INFO k.a.j.PluginsCMDWorker: Using JMeterPluginsCMD v. N/A
2019-08-12 12:10:29,574 INFO o.a.j.u.JMeterUtils: Setting Locale to en_US
2019-08-12 12:10:29,578 INFO k.a.j.JMeterPluginsUtils: Loading user properties from: C:\Path\apache-jmeter-5.1.1\bin\user.properties
2019-08-12 12:10:29,582 INFO k.a.j.JMeterPluginsUtils: Loading system properties from: C:\Path\apache-jmeter-5.1.1\bin\system.properties
ERROR: java.lang.IllegalArgumentException: Missing plugin type specification
*** Problem's technical details go below ***
Home directory was detected as: C:\Path\apache-jmeter-5.1.1\lib
Exception in thread "main" java.lang.IllegalArgumentException: Missing plugin type specification
at kg.apc.jmeter.PluginsCMDWorker.checkParams(PluginsCMDWorker.java:78)
at kg.apc.jmeter.PluginsCMDWorker.doJob(PluginsCMDWorker.java:104)
at kg.apc.cmdtools.ReporterTool.processParams(ReporterTool.java:255)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:62)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:115)
~\Desktop\apache-jmeter-5.1.1\bin>
You are missing plugin-type parameter, example:
JMeterPluginsCMD.bat --generate-png test.png --input-jtl results.jtl --plugin-type ResponseTimesOverTime --width 800 --height 600
Your plugin jar should be available in lib/ext folder
Make note that you need to install corresponding plugins set to have Extras plugins available in CMD.

Getting Error 500 in SMTP sampler in JMeter

I am getting this error while running the SMTP Sampler in JMeter:
Response code: 500
Response message: IOException while sending message
And I got the following in the logs:
javax.mail.MessagingException: IOException while sending message at
com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1167)
~[mail-1.5.0-b01.jar:1.5.0-b01] at
org.apache.jmeter.protocol.smtp.sampler.protocol.SendMailCommand.execute(SendMailCommand.java:303)
~[ApacheJMeter_mail.jar:3.2 r1790748] at
org.apache.jmeter.protocol.smtp.sampler.SmtpSampler.executeMessage(SmtpSampler.java:169)
[ApacheJMeter_mail.jar:3.2 r1790748] at
org.apache.jmeter.protocol.smtp.sampler.SmtpSampler.sample(SmtpSampler.java:146)
[ApacheJMeter_mail.jar:3.2 r1790748] at
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:491)
[ApacheJMeter_core.jar:3.2 r1790748] at
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425)
[ApacheJMeter_core.jar:3.2 r1790748] at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254)
[ApacheJMeter_core.jar:3.2 r1790748] at java.lang.Thread.run(Unknown
Source) [?:1.8.0_201] Caused by: java.io.FileNotFoundException: V:\001
Automation\Automation Scripts\Test Plan\Cloud\Final\Priority 6 -
Process (Access is denied) at java.io.FileInputStream.open0(Native
Method) ~[?:1.8.0_201]
What would probably the cause of the issue and how it will be resolved?
According to the error message JMeter cannot access the following file:
V:\001 Automation\Automation Scripts\Test Plan\Cloud\Final\Priority 6 - Process
make sure to amend the permissions to the file and make sure the user account under which you're running JMeter has access to the given file.
Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so consider upgrading to JMeter 5.1 (or whatever is the latest stable version which is available at JMeter Downloads page) as soon as possible.

JMeter: No Class Def Found Error: kg/apc/jmeter/JMeterPluginsUtils

I'm trying to run a JMeter test and I keep getting the error listed below. I'm running in non-gui mode on an EC2 instance. I know I'm missing a .jar file and that's what is causing the error. But when I head over to Apache to look through their JMeter plugins, I can't find one that resolves this error.
2017-09-06 21:18:12,954 ERROR o.a.j.JMeter: Uncaught exception:
java.lang.NoClassDefFoundError: kg/apc/jmeter/JMeterPluginsUtils
at kg.apc.jmeter.PluginsCMDWorker.<init>(PluginsCMDWorker.java:51) ~[jmeter-plugins-cmd-2.1.jar:?]
at kg.apc.jmeter.listener.GraphsGeneratorListener.testEnded(GraphsGeneratorListener.java:146) ~[jmeter-plugins-graphs-ggl-2.0.jar:?]
at kg.apc.jmeter.listener.GraphsGeneratorListener.testEnded(GraphsGeneratorListener.java:137) ~[jmeter-plugins-graphs-ggl-2.0.jar:?]
at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfEnd(StandardJMeterEngine.java:230) ~[ApacheJMeter_core.jar:3.2 r1790748]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:498) ~[ApacheJMeter_core.jar:3.2 r1790748]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141]
Caused by: java.lang.ClassNotFoundException: kg.apc.jmeter.JMeterPluginsUtils
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_141]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_141]
Your JMeter Plugins installation is corrupt, double check you have jmeter-plugins-cmn-jmeter-0.3.jar file in the "lib" folder of your JMeter installation. If not - you will have to re-install JMeterPluginsCMD Command Line Tool
Be aware that recommended way of installing JMeter Plugins and keeping them up-to-date is using JMeter Plugins Manager
If you are running in Non-UI mode just remove the plugin element from your jmx file.

Running jmeter .jmx tests locally using windows command line giving illegal argument exception

Using below command to run the tests on windows cmd - Is there any initialization required in jmeter for doing so.
jmeter -n -t C:/Users/meiyer/Desktop/LOAD TOOLS/jmeter samples/50users10count.jmx
stacktrace -
2016/08/29 15:17:18 INFO - jmeter.util.JMeterUtils: Setting Locale to en_US
2016/08/29 15:17:18 INFO - jmeter.JMeter: Loading user properties from:
C:\Users\meiyer\Documents\apache-jmeter-3.0\apache-jmeter-
3.0\bin\user.properties
2016/08/29 15:17:18 INFO - jmeter.JMeter: Loading system properties from:
C:\Users\meiyer\Documents\apache-jmeter-3.0\apache-jmeter-
3.0\bin\system.properties
2016/08/29 15:17:18 FATAL - jmeter.JMeter: An error occurred:
java.lang.IllegalArgumentException: Unknown arg: TOOLS/jmeter
at org.apache.jmeter.JMeter.initializeProperties(JMeter.java:746)
at org.apache.jmeter.JMeter.start(JMeter.java:385)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.jmeter.NewDriver.main(NewDriver.java:259)
Your issue comes from the space between LOAD and TOOLS.
Use quote around the path:
jmeter -n -t "C:/Users/meiyer/Desktop/LOAD TOOLS/jmeter samples/50users10count.jmx"

Resources