Class provides quick search routines for finding an element(s) within a document.
Syntax| C# |
public class Find
Members| All Members | Constructors | Methods | Properties | Fields | Events |
| Icon | Member | Description |
|---|---|---|
![]() | All() | Obsolete.
Find all elements set using FindParamAttributes on method/class.
|
![]() | All(Boolean) | Obsolete.
Find all elements set using FindParamAttributes.
|
![]() | AllByAttributes<(Of TControl>)(String[]()) |
Returns a list of elements that have attributes that match the NameValuePairs passed it
fully or partially.
|
![]() | AllByAttributes(String[]()) |
Returns a list of elements that have attributes that match the NameValuePairs passed it
fully or partially.
|
![]() | AllByContent<(Of TControl>)(String) | |
![]() | AllByContent<(Of TControl>)(String, FindContentType) | |
![]() | AllByContent(String) |
Returns a list of elements that have TextContent that match the specified content
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.
Examples
To find tags with TextContent of: 'foo bar'
Example 1: ByContent("l:foo bar");
Example 2: ByContent("p:foo");
Example 3: ByContent("x:[*foo*]");
Remarks
There is a difference between FindContentType.InnerText and FindContentType.TextContent that is worth noting:
Example: Text1
InnerText for div1 : Text1Text2 {recursive}
TextContent of div1 : Text1 {non-recursive}
Default for ByContent is TextContent which is the most common usage.
Text2 |
![]() | AllByContent(String, FindContentType) |
Returns a list of elements that match the specified content.
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.
Examples
To find tags with TextContent of: 'foo bar'
Example 1: ByContent("l:foo bar");
Example 2: ByContent("p:foo");
Example 3: ByContent("x:[*foo*]");
Remarks
There is a difference between FindContentType.InnerText and FindContentType.TextContent that is worth noting:
Example: Text1
InnerText for div1 : Text1Text2 {recursive}
TextContent of div1 : Text1 {non-recursive}
Default for ByContent is TextContent which is the most common usage.
Text2 |
![]() | AllByCustom<(Of TControl>)(Predicate<(Of TControl>)) |
Returns all controls that match the predicate and are convertable to TControl.
|
![]() | AllByCustom(Predicate<(Of Element>)) |
Return all elements that match the predicate
|
![]() | AllByParam<(Of TControl>)(FindParam) |
Returns a list of elements that match the specified FindParam.
Note that this method does not support FindParam.Type=NodePathIndex.
|
![]() | AllByParam(FindParam) |
Returns a list of elements that match the specified FindParam.
Note that this method does not support FindParam.Type=NodePathIndex.
|
![]() | AllByTagName<(Of TControl>)(String) |
Returns a list of elements with a specific tag name as a control collection.
|
![]() | AllByTagName(String) |
Returns a list of elements with a specific tag name.
|
![]() | AllByXPath<(Of TControl>)(String) |
Returns a list of elements that match the specified XPath. This function supports
the System.Xml XPath syntax.
|
![]() | AllByXPath(String) |
Returns a list of elements that match the specified XPath. This function supports
the System.Xml XPath syntax.
|
![]() | AllControls<(Of TControl>)() |
Gets an IEnmerable for TControl to be used for LINQ queries.
This will return only elements that are convertable to TControl
|
![]() | AllElements() |
Gets a IEnumerable for all elements to be used for LINQ queries
|
![]() | AssociatedBrowser |
Gets the browser object that is associated with this find object.
If this property is null, then the Find object is associated with a search region.
|
![]() ![]() | BuildBestFitFindParam(Element) |
Generates a FindParam[] list to be used to find the specified element.
The function uses an algorithm optimized for most reliable search methods
and will revert back to using the tagname index as a last resort
|
![]() | ByAttributes<(Of TControl>)(String[]()) |
Same as ByAttributes(). Returns a control type instead of element.
|
![]() | ByAttributes(String[]()) |
Returns a an element that has attributes that match the NameValuePairs passed it.
All matching is case-insensitive.
|
![]() | ByContent<(Of TControl>)(String) |
Same as ByContent(). Returns a control type instead of element.
|
![]() | ByContent<(Of TControl>)(String, FindContentType) |
Same as ByContent(). Returns a control type instead of element.
|
![]() | ByContent<(Of TControl>)(String, FindContentType, String[]()) |
Same as ByContent(). Returns a control type instead of element.
|
![]() | ByContent(String) |
Returns an element by searching its TextContent.
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.
Examples
To find tags with innerText content is: 'foo bar'
Example 1: ByContent("l:foo bar");
Example 2: ByContent("p:foo");
Example 3: ByContent("x:[*foo*]");
|
![]() | ByContent(String, FindContentType) |
Returns an element by searching its content with the options to pick the
content type. (InnerText, InnerMarkup or OuterMarkup)
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.
Examples
Similar to Find.ByContent(string) with the option to
specify the content type:
Example 1: ByContent("l:foo bar",FindContentType.InnerText);
Example 2: ByContent("p:<foo id="f" />",FindContent.OuterMarkup);
Remarks
There is a difference between FindContentType.InnerText and FindContentType.TextContent that is worth noting:
Example: Text1
InnerText for div1 : Text1Text2 {recursive}
TextContent of div1 : Text1 {non-recursive}
Default for ByContent is TextContent which is the most common usage.
Text2 |
![]() | ByContent(String, FindContentType, String[]()) |
Returns an element by searching its content with the options to pick the
content type. (InnerText, InnerMarkup or OuterMarkup) in addition to a list
of attributes.
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.
Examples
Similar to Find.ByContent(string) with the option to
specify the content type:
Example 1: ByContent("l:foo bar",FindContentType.InnerText);
Example 2: ByContent("p:<foo id="f" />",FindContent.OuterMarkup);
Remarks
There is a difference between FindContentType.InnerText and FindContentType.TextContent that is worth noting:
Example: Text1
InnerText for div1 : Text1Text2 {recursive}
TextContent of div1 : Text1 {non-recursive}
Default for ByContent is TextContent which is the most common usage.
Text2 |
![]() | ByCustom<(Of TControl>)(Predicate<(Of TControl>)) |
Get a control by using custom predicate. This function will try to eliminate any elements
that are not convertable to TControl type.
|
![]() | ByCustom(Predicate<(Of Element>)) |
Return the element that matches the defined predicate
|
![]() | ById<(Of TControl>)(String) |
Same as ById(). Returns a control type instead of element.
|
![]() | ById(String) |
Returns an element by looking for its 'id' attribute value.
|
![]() | ByName<(Of TControl>)(String) |
Same as ByName(). Returns a control type instead of element.
|
![]() | ByName(String) |
Returns an element by searching for its 'name' attribute value
|
![]() | ByNodeIndexPath<(Of TControl>)(String) |
Same as ByNodexIndexPath(). Returns a control type instead of element.
|
![]() | ByNodeIndexPath(String) |
Returns an element by searching for it using a node index path.
Examples
For example: This call: ByNodeIndexPath("0/2/0/1") describes the <target></target> element in the below hierarchy: <referenceElement> (0)<foo> <bar> </bar> <car> </car> (2)<bus> (0)<driver> <cap> </cap> (1)<target> </target> </driver> </bus> </foo> </referenceElement> |
![]() | ByParam<(Of TControl>)(FindParam) |
Same as ByParam(). Returns a control type instead of element.
|
![]() | ByParam<(Of TControl>)(FindParam[]()) |
Same as ByParam(). Returns a control type instead of element.
|
![]() | ByParam(FindParam) |
Return an element using a FindParam
|
![]() | ByParam(FindParam[]()) |
Returns an element using a chained identification.
|
![]() | ByTagIndex<(Of TControl>)(String, Int32) |
Same as ByTagIndex(). Returns a control type instead of element.
|
![]() | ByTagIndex(String, Int32) |
Returns an element by its tag name occrrence.
|
![]() | ByXPath<(Of TControl>)(String) |
Same as ByXPath(). Returns a control type instead of element.
|
![]() | ByXPath(String) |
Returns an element using an XPath. This function supports
the System.Xml XPath syntax.
|
![]() | Elements | Obsolete.
Found elements from FindParam attributes set on the class or method.
If the Find.All() method has not been called, then accessing this dictionary will call Find.All()
before returning the dictionary items.
|
![]() | Equals(Object) | (Inherited from Object.) |
![]() | Finalize() | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
![]() | FindReferenceType |
Gets the reference type that this Find object is using. (i.e. browser root, testregion ... etc)
|
![]() | FromCollection(FindParamCollection) |
Finds all elements with the FindParams in the passed in collection.
|
![]() | FromFile(String) |
Finds all elements with FindParams defined in a file. Found elements can be accessed from Find.Elements
|
![]() | FromXml(String) |
Finds all elements with FindParams defined in the serialized xml string.
Found elements can be accessed from Find.Elements
|
![]() | GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType() | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IgnoreFindAllControlMismatch |
Gets/Sets whether to ignore Find.Allxx<TControl>(...) elements
that don't match the TControl specified. (i.e. the TControl type validation fails for
that element). If false, the Find.Allxx method will throw an exception.
|
![]() | LastSearchLog |
Gets the search log for the last find attempt. This log can help diagnose when
find fails to locate an element.
|
![]() | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ReturnedNullOrEmpty |
Invoked when one of the find methods returns null or an empty list of elements.
|
![]() | SearchRegion |
Gets the search region for this Find object. When this is set to a specific region, all search is done locale
to that region. All indexes are calculated starting at zero from this region's element.
If this property is null, then the Find object will perform all searches from the document
root element.
|
![]() | SearchRootElement |
Gets/Sets the root element that all searches will be performed under.
This element depended on the reference type. [Browser/TestRegion/Element].
|
![]() | ThrowIfNullOrEmpty |
Gets/Sets whether to throw an exception if any of the find methods returns a null element or any of
the find all methods return empty list of elements.
|
![]() | ToString() | (Inherited from Object.) |
Assembly: ArtOfTest.WebAii (Module: ArtOfTest.WebAii)






