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, 9195🔥, 0💬
Popular Posts:
What are date and time test values? Date and time test values are frequently needed in testing date ...
How to generate test phone numbers for US and Canada? Test phone numbers are frequently needed in te...
How to turn on Chrome WebDriver logging with Selenium Python API? If you want to turn on logging on ...
How to convert IPv4 to IPv6 addresses? In order to help your programming or testing tasks, FYIcenter...
Where to find online test tools? FYIcenter.com has prepared a number of online test tools: Data Look...