permission denied for jmeter.bat while executing jmeter using robotframework - jmeter

while trying to execute jmeter file using robotframework getting below error,
PermissionError: [Errno 13] Permission denied: '/home/sadha/Documents/jmeter.bat'
TC2 jmeter | FAIL |
1 test, 0 passed, 1 failed
I am using Robot Framework JMeter Library for the execution.eventhough i have enabeled read/write permission i am still getting this error,
Below is the robot keyword used for execution,
Run Jmeter /home/sadha/Documents/jmeter.bat /home/sadha/Documents/apache-jmeter-5.4.1/bin/HTTP Request.jmx /home/sadha/Documents/apache-jmeter-5.4.1/logs/log.jtl

You need to call jmeter.sh or jmeter, the .bat file is for Windows
You might also need to make the file executable using chmod command like:
chmod +x /home/sadha/Documents/jmeter.sh
More information:
Apache JMeter - Get Started - CLI Mode
Get Started With JMeter: Installation & Tests

Related

Cannot detect file type because of error: Failed to copy - JENKINS - JMETER (Performance plugin)

I am trying to configure Performance result report in Jenkins. Below is my code for execution:
for the Build:
jmeter -j jmeter.save.saveservice.output_format=xml -n -t C:\Users\Aliaksandra_****\Desktop\JMETER\apache-jmeter-5.4.1_old\apache-jmeter-5.4.1\bin\R.jmx -l C:\Users\Aliaksandra_*****\Desktop\JMETER\apache-jmeter-5.4.1_old\apache-jmeter-5.4.1\bin\R_result_report.jtl
For Performance result report:
C:\Users\Aliaksandra_****\Desktop\JMETER\apache-jmeter-5.4.1_old\apache-jmeter-5.4.1\bin\R_result_report.jtl
After that I can not end the build because I have this ERROR IN JENKINS:
Cannot detect file type because of error: Failed to copy
Can anybody help?
Try using relative paths so the results file will be generated in the Jenkins build workspace like:
jmeter -n -t R.jmx -l R_result_report.jtl
Your Jenkins seems to be running on Linux so I don't think that Windows absolute paths will work so I would suggest to re-consider the way of launching the test and feeding the results to the performance plugin
The correct way of passing properties to JMeter is using capital J without space between J and the property name:
jmeter -Jjmeter.save.saveservice.output_format=xml -n -t ....
More information: How to Use the Jenkins Performance Plugin

Unable to create Dashboard report folder on jenkins

I am able to create a dashboard folder on Local jenkins but same when I am trying to deploy on live jenkins following error I am getting.
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 :Consumer failed with message :Cannot create working directory "temp/latencyVsRequest"
Even My JTL file is properly created but folder is not getting created
Following is the command which I have put in Jenkins Execution shell
cd /mnt/apache-jmeter-5.4/bin
sh jmeter -n -t /mnt/qa/erosnow-auto-test/JMeterAutomation/TestingScript.jmx -l /mnt/qa/erosnow-auto-test/JMeterAutomation/test123.jtl -e -o /mnt/qa/erosnow-auto-test/JMeterAutomation/test123
The message means that the user you're running Jenkins from doesn't have sufficient permissions to create temp/latencyVsRequest folder in your Jenkins workspace, you need to either grant the user the appropriate rights via chown command or change jmeter.reportgenerator.temp_dir property to point to some path where your user has write access.
More information:
Create file in folder: permission denied
JMeter Properties Reference - Reporting Configuration
Apache JMeter Properties Customization Guide

Not able to run jmeter script in non gui mode. It is recorded using blazemeter and running on jmeter 5 version

When Running the JMX script from terminal on MAC IN NON-GUI Mode, it returns an error saying "Could not open"
Below are the things i have tried :
1) jmeter -n -t "ABSOLUTE PATH.jmx" -l ABSOLUTE-PATH for results.jtl
2) Set the jmeter path and tried again.
I get the same error every time.
I don't think you can run the recording using JMeter as BlazeMeter Chrome Extension exports recorded scripts in YAML format suitable for Taurus tool
So you can run it using Taurus tool as
bzt test-Combined-JMeter-and-Selenium.yaml
If you want to convert it to "vanilla" JMeter - execute the following command:
bzt test-Combined-JMeter-and-Selenium.yaml -gui
JMeter GUI will open where you will be able to modify and save generated JMeter script as .jmx file which can be executed using JMeter.

Jmeter Distributed Setup works in GUI but not the command line

