我需要从负载测试插件中获取负载测试的测试迭代次数,其中我有一个LoadTest
对象的实例。我搜索了LoadTest
对象的属性,感觉与通常用于配置负载测试的树视图编辑器相比,缺少很多东西。
我已经将测试迭代的数量再次定义为 Context 参数并将其传递给我的 Web 测试,但这感觉像是一个 hack,因为我正在复制数据。
class MyLoadTestPlugin : ILoadTestPlugin
{
private LoadTest loadTest;
public void Initialize(LoadTest test)
{
loadTest = test;
loadTest.TestStarting += (_, e) =>
{
// Get # of Test Iterations in load test here,
// "loadTest" object does not have nearly as
// many properties as it should, compared to
// the tree view editor.
};
}
}