我需要從負載測試插件中獲取負載測試的測試迭代次數,其中有一個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