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, 9028🔥, 0💬
Popular Posts:
How to turn on Chrome WebDriver logging with Selenium Python API? If you want to turn on logging on ...
How to perform UUDecode (Unix-to-Unix Decode)? UUEncode is Unix-to-Unix encoding used on Unix system...
How to generate MAC addresses? To help you to obtain some MAC addresses for testing purpose, FYIcent...
How to validate email address format? In order to help your programming or testing tasks, FYIcenter....
How to convert a date and time to a standard format? Date and time can be displayed in a number of s...