ExtractAttributeValue.MatchAttributeValue 属性

获取或设置另一个特性的值,该值必须能够在包含待提取的特性值的 HTML 标记中找到。 与 MatchAttributeName 结合使用。

命名空间:  Microsoft.VisualStudio.TestTools.WebTesting.Rules
程序集:  Microsoft.VisualStudio.QualityTools.WebTestFramework(在 Microsoft.VisualStudio.QualityTools.WebTestFramework.dll 中)

语法

声明
Public Property MatchAttributeValue As String
    Get
    Set
public string MatchAttributeValue { get; set; }
public:
property String^ MatchAttributeValue {
    String^ get ();
    void set (String^ value);
}
member MatchAttributeValue : string with get, set
function get MatchAttributeValue () : String
function set MatchAttributeValue (value : String)

属性值

类型:System.String
特性值。

备注

此属性与 MatchAttributeName 结合使用,提供有关要提取的特性的更多信息。

请看下面的 HTML:

<input name="Name" type="text" id="TextBox1" size="25" />

<input name="Email" type="text" id="TextBox2" size="25" />

<input name="Password" type="password" id="TextBox3" size="25" />

您希望提取 Email 输入框的 id。 为此,请将 TagName 属性设置为 input,将 AttributeName 属性设置为 id。

请注意,HTML 中的三个标记均为 input 标记,而且都包含 id 特性。 要从正确的标记中提取特性,必须提供更多信息。 将 MatchAttributeName 属性设置为 name,将 MatchAttributeValue 属性设置为 Email。 现在,只有一个标记符合指定的条件,系统将从该标记中提取特性。

.NET Framework 安全性

请参见

参考

ExtractAttributeValue 类

Microsoft.VisualStudio.TestTools.WebTesting.Rules 命名空间