ExtractText Class
Extracts text from the HtmlDocument that is based on delimiting start/end strings, matching regular expressions, and the occurrence of the text. The extracted text is added to the WebTestContext.
Inheritance Hierarchy
System.Object
Microsoft.VisualStudio.TestTools.WebTesting.ExtractionRule
Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractText
Namespace: Microsoft.VisualStudio.TestTools.WebTesting.Rules
Assembly: Microsoft.VisualStudio.QualityTools.WebTestFramework (in Microsoft.VisualStudio.QualityTools.WebTestFramework.dll)
Syntax
'Declaration
Public Class ExtractText _
Inherits ExtractionRule
public class ExtractText : ExtractionRule
public ref class ExtractText : public ExtractionRule
type ExtractText =
class
inherit ExtractionRule
end
public class ExtractText extends ExtractionRule
The ExtractText type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ExtractText | Initializes a new instance of the ExtractText class. |
Top
Properties
Name | Description | |
---|---|---|
ContextParameterName | Gets or sets the context name of the extracted property. (Inherited from ExtractionRule.) | |
EndsWith | Gets or sets a value that represents the string that delimits the end of the string to extract. | |
ExtractRandomMatch | Indicates whether the extracted value is chosen randomly from all matches in the HtmlDocument. | |
HtmlDecode | Gets or sets a value that indicates whether the extracted value should be HTML decoded before the value is put into the Web performance test context. | |
IgnoreCase | Gets or sets a value that indicates whether matching is case-sensitive. | |
Index | Gets or sets the zero-based index of the string to match. | |
Required | Gets or sets a value that indicates whether the request fails if the search text is not found. | |
RuleDescription | Obsolete. This method is no longer used. Use the DisplayNameAttribute on the class to set a description for this rule. (Inherited from ExtractionRule.) | |
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.) | |
StartsWith | Gets or sets a value that represents the string that delimits the start of the string to extract. | |
UseRegularExpression | Gets or sets a value that indicates whether the search strings are regular expressions. |
Top
Methods
Name | Description | |
---|---|---|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Extract | Finds the text that is delimited by the StartsWith and EndsWith properties and adds the text to the WebTestContext. (Overrides ExtractionRule.Extract(Object, ExtractionEventArgs).) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Remarks
By default, the first occurrence is returned. This will extract any string that is contained in the response body, including any HTML tags.
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
How to: Create a Custom Extraction Rule for a Web Performance Test