我正在使用窗口bat文件在命令行模式下启动JMeter,运行测试并打印一些结果。我的bat文件不等待jmeter完成,所以它正在打印空结果。有什么方法可以等待JMeter首先完成吗?
我的蝙蝠文件:
print("Hi {},\nYou have a {}% in your {} course".format(student_name, average_score_for_course, course_name))
正在运行的文件输出:
@echo off
setlocal
set "CURRENT_DIR=%cd%"
if not "%JMETER_HOME%" == "" goto gotHome
set "JMETER_HOME=%CURRENT_DIR%"
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
cd ..
set "JMETER_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome
if exist "%JMETER_HOME%\bin\jmeter.bat" goto okHome
echo The JMETER_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
break>jmeter.log
SET /P "TestFile=Test File:" || SET "TestFile=MyTestFile.txt"
echo Running test %TestFile%
start /B %JMETER_HOME%/bin/jmeter -n -t GenericTest.jmx -JTestDir="%cd%" -JTestFile="%TestFile%"
echo Test Finished, Printing Result
type result.txt
:end
pause
如何等待JMeter完成?