【问题标题】:How to set " invocationCount = variable" in TestNG如何在 TestNG 中设置“invocationCount = variable”
【发布时间】:2013-08-30 01:02:45
【问题描述】:

我想在一个套件中处理不同的性能数据。 比如

@Test(invocationCount = 100)
@Test(invocationCount = 200)
@Test( invocationCount = 500)
@Test( invocationCount = 1000)

但我发现没有办法将变量设置为invocationCount。 并且需要复制很多代码才能让invocationCount不一样。

您能帮我了解如何将变量设置为 invocationCount 吗?

【问题讨论】:

    标签: variables dynamic testng


    【解决方案1】:

    如果您想在运行时设置 invocationCount,那么我相信您唯一的选择是 TestNG 侦听器。您可以在测试方法运行之前修改注释。

    http://testng.org/doc/documentation-main.html#testng-listeners

    【讨论】:

      猜你喜欢
      • 2019-12-25
      • 2018-10-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-28
      • 2012-08-11
      • 1970-01-01
      • 2021-12-04
      相关资源
      最近更新 更多