我需要从负载测试插件中获取负载测试的测试迭代次数,其中有一个LoadTest
对象的实例。我已经搜索了LoadTest
对象的属性,并且与通常用于配置负载测试的树视图编辑器相比,感觉有很多缺失。如何从负载测试插件中获取负载测试中的测试迭代次数?
我已经将测试迭代的次数作为Context参数再次定义,并将其传递给我的Web测试,但由于我正在复制数据,因此感觉像是黑客攻击。
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.
};
}
}
请您澄清一下,随着测试的进行,“lastLti”和“lastWti”如何更新。 – AdrianHHH