I have set up Jmeter on a server for remote testing but I, however, do not know how/where to configure jmeter-server to look for the .jmx file constituting my test plan.
I have replaced the file paths tothe resource file (i.e. the various CSV files I referenced locally) in the jmx file.
I'm working with Jmeter version 5.4.1 and also used this guide in setting up the server.
The .jmx script is being transferred automatically from the master to the slave machine(s), you don't need to worry about it. The only thing to remember is that if you're using any JMeter Plugins - you need to install them on the slave machine(s)
If you use relative paths to CSV files - on the slave they will be relative to the folder where you launch jmeter-server script from. Normally people launch JMeter from "bin" folder so it makes sense to use file paths relative to JMeter's "bin" folder.
Another approach is to use "central" location for the test data like Redis Data Set or HTTP Simple Table Server, this way you won't have to copy the test data to the slaves.
Related
I want to create a JMeter setenv.bat that contains environmental variables such as set JMETER_HOME=xx
I want to just type 'jmeter' anywhere on the Terminal CL in any directory to start jmeter, could this done ?
I have used a symbolic link but setenv.bat file must be a better way.
Any example would be appreciated.
In order to be able to launch JMeter from any place you need to add "bin" folder of your JMeter installation to your operating system PATH
For Windows it can be done via setx command like:
setx PATH=%PATH%;c:\jmeter\bin
replace c:\jmeter\bin with the actual path to your JMeter's bin folder.
In the same shell or after next login you will be able to type jmeter and it will run JMeter GUI.
More information: Get Started With JMeter: Installation & Tests
I'm trying to set up distributed test in Jmeter however whenever I tried to run the "create-rmi-keystore.bat" file in bin folder doesn't seem to work.. It's not opening...Can someone enlighten me what should be the problem and solution.
Nobody can "enlighten" you about the solution unless you run this command in the terminal and share the output with us, the possible reasons are:
You already have rmi_keystore.jks file in the "bin" folder of your JMeter installation
You don't have keytool program in your operating system PATH
I also believe that 99.99999% of users don't need secure communication between JMeter master and slaves as it doesn't add any value and just consuming valuable resources, so I tend to disable secure RMI communication when I run JMeter tests in distributed mode.
Add the next line to user.properties file (lives in "bin" folder of your JMeter installation)
server.rmi.ssl.disable=true
Restart JMeter to pick the property up
Repeat it for all machines which are involved in distributed test
That's it, you don't need this rmi-keystore.jks anymore
References:
Remote hosts and RMI configuration
JMeter Distributed Testing with Docker
Remote Testing
On Unix system use create-rmi-keystore.sh script instead
for Windows systems (called bin/create-rmi-keystore.bat) and Unix like systems (called bin/create-rmi-keystore.sh)
$ ./create-rmi-keystore.sh
I have Jmeter installed with homebrew. I have a text plan that has been working fine and which I saved before rebooting. Upon rebooting my machine and reloading the test plan, I keep getting "File not found exceptions" even though everything is in the same location and nothing about the test plan has changed.
How do I make jmeter go to a specific directory and look for a file? Help.
Your text file should be in the same directory from where you have launched your JMeter.
Given you installed via Homebrew JMeter's working directory depends on where you launch JMeter from. You can check it in i.e. jmeter.log file
2016/05/09 06:40:50 INFO - jmeter.JMeter: user.dir =/private/tmp
2016/05/09 06:40:50 INFO - jmeter.JMeter: PWD =/private/tmp
So you have 3 options:
Start Jmeter from the folder where files live
Move files to the folder where JMeter is running from now
The best one: use full paths instead of relative. Actually this is what is recommended in Performance testing: Upload and Download Scenarios with Apache JMeter article.
I am working on setting up a load balancing cluster on windows server 2012 and have a shared drive where I want the configuration files for Apache to exist at. This way each member of the LB can load the exact same config files. How do I change where the config file is located independently of where the ServerRoot is?
Start the Apache process with the -d parameter and give your alternative ServerRoot as an argument, though I'd imagine it would be a much better idea for you to use some mechanism to sync the files locally to each server.
Also read http://httpd.apache.org/docs/2.4/mod/core.html#mutex, as it's advised if you're running from a networked file system.
If you just want to specify the main config file, start the process with the -f parameter and the path to the config file as an argument.
I've created a test plan to do some load testing against HTTP endpoints. I want to run the same test plan against multiple endpoints, and find myself having to do the following each time:
Change variable that determines which endpoint I'm hitting.
Run the test.
When complete, record results.
Clear all results.
Back to step 1.
I want to automate this. Is the following possible?
Define a list of endpoints as a variable.
For each endpoint in endpoints
Run test against endpoint
When complete, save results
Clear all results.
The things in particular that I don't know how to automate are:
Starting a test
Defining an list-style variable
Clearing all results
Any help would be greatly appreciated!
Please see answers below:
Starting a test
Apart from running JMeter from GUI there are several execution options such as:
Command line non-GUI mode - you can wrap JMeter execution line in operating system batch file
JMeter Ant Task - integration with Apache Ant build system, more powerful if you're comfortable with it
JMeter Maven Plugin - the same as Ant but for Apache Maven
Option to run JMeter with CI systems like Jenkins
Defining an list-style variable
JMeter offers "properties" which can be set via .properties files (see user.properties in /bin folder of your JMeter installation for example) or passed as name/value pairs to JMeter startup script. For instance instead of hard-coding your host in .jmx file you can use read a property function.
Set "Server Name or IP" field value to ${__P(myhost,)}
Add myhost=example.com line to user.properties file in /bin folder of your JMeter installation, restart JMeter and run the test. Request will go to example.com.
Alternatively you can pass myhost property to JMeter in command-line mode as follows
jmeter -Jmyhost=example.com
Multiple properties can be passed this way:
jmeter -Jproperty1=value1 -Jproperty2=value2 ....
And even files via -p or --propfile JMeter command line argument
See Apache JMeter Properties Customization Guide for more options and information.
Clearing all results
It depends on unattended execution option you'll choose, all of them provide at least one way to delete file and/or folder. Personally I wouldn't delete any results and would rather keep them for future reference. To distinguish different endpoints test runs and to avoid overwriting I would use timestamps like:
jmeter -Jhttp.endpoint=my.test.host -n -t your-script.jmx -l my-test-host-results-${date}.jtl
where
-J - sets endpoint to my.test.host
-n - tells JMeter to run in non-GUI mode
-t - specifies .jmx file to use
-l - specifies name and location of results file