对于 JMeter,我希望找到一种自动化的方法来测试我的脚本。有时我需要在应用程序及其 API 上验证我的脚本。我有大约 20 个正在访问的端点,我想一一测试它们,而不是一起运行它们。
所以我要问的是:
在这种情况下是否也需要使用 powershell 脚本来实现自动化?
How should I change the property file to uncheck duration (I just want to run it against a certain amount of iterations).
您可以将持续时间设置得非常长,当最后一个用户完成最后一次迭代时,您的测试就会完成。
How should I enable and disable it so that it turns the other thread groups that contain the other APIs and executes in isolation when needed?
您可以使用__P()函数来设置用户数量。如果用户数为0 - 线程组不执行
How should I output the results?
- 这取决于您想要实现的目标,通常人们在命令行非 GUI 模式下运行 JMeter 测试并在测试后生成 HTML 报告仪表板
Would a powershell script need to be used in this case to automate it as well?
- 如果您想动态设置 JMeter 属性,您可以使用 -J
命令行参数来设置/覆盖值
jmeter.bat -Jproperty1=value1 -Jproperty2=valuea -n -t test.jmx -f -l result.jtl -e -o /path/to/dashboard
默认值可以放在 user.properties 文件中(位于 JMeter 安装的“bin”文件夹中)
更多信息: