Collections:
Call JMeter Command in Windows Batch
How to call JMeter command in a Windows batch file? I want to create a single batch job to run JMeter command line multiple times.
✍: FYIcenter.com
You can follow this tutorial to create a Windows batch file
to run JMeter command line multiple time.
1. Create a batch file, facebook.bat, with these lines:
echo off set JMETER_BIN=\fyicenter\jmeter\bin\ rem Run test plan with default password \fyicenter\jmeter\bin\jmeter -n -t Facebook-Login-Test-8.jmx rem Run test plan with a given password \fyicenter\jmeter\bin\jmeter -n -t Facebook-Login-Test-8.jmx -J pw=Abcd1234 rem Run test plan with an another password \fyicenter\jmeter\bin\jmeter -n -t Facebook-Login-Test-8.jmx -J pw=facebook
2. Run the batch file, facebook.bat. You see the following:
\fyicenter>facebook.bat \fyicenter>echo off Created the tree successfully using Facebook-Login-Test-8.jmx Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445 summary = 4 in 00:00:20 = 0.2/s Avg: 4799 Min: 3004 Max: 6930 Err: 1 (25.00%) ... end of run
3. Notice that Windows only executed the first JMeter command and then terminated the batch job.
4. Copy the batch file to create the 2nd version, facebook2.bat, to fix the problem by using the "call" command:
echo off set JMETER_BIN=\fyicenter\jmeter\bin\ rem Run test plan with default password call \fyicenter\jmeter\bin\jmeter -n -t Facebook-Login-Test-8.jmx rem Run test plan with a given password call \fyicenter\jmeter\bin\jmeter -n -t Facebook-Login-Test-8.jmx -J pw=Abcd1234 rem Run test plan with an another password call \fyicenter\jmeter\bin\jmeter -n -t Facebook-Login-Test-8.jmx -J pw=facebook
5. Run the second version, facebook2.bat. Now you see all 3 JMeter got executed one after another:
\fyicenter>facebook.bat \fyicenter>echo off Created the tree successfully using Facebook-Login-Test-8.jmx ... Created the tree successfully using Facebook-Login-Test-8.jmx ... Created the tree successfully using Facebook-Login-Test-8.jmx ...
⇒ Pass Windows Environment Variable to JMeter
⇐ Override JMeter Variable from Command Line
2017-12-04, ≈10🔥, 0💬
Popular Posts:
Where to find test data generators? FYIcenter.com has prepared a number of test data generators for ...
How to update hidden input value field value with WebDriver in Python? Normally, a hidden input valu...
How to turn off HTTP response compression in SoapUI? HTTP response compression reduces the data size...
How to generate test credit card numbers? Test credit card numbers are frequently needed in testing ...
How to generate MAC addresses? To help you to obtain some MAC addresses for testing purpose, FYIcent...