Partager via


ExtractAttributeValue.MatchAttributeName, propriété

Obtient ou définit un nom d'attribut supplémentaire qui doit se trouver dans la balise HTML contenant la valeur d'attribut à extraire. Utilisée conjointement avec MatchAttributeValue.

Espace de noms :  Microsoft.VisualStudio.TestTools.WebTesting.Rules
Assembly :  Microsoft.VisualStudio.QualityTools.WebTestFramework (dans Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)

Syntaxe

'Déclaration
Public Property MatchAttributeName As String
    Get
    Set
public string MatchAttributeName { get; set; }
public:
property String^ MatchAttributeName {
    String^ get ();
    void set (String^ value);
}
member MatchAttributeName : string with get, set
function get MatchAttributeName () : String
function set MatchAttributeName (value : String)

Valeur de propriété

Type : System.String
Nom d'attribut.

Notes

Cette propriété, conjointement avec MatchAttributeValue, fournit des informations supplémentaires pour spécifier l'attribut à extraire.

Considérez le code HTML suivant :

<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" />

Vous voulez extraire l'id de la zone d'entrée Email. Pour ce faire, affectez à la propriété TagName la valeur entrée, et à la propriété AttributeName la valeur id.

Notez que les trois balises du document HTML sont des balises input, qui contiennent un attribut id. Pour extraire l'attribut de la balise appropriée, vous devez fournir des informations supplémentaires. Affectez à la propriété MatchAttributeName la valeur nom et à la propriété MatchAttributeValue la valeur E-mail. À présent, une seule balise répond aux critères spécifiés. L'attribut sera extrait de cette balise.

Sécurité .NET Framework

Voir aussi

Référence

ExtractAttributeValue Classe

Microsoft.VisualStudio.TestTools.WebTesting.Rules, espace de noms