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, 8734🔥, 0💬
Popular Posts:
How to find out my browser request headers? To help you to see your browser request headers, FYIcent...
How to valid IP addresses? In order to help your programming or testing tasks, FYIcenter.com has des...
Where to find online test tools? FYIcenter.com has prepared a number of online test tools: Data Look...
How to generate user full names? Test user names are frequently needed in testing applications that ...
How to update hidden input value field value with WebDriver in Python? Normally, a hidden input valu...