How can I pass a list of values as a parameter to a Visual Studio web performance test or load test plugin?

StackOverflow https://stackoverflow.com/questions/17746081

質問

Want to pass a list of values as a parameter to a Visual Studio web performance test or load test plugin?

Pages such as http://msdn.microsoft.com/en-us/library/ms243191(v=vs.110).aspx explain the basics of how to create a plugin and I have several simple plugins. But there is very little details on how to specify the properties (ie parameters) for the plugin. From examples I have found C# code such as

public class MyPlugin : WebTestPlugin
{
    [System.ComponentModel.DisplayName("Simple string parameter")]
    [System.ComponentModel.Category("The category")]
    [System.ComponentModel.Description("Description of the simple string")]
    [System.ComponentModel.DefaultValue("The default value")]
    public string MySimpleString { get; set; }

The type could be int or bool as well as string. But I would like an array (or list or collection) of strings.

When the Test mix property of a load test is viewed, it is shown as (collection) and when selected an ellipsis appears. Clicking the ellipsis opens an editor for the list of tests. Something similar would be useful.

役に立ちましたか?

解決

Sadly, plugin property values are indeed limited to bool, string and numeric types. This restriction is hard-coded within the Microsoft.VisualStudio.QualityTools.WebTestFramework assembly. There is no way to support other types (well, with one exception) or get any enhanced editor features such as in your Test Mix collection example.

If you want a property to accept a list of strings, for example, the only option is to have a property of type string, and parse the string into a list by splitting on a delimiter. Disappointing, but true.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top