last block in decryption when running the jar file in jmeter - jmeter

I am running my jmeter script.Inside one sampler,i have http request in that sampler's JSR223 Postprocess I run the main method from executable jar file(I convert my java code into runnable jar file and imported this jar file in the jmeter Testplan).When running this postprocessor i face the error "last block incomplete in decryption".But when i run this jar file in cmd or when running the java code in eclipse,everything works fine.

I can only think of different code page for "cmd" and "JSR223"
In general relying on the current operating system code page is not recommended, you should explicitly set the encoding while doing encryption/decryption and specify the charset to use (UTF-8 is a good choice)
If you don't have the possibility to amend the code in the "executable .jar" you can set file.encoding property in JMeter's system.properties file or pass it via -D command-line argument
jmeter -Dfile.encoding=UTF-8 ......
If you don't have the possibility to amend JMeter properties as well you can simulate running the "executble .jar" from "cmd" using OS Process Sampler, something like:

Related

JMeter Summary report shows subsamplers

When I run my test through JMeter Graphic User Interface, Summary report shows my steps, which are Transaction Controllers, just with parent sampler: which is OK for me. But, when I open log file (*.jtl) in Summary report after test run, I see all samplers - parent sampler with subsamplers: How I have to set configuration in such way that, when running test through CLI mode and open log file to see just parent samplers?
Thanks in advance.
It looks JMeter issue, it worth reporting it via JMeter Bugzilla.
In the meantime you can consider the following options:
Add the next line to user.properties file (lives in "bin" folder of your JMeter installation):
jmeter.save.saveservice.subresults=false
this way you will have only "top-level" SampleResults in the .csv file. See Results file configuration related properties to see what else you can amend.
Generate HTML Reporting Dashboard from the .csv file
jmeter -g /path/to/testresults.csv -o /path/to/dashboard
The dashboard will have the summary table without these extra subresults
Use JMeter Plugins Command Line Tool to generate the CSV form of the Summary Report in command-line without having to open JMeter GUI, add Listener, etc
./JMeterPluginsCMD.sh --generate-csv /path/to/summary.csv --input-jtl /path/to/testresults.csv --plugin-type SynthesisReport
in this case summary.csv will be in the format you're looking for.
Both JMeter Plugins Command Line Tool and Synthesis Report can be installed using JMeter Plugins Manager

Build passes but seems JMeter test is not running through Maven CMD command

I am trying to execute my JMeter scripts through Maven. I am using Jmeter 5.3 and I am using below pom.xml.
When I execute it through command prompt mvn verify -Dusers=1 -DrampUp=1 -Dloopcount=1 -Durl=1 -DSmokeDemoTest=1, it shows me the build success message but seems it is not executing my JMeter test script that's why I am not getting JTL report file in target folder. I am attaching command prompt execution screenshot. Could you please suggest and help me out on this issue.
POMXML:
CommandPromptExecution Image:
Your test is running fine, the only problem is that there are 0 samplers executed therefore there are no results.
From your very beautiful screenshot of the pom.xml file it's not very clear how do you define the users property, you should have something like:
<properties>
<users>1</users>
<rampUp>1</rampUp>
<loopcount>1</loopcount>
<url>http://example.com</url>
<suite>foo</suite>
</properties>
in the beginning of your pom.xml file.
Once done the properties will be declared and you will be able to override them via -D command-line argument.
Also make sure to properly reference the properties in JMeter test plan using __P() function
If you will still be experiencing problems check the jmeter.log file(s) under target/jmeter/logs folder for any suspicious entries
More information:
How to create user defined properties in Maven
How to Use the JMeter Maven Plugin

How to configure JNDI properties file in JMeter?

I am trying to run a JMX test to publish JMS messages to ActiveMQ broker from JMeter. If I check the option to use jndi.properties file as below, it does not specifically ask for the path of the file. I want to know how to configure a JNDI properties file in JMeter. Is there a specific place to add the JNDI properties file or how can I provide the path to it?
According to the JMS Publisher documentation
use jndi.properties. Note that the file must be on the classpath - e.g. by updating the user.classpath JMeter property
So if you put the jndi.properties file somewhere to JMeter Classpath JMeter will pick it up.
Another option is setting user.classpath property and include jndi.properties file location there, it can be done in 2 ways:
Add the next line to user.properties file (lives in JMeter's "bin" folder)
user.classpath=/path/to/your/jndi.properties
Pass the property value via -J command-line argument like:
jmeter -Juser.classpath=/path/to/your/jndi.properties -n -t test.jmx -l result.jtl
See Configuring JMeter and Apache JMeter Properties Customization Guide for more information on fine tuning your JMeter instance(s) via setting and overriding properties.

java.io.FileNotFoundException With jmeter testplan while running it from Jenkins-Maven build

I am using File Upload (Post) Rest API in jmeter. file Path in the file upload section I have given as "File name" directly as its in the same folder where jmx file is.
Its working fine in jmeter ui but when running it through Jenkins I am getting file not found Exception.
how ever I am not sure whether I need to update anything in POM file or my jmx file it self to make jenkins find file path.
Current Scenario Jmeter:
jmx file location: xyz/test.jmx
Fie upload location: xyz/abc.file
file path in Jmeter UI(HTTP POST request): abc.file
Result: Working Fine
Current Scenario Jenkins:
jmx file location: xyz/src/test/jmeter/test.jmx
Fie upload location: xyz/src/test/jmeter/abc.file
file path in Jmeter UI(HTTP POST request): abc.file
Result: getting file not found exception
please suggest me solution if any I have already checked many blogs/answers. but none of them result my situation.
Thanks,
Divyang Raval
I believe when JMeter is being run from Maven it tries to look for files under the following folder:
target\jmeter\bin
So the options are in:
use full path instead of relative
copy the file from its original location to target\jmeter\bin folder using i.e. OS Process Sampler from setUp Thread Group
given you don't execute mvn clean copy the file to target\jmeter\bin folder once
The best solution would be using Jenkins Parameterisation, i.e. pass WORKSPACE Jenkins Variable property value to Maven build and access it in JMeter via __P() function

Create multiple jmeter.log files

I am using Jmeter for performance testing and running our tests via Jenkins build server.
We have Jmeter installed on our jenkins box and I am using an Ant build file to launch the jmx file and create the jtl report; which is then evaluated via the Performance plugin in Jenkins.
My problem is that we only have one instance of Jmeter and as such it only creates one jmeter.log file in the /bin directory.
As we will have multiple jobs calling the one Jmeter installation I don't want it, potentially, writing to the same log.
Is there a way of specifying multiple jmeter.log files per plan/job or amending the location?
Thanks for your suggestions. Using a Jmeter Ant Task and have managed to place the log file into the workspace of the jenkins job by the following:
jmeterlogfile="${basedir}/jmeter.log"
This sits within the JMeter tags within the build file.
Without changing .properties file, running jmeter from Windows cmd, simply navigate to bin folder and pass the argument -j[yourLogFileName.log], if you want log entries in a different log file.
C:\apache-jmeter-2.11\bin>jmeter.bat -j myLog.log

Resources