Partager via


ExtractHiddenFields Class

Extracts all hidden fields from the response and adds each value to the context.

Inheritance Hierarchy

Object
  Microsoft.VisualStudio.TestTools.WebTesting.ExtractionRule
    Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractHiddenFields

Namespace:  Microsoft.VisualStudio.TestTools.WebTesting.Rules
Assembly:  Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)

Syntax

'Declaration
Public Class ExtractHiddenFields _
    Inherits ExtractionRule
public class ExtractHiddenFields : ExtractionRule
public ref class ExtractHiddenFields : public ExtractionRule
type ExtractHiddenFields =  
    class 
        inherit ExtractionRule 
    end
public class ExtractHiddenFields extends ExtractionRule

The ExtractHiddenFields type exposes the following members.

Constructors

  Name Description
Public method ExtractHiddenFields Initializes a new instance of the ExtractHiddenFields class.

Top

Properties

  Name Description
Public property ContextParameterName Gets or sets the name of the extracted property. (Overrides ExtractionRule.ContextParameterName.)
Public property HtmlDecode Gets or sets a value that indicates whether the extracted value should be HTML decoded before the value is placed in the Web performance test context.
Public property Required Gets or sets a value that indicates whether the extraction rule should fail if the values to be extracted are not found in the response.
Public property RuleDescription Obsolete. This method is no longer used. Use the DisplayNameAttribute on the class to set a description for this rule. (Inherited from ExtractionRule.)
Public property RuleName Obsolete. This method is no longer used. Use the DisplayNameAttribute on the class to set a display name for this rule. (Inherited from ExtractionRule.)

Top

Methods

  Name Description
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method Extract Extracts all hidden fields found in the body of the response and adds the unique hidden fields to the WebTestContext. (Overrides ExtractionRule.Extract(Object, ExtractionEventArgs).)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Remarks

This rule extracts all the hidden form fields from an HTML page and stores them in the context so a subsequent request can use the hidden form field values. Each extracted hidden field will be stored in the context using the following naming convention: $HIDDEN<name>.<HiddenFieldName> where name is the Context Parameter Name set on the ExtractHiddenFields rule. When another ExtractHiddenFields rule uses the same Context Parameter Name, all existing hidden fields using that name will be removed from the context.

Note

This rule is automatically inserted by the Web Test Recorder when it detects that hidden fields are being used. When requests to multiple windows or frames are recorded, the Web Test Recorder will automatically set the Context Parameter Names to different values when necessary. This will allow multiple sets of hidden fields to be in the context at the same time.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.VisualStudio.TestTools.WebTesting.Rules Namespace

Other Resources

Working with Web Tests

Coding a custom extraction rule for a web performance test

[retired] How to: Add an Extraction Rule to a Web Performance Test