ArtOfTest, Inc. - WebAii 1.1 Automation Infrastructure reference library
Find.ByContent(content, contentType, nameValuePairs) method
Namespaces > ArtOfTest.WebAii.Core > Find > 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
Text2
InnerText for div1 : Text1Text2 {recursive} TextContent of div1 : Text1 {non-recursive} Default for ByContent is TextContent which is the most common usage.
Syntax
C#
public Element ByContent (
	string content,
	FindContentType contentType,
	params string[] nameValuePairs
)
Parameters
content (String)
The content to match.
contentType (FindContentType)
The content type to match.
nameValuePairs (String[]())
The attribute name/value pairs to apply.
Return Value
The found element. The function returns null if no element is found

Assembly: ArtOfTest.WebAii (Module: ArtOfTest.WebAii)