I've got JMeter script which contains Include Controllers and
I want to run my test in distributed mode.
But I'm facing problem that JMeter slaves (remote nodes) can't find those elements which I want to include.
INFO o.a.j.c.IncludeController: loadIncludedElements -- try to load included module: /opt/jenkins/workspace/_start_jmeter_server_NFT/apache-jmeter-3.2/bin/../common_test_components/debug-component.jmx
INFO o.a.j.c.IncludeController: loadIncludedElements -failed for: /opt/jenkins/workspace/_start_jmeter_server_NFT/apache-jmeter-3.2/bin/../common_test_components/debug-component.jmx
INFO o.a.j.c.IncludeController: loadIncludedElements -Attempting to read it from: /opt/jenkins/workspace/_start_jmeter_server_NFT/apache-jmeter-3.2/bin/./../common_test_components/debug-component.jmx
ERROR o.a.j.c.IncludeController: Include Controller 'common component' can't load '../common_test_components/debug-component.jmx' - see log for details
Does that mean I would need to copy my component 'manually' the same way as data resources?
Yes, Any test dependency needs to be present in all the slave machines to run your test.
Manually copying these files would be annoying. So I would suggest you to go with docker where you package the entire environment with all the test dependencies as an Image. Then you just create a container from the image on each slave.
Please check here for more information.
http://www.testautomationguru.com/jmeter-distributed-load-testing-using-docker/
Related
I installed serverAgent 2.2.3
When I run it in cmd I get this error.
enter image description here
I tried starting the startAgent. bat. It automatically closes.
Thanks for looking.
That's very weird because the error states that sl4j library cannot be found in CLASSPATH and ServerAgent doesn't use this library at all.
Try downloading it from Github and unpacking it somewhere else. Also if you have CLASSPATH environment variable set - try clearing/unsetting it.
set CLASSPATH= && startAgent.bat
More information: How to Monitor Your Server Health & Performance During a JMeter Load Test
Alternatively you can try downloading sl4j.jar and dropping it near ServerAgent.jar but it is not a part of normal ServerAgent installation procedure.
I'm using JMeter 5.2.1 and when I run some test in GUI mode (or even start the GUI mode), the jmeter.log is populated. But when I use non-GUI mode, nothing is happening.
Command line : "M:\Apps\apache-jmeter-5.2.1\bin\jmeter" -Jthreads=1 -Jrampup=20 -n -t "M:\Data.....\test.jmx" -l "M:\Data\test.csv".
Test runs fine and generates csv, but the jmeter.log doesn't get touched. Right after the test completes, JMeter console is closed down so can't even see if there's any further errors.
My understanding is this jmeter.log should be updated from both GUI and non GUI test runs. Am I missing something?
jmeter.log is written in the folder of execution
So if you execute non GUI (CLI) mode it will append/create jmeter.log in your folder
See also related command line log options:
-l, --logfile <argument>
the file to log samples to
-i, --jmeterlogconf <argument>
jmeter logging configuration file (log4j2.xml)
-j, --jmeterlogfile <argument>
jmeter run log file (jmeter.log)
Your understanding is correct, however it might not be the case regarding your understanding regarding where to find the jmeter.log file.
If you're running JMeter from it's "bin" folder - the jmeter.log file will be generated/updated in this folder
If you're running JMeter from another folder, it will be generated in that folder. If this is your case - instead of looking for updated log under M:\Apps\apache-jmeter-5.2.1\bin look for in in %cd%\jmeter.log
If the above hints don't help - most probably your log4j2.xml file got corrupted somewhere somehow, get the brand new version from JMeter GitHub
If you want JMeter to store the log under M:\Apps\apache-jmeter-5.2.1\bin folder no matter where you run it from - replace this line:
<File name="jmeter-log" fileName="${sys:jmeter.logfile:-jmeter.log}" append="false">
with this one:
<File name="jmeter-log" fileName="M:/Apps/apache-jmeter-5.2.1/bin/jmeter.log}" append="false">
and on next start of JMeter you will see the "log update" you're looking for.
More information: How to Configure JMeter Logging
Also be aware that according to JMeter Best Practices you should always be using the latest version of JMeter so it might be a good idea to perform an upgrade
I'm new to BlazeMeter and JMeter.
I created a simple Selenium JUnit Script, it can run in IDE.
I then loaded the script into JMeter using JUnitSampler. I run the test in JMeter on my local and it was able to run. Then I uploaded the .jmx file to BlazeMeter and when I try to run it, it would fail.
If I look into the Logs page on BlazeMeter, it complains ClassNotFoundException. Can anybody tell me what's wrong?
2017-11-23 20:16:47,497 WARN o.a.j.p.j.s.JUnitSampler: ClassNotFoundException:: xxxxxx.SampleLoadTest2
And on BlazeMeter Failed Report Summary page, it shows
Error Running Test
The test encountered the following fatal error, and could not complete successfully:
Error: r-v3-5a172c6260523 - Session ended without load report data
you most probably didn’t add the required libraries on Blazemeter (selenium jars...)
So ensure you add them and it should work
When I try to start a WebSphere Liberty server in debug mode (to connect the Eclipse Java debugger) via:
$ ./wlp/bin/server debug MyServer
I get the following error:
Error occurred during initialization of VM
agent library failed to init: jdwp
ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
and the server doesn't start.
The jvm.options contents can collide with the 'debug' subcommand
If the jvm.options file already includes options enabling the debugger then use the
liberty start <server>
subcommand rather than:
liberty debug <server>
E.g. in my case my server had file .../usr/servers/MyServer/jvm.options with contents:
#Generated by liberty-maven-plugin
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=7777
so these options collided with the options triggered by the debug subcommand.
OR
You can remove the jvm.options contents or file and use the debug subcommand instead.
NOTE: Reading this explanation, the error message becomes clear, but this Q&A is hopefully useful in case it didn't occur to someone that this is the solution.
In jvm.options put these entries:
-Dwas.debug.mode=true
-Dcom.ibm.websphere.ras.inject.at.transform=true
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=7777
Just to add an update, jvm.options can also reside in /usr/shared so the same debug options span multiple servers. This would be a bad approach if you're running multiple servers and need to debug them all individually.
I have implemented PerfMon Metrics Collector (listeners) in my JMeter scripts. These listeners have HOST and PORT fields. I have defined variables for these in Test Plan and using them in listeners.
I tested these scripts in non-distributed mode and it worked perfectly.
Now, I converted my scripts for distributed mode. Everything works fine except PerfMon listeners which throw following error message:
2016/02/29 09:06:35 ERROR - kg.apc.jmeter.perfmon.PerfMonCollector: Perfmon plugin error: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine
This error seemed to be related to invalid value (may be these listeners do not handle special characters like {} $ in distributed mode!!). So, I removed variables for HOST/PORT and instead used hard coded values and it worked fine.
So apparently, these listeners do not work properly in distributed mode (IF used with variables).
Is there any workaround for this issue as I have plenty of PerfMon listeners in my setup and manually changing them all will be a tiresome job.
Go for JMeter Properties instead of JMeter Variables, like:
Substitute ${HOST} with ${__P(HOST,)}
Substitute ${PORT} with ${__P(PORT,)}
Pass HOST and PORT properties values on JMeter master side like:
jmeter -GHOST=target_hostname_or_IP -GPORT=target_port -s -n -t ....
You can have different values on different slaves, in that case specify properties in user.properties file (it's located under /bin folder of JMeter installation) like:
HOST=10.20.30.40
PORT=1234
Remember to restart JMeter after editing any configuration file.
References:
__P() function documentation
Full list of command-line options
Apache JMeter Properties Customization Guide