Using Jmeter version 5.2.1 on Ubuntu 18.04 we have a number of tests we run and some of them have custom messages. Below is the code.
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="C01 - ${marsha} Current Date" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="1193219718">unsuccessfulSell=true</stringProp>
</collectionProp>
<stringProp name="Assertion.custom_message">C01 - ${marsha} Current Date - Product Not Available</stringProp>
<stringProp name="Assertion.test_field">Assertion.sample_label</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">6</intProp>
</ResponseAssertion>
When we run this in the GUI version we get something like the following:
C01 - abzcy Current Date - Product Not Available
When we run the same test with the CLI we get no message at all. Originally I thought it was working but I was seeing the wrong column.
Any thoughts?
Attached is a screenshot of the rule I'm referring to.
Screenshot of assertion screen.
The custom message does not come out at all.
For other assertions we do not have this issue.
I cannot reproduce your issue given this Response Assertion Configuration:
When I run JMeter in command-line non-GUI mode as follows:
./jmeter -n -t test.jmx -l result.jtl
I can see the custom assertion failure message in the result.jtl file
Any chance you have customized Results File Configuration? In particular jmeter.save.saveservice.assertion_results_failure_message property needs to be set to true
Related
I'm doing some tests using JMeter but it seems that when running the test on GUI mode, some HTTPs requests response statistics can be seen via listeners but, when running the same test on non-GUI mode the same responses aren't saved in the jtl file and thus aren't shown in listeners when loading the jtl file on GUI-mode.
After running the test on GUI mode:
Results after running test
And then, running the same test but on non-GUI mode:
Command:
path/to/jmeter -n -t path/to/test.jmx -l path/to/results.jtl -j path/to/logfile.log -JnumUsers=10 -Jjmeterengine.force.system.exit=true -Dnashorn.args=--no-deprecation-warning
Results after loading the jtl file into a listener
You can see that the /buscarAvaliacaoAluno and /alterarAvaliacaoAluno responses aren't there anymore.
edit with error in log
It seems that it says that it can't find the javascript engine used by a postprocessor
After reading this post I understood that if I'm using java 11 or above, using javascript shouldn't work, but when running java -version I get "openjdk version "1.8.0_292" and echo ${JAVA_HOME} I get /usr/java/jdk1.8.0_91
javax.script.ScriptException: Cannot find engine named: 'javascript', ensure you set language field in JSR223 Test Element: Pega id's questionĂ¡rios
at org.apache.jmeter.util.JSR223TestElement.getScriptEngine(JSR223TestElement.java:101) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.extractor.JSR223PostProcessor.process(JSR223PostProcessor.java:44) [ApacheJMeter_components.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.runPostProcessors(JMeterThread.java:940) [ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:572) [ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
We cannot provide a comprehensive response without seeing the test plan, the full listener output and the jmeter.log file
If you don't see a sampler result in the .jtl file most probably it hasn't been executed and there could be various reasons for not executing the sampler.
You're looking into old results. Given you provide number of users as 50 I would expect at least 50 sampler results and you have only 10. Try adding -f command-line argument to your JMeter startup script so it would overwrite the existing .jtl file with the new data
You have logic controllers like If Controller for conditionally executing your /buscarAvaliacaoAluno and /alterarAvaliacaoAluno and the condition is not met
You have "Action to be taken after a Sampler error" other than Continue in Thread Group so your test fails somewhere before these samplers and hence they are not being executed
etc.
I am trying to execute jmeter with Robot Framework but getting attribute error when I tried to pass extra parameter. I tried below solution but it doesn't work.
How to pass values to the user defined variable in jmeter's jmx file via robot framework
Error:
robot TestCases/TC2_jmeter.robot
==============================================================================
TC2 jmeter
==============================================================================
Get_weather_info | FAIL |
AttributeError: module 'string' has no attribute 'split'
------------------------------------------------------------------------------
TC2 jmeter | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Sounds like usage of a deprecated string function
If you're using this library then it supposed to work with Python 2.7, I think you should be able to still get it, or alternatively identify and re-write the problematic piece of the library, it's open source in any case.
In general you should not need any extra libraries, it's quite possible to kick off a JMeter test in non-GUI mode or generate a HTML Reporting Dashboard using subprocess module
I'm having problem with the error that jp#gc plugin in jmeter didn't show the result csv and image. Can you help me to solve the problem ?
Ther configuration of jp#gc graphs generator:
meter-plugibn
The error is :
java.lang.IllegalArgumentException: Cannot find specified JTL file: C:\Users\ryard\Downloads\apache-jmeter-5.2.1\bin\hasil\out\result.csv
at kg.apc.jmeter.PluginsCMDWorker.checkParams(PluginsCMDWorker.java:90) ~[jmeter-plugins-cmd-2.2.jar:?]
at kg.apc.jmeter.PluginsCMDWorker.doJob(PluginsCMDWorker.java:104) ~[jmeter-plugins-cmd-2.2.jar:?]
at kg.apc.jmeter.listener.GraphsGeneratorListener.testEnded(GraphsGeneratorListener.java:222) ~[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:218) [ApacheJMeter_core.jar:5.2.1]
at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:492) [ApacheJMeter_core.jar:5.2.1]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
2020-02-10 15:02:17,808 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)
The error is about C:\Users\ryard\Downloads\apache-jmeter-5.2.1\bin\hasil\out\result.csv file missing, this is so called JTL Result File from which the charts are generated.
Make sure to run JMeter test in command-line non-GUI mode like:
jmeter -n -t /path/to/your/testplan.jmx -l C:\Users\ryard\Downloads\apache-jmeter-5.2.1\bin\hasil\out\result.csv
^^^^^^^^this is needed for generating result file
and Graphs Generator Listener should start working as expected.
Also be aware that starting from JMeter 3.0 there is HTML Reporting Dashboard with interactive zoomable charts, you might want to consider using it for reporting instead.
I am facing an issue when I try to analyze Jmeter HTML report.
I use this command to run and create HTML report
jmeter -n -t C:\JMETER_RTB_REQUEST\Framework\Test_Fragment\Test_Fragment_15_02_2018_vol2.jmx -l C:\Users\bs\Desktop\Jmeter_reports\results_geo.csv -e -o C:\Users\bs\Desktop\Jmeter_reports\HTML
The problem is that when I am opening the Html file, under error section it not mention on which test (thread group) it failed, so I can not understand what test failed. In the CSV exists thread name column, but not in the HTML error section. Is their any solution?
[][Thread groups from test plan]
[][CSV report thread Name exists(HTML1 is thread name)]
[[HTML report not mentioned thread Name]]
Since JMeter 4.0, you can customize assertion message:
So you would put custom message assertion including Thread Name calling __threadNum function.
Unable to run Jmeter test plan in scheduler mode in distributed testing.
We are using Bamboo pipeline with dockerized Jmeter, able to run in normal mode successfully however when tried the same test plan in scheduler mode facing an error with 'Endtime' value.
The current test plan after setting (scheduler mode is checked, forever is checked, delay is set to 0 and duration is set to 1800 seconds) and Start and End time kept as it is.
Jmeter version: 3.1
<stringProp name="ThreadGroup.num_threads">10</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1518153310000</longProp>
<longProp name="ThreadGroup.end_time">1518153310000</longProp>
<boolProp name="ThreadGroup.scheduler">true</boolProp>
<stringProp name="ThreadGroup.1800">1800</stringProp>
<stringProp name="ThreadGroup.delay">0</stringProp>
</ThreadGroup>
When run the test: getting below error "Error occurred compiling the tree:
End Time (2018/02/09 05:15:10) of Scheduler for Thread Group Thread Group
is in the past, fix value of End Time field" though scheduler, forever is true
root#081459cc5d34:/jmeter/apache-jmeter-3.1/bin# jmeter -n -t
/home/new.jmx
Writing log file to: /jmeter/apache-jmeter-3.1/bin/jmeter.log
Creating summariser <summary>
Created the tree successfully using /home/new.jmx
Starting the test # Fri Feb 09 05:35:49 UTC 2018 (1518154549080)
Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
Error occurred compiling the tree:
End Time (2018/02/09 05:15:10) of Scheduler for Thread Group Thread Group
is in
the past, fix value of End Time field,
see log file for more details
summary = 0 in 00:00:00 = ******/s Avg: 0 Min: 9223372036854775807
Max:
-9223372036854775808 Err: 0 (0.00%)
Tidying up ... # Fri Feb 09 05:35:49 UTC 2018 (1518154549166)
... end of run
Note: able to run the same test plan when set 'start and end time' by removing values for duration, delay.
Please guide.
Able to overcome issue in the latest Jmeter 4.0 release, our tests are running successfully.