I have a working command using a windows machine like this:
jmeter -g /Users/magnus/Desktop/apache-jmeter-5.1/bin/report_QA/sfm_qa_Oppdater.csv -o /Users/magnus/Desktop/apache-jmeter-5.1/bin/result_QA_oppdate
given I am standing in the directory where JMeter is installed.
However if I run the same command on my Mac I get: jmeter not found
How do I run the same command on a mac using "terminal"
?
If you call jmeter then MacOS is trying to find this binary or script under system PATH, if it is not there - you will get not found error.
So either you need to put "bin" folder of your JMeter installation under your system PATH like:
PATH=/Users/magnus/Desktop/apache-jmeter-5.1/bin:$PATH && export PATH
then you will be able to run it as jmeter
Or change your command to explicitly invoke the jmeter.sh startup script like:
./jmeter -g /Users/magnus/Desktop/apache-jmeter-5.1/bin/report_QA/sfm_qa_Oppdater.csv -o /Users/magnus/Desktop/apache-jmeter-5.1/bin/result_QA_oppdate
this ./ bit is uber important
More information: How to Get Started With JMeter: Installation & Test Plans
And last but not the least, you can install JMeter via Homebrew, the formulae will download the latest JMeter version and put it into your PATH
To run the script in non-GUI mode, you have to just add sh before the same windows non-GUI command.
Go to your bin directory and run like:
sh jmeter -n -t Test.jmx -l Test1.jtl -g test.csv
Related
I use NiFi on Windows 10 machine with installed Linux subsystem (Ubuntu).
My task is to execute bash scripts and commands using NiFi. I tried to use ExecuteProcess and ExecuteStreamCommand with selected commands like simply 'bash' or 'bash ls' for test purposes, but all I got was:
ExecuteProcess[id=4f530725-0171-1000-d1b1-7df587eada7e] /bin/ls:
/bin/ls: cannot execute binary file
If I try to pass basic Windows commands everything is OK.
Is there a way to run bash commands in my case?
I'm not a Windows user but according to the docs, in order to get to the Linux-style commands you have to run Bash.exe, so I'm guessing you'll need to specify -c as an argument followed by the Linux bash command you want to run (as a string), something like:
bash -c "ls"
If I used java -jar /absolute/path/to/ApacheJMeter.jar -t test.jmx, it just start the GUI without the test.jmx
If I used java -jar ./ApacheJMeter.jar -t test.jmx, it will show the GUI with test.jmx opened.
Thanks
If you use the absolute path to the -jar option you'll most likely need to include the absolute path to the test.jmx -t option. E.x. -t /absolute/path/to/test.jmx, unless test.jmx happens to be in the current directory.
you should generally use:
jmeter.sh for unix, linux, macosx
jmeter.bat for windows
I'm trying to get My jmeter test plan to execute in Jenkins. Both jmeter and Jenkins are installed on my local windows machine. I've set up some properties in Jmeter and verified that I can run them from the cmd line successfully with this command: C:\Users\MikeL\Documents\apache-jmeter\bin>jmeter -n -t testApp.jmx -l log.jtl -Jenv=dev -JloopCount=2 Now in Jenkins I've created a new project, create two new parameters and entered the following in "execute shell" based off of exapmples I was able to find on the web.I haven't configured anything else in Jenkins. sh jmeter.sh -n -p user.properties -t C:/Users/MikeL/Documents/apache-jmeter/bin/testApp.jmx -l log.jtl -Jenv=dev -JloopCount=1 suffice to say this script won't build my jmeter test. I recieve this error: Cannot run program "sh" (in directory "C:\Program Files (x86)\Jenkins\workspace\LOS API Regression Tests"): CreateProcess error=2, The system cannot find the file specified
If anybody has any clues I'd be very grateful!
Add this path C:\Users\MikeL\Documents\apache-jmeter\bin to your Environment Variables PATH.
Then Jenkins Build step should be Windows Batch Command
Then the command should be jmeter -n -t testApp.jmx -l log.jtl -Jenv=dev -JloopCount=1
Update:
If you do not want to set the path, just directly give below command as Windows Batch Command.
C:\Users\MikeL\Documents\apache-jmeter\bin\jmeter.bat -n -t C:\Users\MikeL\Documents\apache-jmeter\bin\testApp.jmx -l log.jtl -Jenv=dev -JloopCount=1
Use either Ant/Maven/Gradle to run jmeter tests in the non-gui mode. They can also be integrated with Jenkins
JMeter-Ant
JMeter-Maven
The problem here is cross environment. you need to be running this with windows batch command instead of execute shell. windows wont recognize sh as executable.
C:\Users\MikeL\Documents\apache-jmeter\bin>jmeter -n -t testApp.jmx -l log.jtl -Jenv=dev -JloopCount=2
Run the above in execute windows batch mode
I am trying to download a huge file via curl. As far as I can see it there is some bash script hooked in between to deliver the correct file (in that case a virtual machine that runs IE10):
curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS=10 bash
Due to a wobbly internet connection the download fails constantly so I need a way to resume the download at its current position. I've tried resuming the download like so:
curl -s -C - https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS=10 bash
However, all I get is some MD5 check failed error...am I missing something?
The curl command you're running there doesn't download the VM images. It downloads a bash script called ievms.sh and then pipes the script to bash, which executes it.
Looking at the script, it looks like the file it downloads for IE10 is here:
http://virtualization.modern.ie/vhd/IEKitV1_Final/VirtualBox/OSX/IE10_Win8.zip
I think if you download that file (you could use your browser or curl) and put it in ~/.ievms, and then run the command again, it should see that the file has already been downloaded and finish the installation.
If the partially-downloaded file is already there, then you could resume that download with this command:
curl -L "http://virtualization.modern.ie/vhd/IEKitV1_Final/VirtualBox/OSX/IE10_Win8.zip" \
-C - -o ~/.ievms/IE10_Win8.zip
(Then run the original IEVMs curl command to finish installation.)
I want to use rvm (or rbenv/chruby for that matter) to select different ruby versions from within my Jenkins jobs.
By default, Jenkins will use /bin/sh, which on Ubuntu, is dash.
For this to change, I can add
#!/bin/bash -l
To the top of every single shell execute function everywhere. Seeing as that's a lot of annoying work, I'd like to be able to set that somewhere central.
Using the "Shell executable" configuration setting, I can get it to run bash, adding parameters like '-l' however will fail with
"/bin/bash -l" -xe /tmp/hudson5660076222778817826.sh FATAL:
command execution failed java.io.IOException: Cannot run program
"/bin/bash -l" (in directory
"/home/jenkins/jobs/workspace/rvm-test"): error=2, No such file or
directory
I tried using the rvm plugin for jenkins, but that doesn't even install on the current release version.
Any ideas? :)
You could work around by creating a wrapper around bash:
#!/bin/sh
# for ex.: /usr/local/bin/login-bash
exec /bin/bash -l "$#"
If you want to use the default ruby just use the rvm-shell, which comes with rvm.
Login as the jenkins user and type:
$ which rvm-shell
/home/jenkins/.rvm/bin/rvm-shell
to get the path of the rvm-shell.
Use this path for the "Shell executable" option.