Related
My windows system has two Java versions: 15 & 17
I want to make Jmeter pick up version 15.
I set path as: C:\Program Files\Java\jdk-15.0.2\bin
And JAVA_HOME as C:\Program Files\Java\jdk-15.0.2
When I do: java -version I have:
But still seems like Jmeter is picking up Java 17 due to an exception when I run code that contains JSR223 Assertion
2022-05-12 13:40:51,300 ERROR o.a.j.a.JSR223Assertion: Problem in JSR223 script: JSR223 Assertion
javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Unsupported class file major version 61
How to 'force' Jmeter to pick up java 15?
It's sufficient to set the Java version you want to use to be ahead of other Javas in PATH environment variable and JMeter will pick it up.
set PATH="C:\Program Files\Java\jdk-15.0.2\bin";%PATH%
In order to check what Java version JMeter is using you can add a Debug Sampler configured like:
and look for java.version property in the View Results Tree listener
or just look for java.version line in the JMeter.log file
Milk and honey for me here were:
1 set path as: set PATH="C:\Program Files\Java\jdk-15.0.2\bin";%PATH%
2 lunch Jmeter from cmd as: java -jar ApacheJMeter.jar
coz launching from 'ApacheJMeter.jar' probably initiated hardcode java version
the alternative is the creation of .bat launcher as:
a) create startJmeter.bat
b) put inside
c:
cd C:\apache-jmeter-5.4.3\bin
java -jar ApacheJMeter.jar
sh jmeter.sh -n -t filePath.jmx -l outFilePath.jtl -e -o folderPath
Error generating the report: org.apache.jmeter.report.dashboard.GenerationException: Error while processing samples: Consumer failed with message :Consumer failed with message :Consumer failed with message :Consumer failed with message :Begin size 0 is not equal to fixed size 5
In resume
Consumer failed with message :Begin size 0 is not equal to fixed size 5
currently using Java version "17" 2021-09-14 LTS
MacOS big SUR version 11.4
the properties files are fresh and values are equal to the default ones
Jmeter 5.4.1
outFile.jtl
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect
1632430450882,1117,HTTP Request,200,OK,FIRST_Jmeter_Test 1-3,text,true,,3824,557,3,3,Url_hidden,1111,0,256
1632430450448,1755,HTTP Request,200,OK,FIRST_Jmeter_Test 1-2,text,true,,3836,557,3,3,Url_hidden,1755,0,690
1632430450448,1755,HTTP Request,200,OK,FIRST_Jmeter_Test 1-1,text,true,,3828,557,3,3,Url_hidden,1755,0,690
1632430452312,585,HTTP Request,200,OK,FIRST_Jmeter_Test 1-2,text,true,,3836,557,3,3,Url_hidden,585,0,144
1632430452238,758,HTTP Request,200,OK,FIRST_Jmeter_Test 1-3,text,true,,3832,557,3,3,Url_hidden,757,0,137
1632430452301,806,HTTP Request,200,OK,FIRST_Jmeter_Test 1-1,text,true,,3828,557,3,3,Url_hidden,805,0,136
1632430452962,550,HTTP Request,200,OK,FIRST_Jmeter_Test 1-2,text,true,,3824,557,3,3,Url_hidden,550,0,152
1632430453328,593,HTTP Request,200,OK,FIRST_Jmeter_Test 1-1,text,true,,3828,557,2,2,Url_hidden,592,0,135
1632430453276,815,HTTP Request,200,OK,FIRST_Jmeter_Test 1-3,text,true,,3840,557,1,1,Url_hidden,814,0,142
The thread run successfully and the jtl file is created as well.
I quite new on Jmeter and tried to see where that "size" attribute is currently locate to see how change it, but could not find it on any *.properties file
any though how can be this fixed, what the message is referring to?
thanks
This error is likely due to an incompatibility of JMeter with Java 17 (as mentioned by Dmitri T).
Whilst we wait for a fix, a workaround would be downgrading to Java 16. I can confirm this solved the issue for me.
I had the same issue with:
MacOS big SUR version 11.6
Jmeter 5.4.1 (installed via brew)
Temurin 11 (LTS) OpenJDK & Temurin 8 (LTS) OpenJDK
Running Jmeter with Java 8 solved my issue. The problem was, that Jmeter always used Java 11. I struggled some days to find out, how to set the Jmeter Java version:
set the correct Java 8 Home in: /usr/local/Cellar/jmeter/5.4.1/bin/jmeter:
JAVA_HOME=$JAVA_8_HOME exec "/usr/local/Cellar/jmeter/5.4.1/libexec/bin/jmeter" "$#"
Maybe there are easier ways to set Java 8 for Jmeter - but this was the only solution which worked for me.
I had Java 8 installed however, the JMeter was picking up Java 1.17 which was nowhere in my system. So uninstalling and reinstalling jmeter, worked like a charm for me.
I cannot reproduce your issue using:
openjdk:8-jre-alpine docker image
JMeter 5.4.1
Test plan Test.jmx from extras folder of JMeter
Demo:
If you cannot reproduce the above behaviour I think you made some changes either to Results File Configuration or to Reporting Configuration or both so you need to inspect all the JMeter Properties which differ from the defaults and restore their values to the original ones.
If you need further support you need to share at least first 2 lines of your outFilePath.jtl results file. Better if possible the full file and all the .properties files from JMeter's "bin" folder.
exec commandline /usr/libexec/java_home -V
enter image description here
replace bin of jmeter JAVA_HOME
enter image description here
and then ,it is success.
When I am passing the command in command prompt then I am getting the below error-
C:\Users\ShivangiT\Downloads\apache-jmeter-5.3\apache-jmeter-5.3\bin>Jmeter.bat -Jjmeter.save.saveservice.output_format=xml -n -t \Users\ShivangiT\Downloads\apache-jmeter-5.3\apache-jmeter-5.3\bin\vieweventpage.jmx -l \Users\ShivangiT\Downloads\apache-jmeter-5.3\apache-jmeter-5.3\bin\rr.jtl
Creating summariser <summary>
Created the tree successfully using \Users\ShivangiT\Downloads\apache-jmeter-5.3\apache-jmeter-5.3\bin\vieweventpage.jmx
Starting standalone test # Fri Aug 21 07:29:38 BST 2020 (1597991378434)
Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
summary = 41 in 00:00:14 = 2.9/s Avg: 5256 Min: 7 Max: 13688 Err: 13 (31.71%)
Tidying up ... # Fri Aug 21 07:29:52 BST 2020 (1597991392905)
... end of run
The JVM should have exited but did not.
The following non-daemon threads are still running (DestroyJavaVM is OK):
Thread[DestroyJavaVM,5,main], stackTrace:
Thread[AWT-EventQueue-0,6,main], stackTrace:sun.misc.Unsafe#park
java.util.concurrent.locks.LockSupport#park
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject#await
java.awt.EventQueue#getNextEvent
java.awt.EventDispatchThread#pumpOneEventForFilters
java.awt.EventDispatchThread#pumpEventsForFilter
java.awt.EventDispatchThread#pumpEventsForHierarchy
java.awt.EventDispatchThread#pumpEvents
java.awt.EventDispatchThread#pumpEvents
java.awt.EventDispatchThread#run
Thread[AWT-Shutdown,5,system], stackTrace:java.lang.Object#wait
sun.awt.AWTAutoShutdown#run
java.lang.Thread#run
Can anybody please help me with this.
This is a known issue of JMeter 5.3 when test plan contains Http(s) Test script recorder.
The workaround is to remove it.
See:
https://bz.apache.org/bugzilla/show_bug.cgi?id=64479
Alternatively you can try nightly build:
https://ci.apache.org/projects/jmeter/nightlies/
Shiva, I would suggest that you should use the older version of JMeter always. The reason is very simple. There is not much of a change in JMeter since JMeter 4. JMeter is more inclined towards its compatibility with JDK 11 as currently, it supports JDK 8 flawlessly in the older versions. Use JMeter 4 from the JMeter official archive and you'll be able to execute everything smoothly. No need to look for workarounds. Make sure you use JMeter 4
I have just upgrated from JMETER 3.2 to JMETER 5.1.1.
I have a problem in generating the JTL file.
To run a test, I use the following command:
& .\jmeter.bat -n -t "C:\test\jmx_test.jmx" -l "C:\test\jmx_test.jtl" -j "C:\test\jmx_test.txt"
Before, with version 3.2 the result of the JTL was :
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,Latency,IdleTime,Connect
1568895933205,686,000_Login - /test-app,200,OK,Declaration_1... 1-1,text,true,,3170,314,1,1,685,0,650
1568895935077,312,001_Login - /test-app/login/login.jsf,200,OK,Declaration_2... 1-1,text,true,,11873,1025,1,1,212,0,0
....
Now with version 5.1.1, the result is :
timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect
1568897692191,669,000_Login - /test-app,200,OK,Declaration_1... 1-1,text,true,,3168,314,1,1,https://xxxxx.jsf,668,0,637
1568897693648,260,001_Login - /test-app/login/login.jsf,200,OK,Declaration_2... 1-1,text,true,,11871,1041,1,1,https://xxxxx;jsessionid=xxxx,199,0,0
1568897693648,199,001_Login - /test-app/login/login.jsf-0,302,Moved Temporarily,Declaration_2... 1-1,text,true,,407,655,1,1,https://xxxxx;jsessionid=xxxx,199,0,0
1568897693852,56,001_Login - /test-app/login/login.jsf-1,200,OK,Declaration_2... 1-1,text,true,,11464,386,1,1,https://xxxxx;jsessionid=xxxx,55,0,0
....
As next I create reports with this command :
& ./CMDRunner.jar --tool Reporter --input-jtl "C:\test\jmx_test.jtl" --plugin-type AggregateReport --generate-csv jmx_test.csv
I have problems because the samplers are duplicated.
With version 5.1.1, is it possible to merge, as before, the 3 labels of the same sampler (001_Login - /test-app/login/login.jsf / 001_Login - /test-app/login/login.jsf-0 / 001_Login - /test-app/login/login.jsf-1) ?
In advance, thanks!
It seems there is a redirection happening and in your HTTP sampler and "follow redirection" option is checked. Uncheck it and check "redirect automatically" and run it again.
If I change this result, it may change the result from what I have read (http://www.testingdiaries.com/difference-between-redirect-automatically-and-follow-redirects/).
I think I've found the solution.
I have changed the value of the "subresults.disable_renaming" property in the "jmeter.properties" file :
# Since version 5.0 JMeter has a new SubResult Naming Policy which numbers subresults by default
# This property if set to true discards renaming policy. This can be required if you're using JMeter for functional testing.
# Defaults to: false
subresults.disable_renaming=true
What do you think about that?
I am using selenise runner to run script in different browsers.
I am using this config file:
firefox: C://Users/Desktop/geckodriver.exe
highlight: Yes
baseurl: https://example.com/
set-speed: 1000
timeout: 30000
driver: firefox
xml-result: C://Users/Desktop/Selenise/XMLReport
html-result: C://Users/Desktop/Selenise/HTMLReport
and this command to execute the execute the jars and reports:
set webdriver.gecko.driver=C:\Users\Desktop\geckodriver.exe
set path=%path%;webdriver.gecko.driver;
java -jar cmdJars.jar TestCases\TestCase1.html --config config.txt --driver firefox --firefox "C://Program Files/Mozilla Firefox/firefox.exe"
I am getting this error log:
[2017-01-17 10:34:38.139 +05:30] [INFO] Start: Selenese Runner 3.0.0
[2017-01-17 10:34:38.357 +05:30] [INFO] Firefox binary: C://Program Files/Mozill
a Firefox/firefox.exe
java.lang.IllegalStateException: The path to the driver executable must be set b
y the webdriver.gecko.driver system property; for more information, see https://
github.com/mozilla/geckodriver. The latest version can be downloaded from https:
//github.com/mozilla/geckodriver/releases
at com.google.common.base.Preconditions.checkState(Preconditions.java:19
9)
at org.openqa.selenium.remote.service.DriverService.findExecutable(Drive
rService.java:109)
at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriver
Service.java:37)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExe
cutable(GeckoDriverService.java:95)
at org.openqa.selenium.remote.service.DriverService$Builder.build(Driver
Service.java:296)
at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(Firef
oxDriver.java:277)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:2
47)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:2
42)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:1
35)
at jp.vmi.selenium.webdriver.FirefoxDriverFactory.newInstance(FirefoxDri
verFactory.java:173)
at jp.vmi.selenium.webdriver.WebDriverManager$Builder.build(WebDriverMan
ager.java:77)
at jp.vmi.selenium.webdriver.WebDriverManager.get(WebDriverManager.java:
266)
at jp.vmi.selenium.selenese.Main.setupRunner(Main.java:139)
at jp.vmi.selenium.selenese.Main.run(Main.java:82)
at jp.vmi.selenium.selenese.Main.main(Main.java:221)
[2017-01-17 10:34:38.434 +05:30] [INFO] Exit code: 1
Also i have set webdriver.gecko.driver in the system environment variable.
why am I getting this error even after setting the path of gecko driver.
Version:
Gecko driver : geckodriver 0.13.0,
Selenise runner : Selenese Runner 3.0.0
Are you sure the webdriver.gecko.driver System Property is set?
You can pass this as a JVM argument (I had to on Mac since it doesn't really like dots in environment variables):
java -Dwebdriver.gecko.driver=/path/to/geckodriver -jar cmdJars.jar TestCases\TestCase1.html --config config.txt --driver firefox --firefox "C://Program Files/Mozilla Firefox/firefox.exe"
Please make sure -D appears before -jar, as above.