WebElementPatterncontentText Property |
The text the sought-for object contains (including the text of child elements). By default, TestLeft searches for the exact match. To mark variable parts, use wildcards (* or ?) or specify regular expressions (regexp:...).
Namespace:
SmartBear.TestLeft.TestObjects.Web
Assembly:
SmartBear.TestLeft (in SmartBear.TestLeft.dll) Version: 14.70.237.11 (14.70.237.11)
Syntax public string contentText { get; set; }
Public Property contentText As String
Get
Set
Dim instance As WebElementPattern
Dim value As String
value = instance.contentText
instance.contentText = value
public:
property String^ contentText {
String^ get ();
void set (String^ value);
}
Property Value
Type:
StringRemarks
The resulting string contains the combined text contents of the object and of all of its child objects. This text includes visible elements as well as hidden ones, that is, the elements with
style.display="none" or
style.visibility="hidden".
TestLeft generates the contentText property value in the following way:
- The test engine analyzes the cell's DOM child nodes and finds all text nodes among them (that is, nodes with nodeName equal to #text).
- For each text node, TestLeft gets the node's nodeValue property, trims whitespaces at the beginning and at the end of the value and replaces subsequent spaces, tabs, non-breaking spaces and line breaks with a single space.
- Adds a line feed character to the end each value.
See Also