ClassFindParam
A class that defines how a search for an element should be conducted within a document.
Definition
Namespace:ArtOfTest.WebAii.ObjectModel
Assembly:ArtOfTest.WebAii.dll
Syntax:
[Obsolete("FindParam will be removed in next release. Please use HtmlFindExpression or XamlFindExpressions instead. FindParam.ToFindExpression() can help you convert your current FindParams to FindExpressions")]
public class FindParam : INotifyPropertyChanged, IFindParam
Inheritance: objectFindParam
Implements:
Constructors
FindParam(FindType, string, params string[])
Create a new FindParam by explicitly specifying the FindType.
Declaration
public FindParam(FindType type, string value, params string[] attributesNameValuePairs)
Parameters
type
The find type.
value
The value signifies the following depending on the type: Type=AttributesOnly:Value=(string.empty|tagName [When tagName is set, will match tagName in addition to attributes]),Type=NodeIndexPath:Value=(index path [i.e. "0/3/2/0"]), Type=XPath:Value=(xpath to use),Type=Content:Value=(content to use [i.e. "p:string"]) - default is FindContentType.TextContent, Type=TagIndex:Value(tagName:tagIndex [i.e. "input:3"])
attributesNameValuePairs
string[]
The attributes list, if any, else string.Empty.
FindParam(HtmlFindExpression)
Create a new find param of type.
Declaration
public FindParam(HtmlFindExpression expression)
Parameters
expression
FindParam(params int[])
Create a new find parameter of Type=NodeIndexPath
Declaration
public FindParam(params int[] nodesIndexPath)
Parameters
nodesIndexPath
int[]
The index path of the desired node
FindParam(params string[])
Create a new find parameter using name-value pairs of attributes.
Declaration
public FindParam(params string[] attributesNameValuePairs)
Parameters
attributesNameValuePairs
string[]
The name value pairs. Example ("id=foo","style=color:red").
Use '=' to indicate partial values.
FindParam(string, int)
Create a new find parameter of Type=TagIndex
FindParam(string, int, params string[])
Create a new find parameter of Type=TagIndex with additional attributes to use to find the element or verify it.
Declaration
public FindParam(string tagName, int occurrenceIndex, params string[] attributesNameValuePairs)
Parameters
tagName
The TagName to search for.
occurrenceIndex
The occurrence index of the tag (Zero-Based).
attributesNameValuePairs
string[]
Any additional attributes to check for; both exact or partial
Properties
Attributes
Gets/Sets the list of Attributes to use for identification.
Declaration
[Browsable(false)]
public Collection<iAttribute> Attributes { get; set; }
Property Value
Constraints
Gets or sets a constraint for this FindParam
Declaration
[Browsable(false)]
public FindParamConstraint[] Constraints { get; set; }
Property Value
ContentType
Gets/Sets the content type when the identification type is Content. (Default:TextContent)
Declaration
public FindContentType ContentType { get; set; }
Property Value
ContentValue
Gets/Sets the content value to find when type is Content. This can be a string to validate against or a regular expression. The content must start with: 'l:' for exact match strings, 'p:' for partial strings or 'x:' for regular expression matches. If none are provided the string will be matched using an exact match 'l:'. All searches are case-insensitive.
ExcludedAttributes
Gets/Sets the list of attribute to exclude for identification.
Declaration
[Browsable(false)]
public Collection<iAttribute> ExcludedAttributes { get; set; }
Property Value
Expression
The HtmlFindExpression used if Type=Expression.
Declaration
[Browsable(false)]
public HtmlFindExpression Expression { get; set; }
Property Value
NodeIndexPath
Gets/Sets Hierarchal path from the reference element when Type=NodeIndexPath.
Declaration
[Browsable(false)]
public string NodeIndexPath { get; set; }
Property Value
PartialAttributes
Gets/Sets the partial attribute values to use for identification.
Declaration
[Browsable(false)]
public Collection<iAttribute> PartialAttributes { get; set; }
Property Value
SearchAttributes
List of (partial & exact) attributes to use for identification.
TagIndex
Gets/Sets tagName occurrence index when Type=TagIndex
TagName
Gets/Sets the tagName of the element this parameter identifies.
Type
Gets/Sets the identification type to use to identify this element. (Default:TagIndex)
Methods
LoadFromFile(string)
Load a FindParam from a file.
LoadFromXml(string)
Load a FindParam from an xml persisted string.
NewExpr(params string[])
Create a FindParam object from an expression.
Save(string)
Serializes and saves the current FindParam to a file. You can later load that file using FindParam.Load().
Declaration
public void Save(string fileName)
Parameters
fileName
The file name to save to.
SetAttributes(params string[])
Used to initialize a list of parameter value pairs on a FindParam.
SetContent(FindContentType, string)
Sets the content type and returns the updated FindParam.
Declaration
public FindParam SetContent(FindContentType contentType, string contentValue)
Parameters
contentType
The content type.
contentValue
The content.
Returns
The modified FindParam
SetTagName(string)
Sets the tag name and returns the updated FindParam.
ToString()
String representation of the FindParam.
Declaration
public override string ToString()
Returns
The string representation.
Overrides
Events
PropertyChanged
Occurs when a property changes on this FindParam object.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements