The documentation about executing JMeter CLI script isn't clear,
What should be used in CLI? What JVM settings are problematic in each case?
Spec:
jmeter run JMeter (in GUI mode by default). Defines some JVM settings which may not work for all
JVMs.
jmeter.sh very basic JMeter script (You may need to adapt JVM options like memory settings).
Why setenv.sh isn't called in jmeter.sh? why jmeter and jmeter.sh are separated scripts?
You're looking into wrong chapter, the correct one is 1.4 Running JMeter and according to it:
jmeter.sh
very basic JMeter script (You may need to adapt JVM options like memory settings).
jmeter run JMeter (in GUI mode by default). Defines some JVM settings which may not work for all JVMs.
Also it you look at line 19 of the jmeter.sh script you will see something like
## This is a simple wrapper for the script bin/jmeter
which means that you're supposed to use jmeter.sh either as it is or adapting it to your needs (given the nature of your question I wouldn't recommend making any changes however) and it will call jmeter which in its turn call setenv.sh under the hood which in their turn hopefully properly configure and start ApacheJMeter.jar binary file
A little bit more verbose and precise installation and execution instructions set: How to Get Started With JMeter: Installation & Test Plans
Related
About JMeter CLI tests,
If I need only CLI, without any GUI, what minimal files can I use?
Can I keep only bin and lib folders?
Are there jars used only in GUI that can be removed?
Current latest version size is more than 120 MB and I need to lower size to a minimum
If I need only CLI, without any GUI, what minimal files can I use? - depending on what test elements you're using in your test, for example if you're using only HTTP Request samplers you will need ApacheJMeter_http.jar and ApacheJMeter_core.jar (maybe ApacheJMeter_components.jar if you need to use configuration elements, timers, etc.)
So you need to analyze your test and use JMeter Plugins Manager to uninstall the components you don't need, it will reduce space requirements and make your JMeter instance faster.
Can I keep only bin and lib folders? - yes
Are there jars used only in GUI that can be removed? - no, according to TestElement Contract they are not separated
I think the most space consuming is docs folder so if you need offline documentation version you can delete it and JMeter will take twice less disk space
I have a solution where I am running various load test scenarios via the command line for Visual Studio 2017. I know I can use MSTest to do this, and am using /testcontainer arg for picking which .loadtest file, and the Set Test.UseRunSetting= WhateverRunSetting arg to pick which run setting I want (controller duration, context parameters, etc).
I can't seem to find a way to change the Step Load Pattern from command line, however. This would allow me to, from the command line, set things like ramp up time, max users, initial users, and other flags. The other way I can think to do this is if I can say which scenario to run (instead of all scenarios in the .loadtest file) based on a command line arg.
Well, the route I used was to write a Powershell script that accepts the parameters I want, such as initial users, step duration/ramp time, context parameters, max users, etc. Then takes those and edits my .loadtest file (since it's an XML file) and saves the .loadtest with the edits, including setting it as the active run-setting.
Then using MSTest as noted above, I can make sure that run setting and .loadtest is used and kick off my test(s).
Another way to do this is use of plug-ins. You can create a plug-in in your load test. The plug-in will read the external excel or xml file to control the user load. You can modify the excel or xml through automation.
I have same thought as yours for modifying load test files externally. Never thried though.
I'm running JMeter test via cmd and I want to stop the test/shutdown as I do in the GUI mode, but I cannot do it.
I enter the bin folder and double click shutdown.cmd/stoptest.cmd but I keep receiving this error:
Error: Could not find or load main class testing\apache-jmeter-3.0\bin\ApacheJMeter.jar
n.b. There is no folder 'testing' in my path. the path is like this:
C:\Load testing\apache-jmeter-3.0\bin
The majority of developers know only a little bit of SDK of one programming language and suck at everything else, particularly here you are suffering from badly written batch file.
The fastest workaround is renaming your "Load testing" folder into "Loadtesting". Going forward when it comes to Java if possible put the application under the path which doesn't contain whitespaces, non-English characters, special symbols, etc. just in case.
The fix is to surround the path to ApacheJmeter.jar with quotation marks like:
java -cp "%~dp0ApacheJMeter.jar" org.apache.jmeter.util.ShutdownClient Shutdown %*
If possible please report the issue via JMeter bug tracker
In general well-behaved JMeter tests don't need to be shut down, they should end after specified amount of loops or according to Thread Group Scheduler or whatever. If the test last longer than expected it indicates that something went wrong. Make sure you're following steps from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article and your JMeter instance(s) are configured optimally.
Hi what is the main need for setting an Environment Variable, while we have been installing many languages. What's there need? And does the installation cant set(in case of java)? Why so?
Environment variables are set to allow access to command line tools and to enable other tools to interact with SDKs more easily. For example, with Java on Windows, if the environment variable is not set on the PATH, running javac is much more cumbersome because you need to type in the full path to the command each time:
C:> \jdk<version>\bin\javac MyClass.java
In Java setting the environment variables isn't required; it's just easier. Other languages may be more stringent, though I haven't seen any specific examples I could cite. You can read the article How Do I Set the Path System variable? for specifics on how to do this.
The Java installer doesn't change the path variable, but other tools do (Microsoft's own, for example). I assume it's a design decision on the part of Sun/Oracle rather than any particular technical limitation.
In case of JAVA You can run the JDK just fine without setting the PATH variable, or you can optionally set it as a convenience. However, you should set the path variable if you want to be able to run the executables (javac, java, javadoc, and so on) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it.
windows make the Environment variable because of access and organize promotions to users and protection
hope this will h e l p you
Is there a way to make sure that all of the environment variables from MSBuild are propagated to the batch scripts that I am calling from my custom build steps? It would be really nice to use variables like %CONFIGURATION% and %TARGETPATH% in the batch files...
Not OOTB - you'll see lots of cases where chaining of build steps selectively whitelists batches of e.g. 50 parameters.
The problem is that 'properties' ion MSBuild includes variables, input environment variables and much more, which would quickly overflow the OS limits (and sensible maximums) on environment size.
You could whack a pile of SETs together with a WriteLinesToFile and/or invoke a batch file tha has such SET statements.
Another approach, if you're using 4.0 is to use the PowerShell task to create a cusotm script inline and execute it.