如何配置 JMeter 以关闭持续时间并启用某些线程组

问题描述 投票:0回答:1

对于 JMeter,我希望找到一种自动化的方法来测试我的脚本。有时我需要在应用程序及其 API 上验证我的脚本。我有大约 20 个正在访问的端点,我想一一测试它们,而不是一起运行它们。

所以我要问的是:

  • 我应该如何更改属性文件以取消选中持续时间(我只想针对一定数量的迭代运行它)
  • 我应该如何启用和禁用它,以便它在需要时转动包含其他 API 的其他线程组并隔离执行?
  • 我该如何输出结果?

在这种情况下是否也需要使用 powershell 脚本来实现自动化?

jmeter performance-testing
1个回答
0
投票
  1. How should I change the property file to uncheck duration (I just want to run it against a certain amount of iterations).
    您可以将持续时间设置得非常长,当最后一个用户完成最后一次迭代时,您的测试就会完成。

  2. 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 - 线程组不执行

  3. How should I output the results?
    - 这取决于您想要实现的目标,通常人们在命令行非 GUI 模式下运行 JMeter 测试并在测试后生成 HTML 报告仪表板

  4. 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”文件夹中)

更多信息:

© www.soinside.com 2019 - 2024. All rights reserved.