I am running Windows 7 Pro with JMeter 4.0 r1823414 on all 5 machines with Java JDK 1.8.0_144 on all of them as well. All paths and ENV Vars are identical across all machines. I set my remote hosts in the master and I am able to see them on the GUI inside the master. I built the rmi_keystore.jks on a slave machine and copied it into the bin folder in every machine. I successfully started all the servers on the slave machines and see the successful attachment of the rmi (running the jmeter-server.bat):
Found ApacheJMeter_core.jar
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xbootclasspath/a:"C:\Program Files
(x86)\HP\Unified Functional Testing\bin\java_shared\classes\jasmine.jar"
Created remote object: UnicastServerRef2 [liveRef: [endpoint:
[<ip:port>,SSLRMIServerSocketFactory(host=<host_name/IP>,
keyStoreLocation=rmi_keystore.jks, type=JKS,
trustStoreLocation=rmi_keystore.jks, type=JKS, alias=rmi),
SSLRMIClientSocketFactory(keyStoreLocation=rmi_keystore.jks, type=JKS,
trustStoreLocation=rmi_keystore.jks, type=JKS, alias=rmi)](local),objID:
[<stuff>:-7fff, <more_stuff>]]]
Running a basic HTTP call I am able to run from the master to all 4 slave machines (individually and all at once) and get results without issue from the GUI. My problem is from the command line. I cannot get the test to run. I have tried:
jmeter -n -t distributed_test_4_slaves.jmx -r -l distributedLog_Test.jtl -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks
jmeter -n -t distributed_test_4_slaves.jmx -r -l distributedLog_Test.jtl
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_names> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_names:ports> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
jmeter -n -t distributed_test_4_slaves.jmx -R <all_my machine_ips(with and without ports)> -l distributedLog_Test.jtl (with and without -Jserver.rmi.ssl.keystore.file=rmi_keystore.jks)
Every time I get the same errors in the command line:
Creating summariser <summary>
Created the tree successfully using distributed_test_4_slaves.jmx
#The next 5 lines repeat for each slave
Configuring remote engine: <slave_1..4>
Exception creating connection to: <slave_1..4>; nested exception is:
java.io.FileNotFoundException: rmi_keystore.jks (The system cannot
find the file specified)
Failed to configure <slave_1..4>
Stopping remote engines
Remote engines have been stopped
Error in NonGUIDriver java.lang.RuntimeException: Following remote
engines could not be configured:[
<slave_1>, <slave_2>, <slave_3>, <slave_4>]
What am I missing? Why would it run and work in the GUI but not on the command line? Something cannot be right.
Make sure that
You either run JMeter from its "bin" folder
Or have rmi_keystore.jks in the folder where you're running JMeter from
as the error clearly states that JMeter tries to load rmi_keystore.jks file and fails
One more thing to try is providing full path to the rmi_keystore.jks file via server.rmi.ssl.keystore.file property.
You can also completely disable secure RMI communication by setting server.rmi.ssl.disable property to true
Normally jmeter.log file should contain the root cause of the issue, if it doesn't or not very informative - you can increase JMeter log verbosity for selected clas(ses) or package(s).

JMeter - Error when starting test plan- keytool error: proxysever.jks (access is denied)

I am following JMeter User guide to start recording my first test plan. When I click the Start button in HTTP Test Script Recorder, I got this error:
Could not create script recorder – see log for details >> keytool error:java.io.FileNotFoundException: proxyserver.jks (Access is denied)
How could I fix this error? Thanks in advance.
Background: JMeter creates a self-signed SSL certificate in order to be able to decrypt and record HTTPS requests, this proxyserver.jks is a Java Keystore which is being generated by JMeter in its "bin" folder when you start HTTP(S) Test Script Recorder proxy
Explanation: The error you are getting most probably indicates that you don't have permissions to write anything into the "bin" folder of your JMeter installation
Workarounds:
You can try launching JMeter with elevated rights (run as administrator or superuser or whoever having write access to JMeter's "bin" folder
You can change the location where JMeter tries to generate this proxyserver.jks file by adding the next line to user.properties file:
proxy.cert.directory=/path/to/folder/where/you/have/write/access
JMeter restart will be required to pick the property up.
Another option is passing the property value via -J command-line argument like
jmeter -Jproxy.cert.directory=/path/to/folder/where/you/have/write/access -n -t ....
Check out Apache JMeter Properties Customization Guide for more information regarding JMeter properties and ways of setting and overriding them
One workaround that worked for me was to start JMeter.bat from bin folder from cmd which was "run as administrator". After this, the error was gone.

Resources