Class
BaseTreeBuilder<T>

This class builds the a strongly-typed markup elements tree.

Definition

Namespace:ArtOfTest.Common

Assembly:ArtOfTest.WebAii.dll

Type Parameters:

T

Syntax:

cs-api-definition
public abstract class BaseTreeBuilder<T> where T : ITargetElement

Inheritance: objectBaseTreeBuilder<T>

Derived Classes: HtmlTreeBuilder

Properties

DocType

Gets the DOCTYPE element if present in the document. Otherwise null.

Declaration

cs-api-definition
public T DocType { get; }

Property Value

T

RecursiveContainerTags

Gets a list of tags for elements that can contain a host of the same type as the host containing the element.

Declaration

cs-api-definition
protected virtual IEnumerable<string> RecursiveContainerTags { get; }

Property Value

IEnumerable<string>

Root

Gets the root Element node. You can access the tree using this node.

Declaration

cs-api-definition
public T Root { get; }

Property Value

T

Methods

BuildDomTree(string, bool)

Parse and build the Dom. This method will initialize the Root property with the root element of the Dom.

Declaration

cs-api-definition
public T BuildDomTree(string text, bool trimWhiteSpace)

Parameters

text

string

The text to build the tree for

trimWhiteSpace

bool

Whether to trim the white spaces or not in the text between tags.

Returns

T

The root document element.

ClearTree()

Clear tree.

Declaration

cs-api-definition
protected virtual void ClearTree()

CreateNewElement(ParsedElement, IAutomationHost)

Called by the builder when a new element of type T needs to be created.

Declaration

cs-api-definition
public abstract T CreateNewElement(ParsedElement parsedElement, IAutomationHost host)

Parameters

parsedElement

ParsedElement

The parsed element object.

host

IAutomationHost

The automation host object

Returns

T

The elmenet of Type T

StartTagCloses(string, string)

Determines whether to close an open tag with an optional closing tag based on the new tag we're parsing

Declaration

cs-api-definition
protected virtual bool StartTagCloses(string startTag, string stackTag)

Parameters

startTag

string

The start tag we've just started parsing

stackTag

string

The optional-closing tag on top of the stack

Returns

bool

TestRegionDetected(T)

Called by the builder when a TestRegion is detected.

Declaration

cs-api-definition
public abstract void TestRegionDetected(T regionElement)

Parameters

regionElement

T

The test region element.

TrackRecursiveContainer(T)

Track recursive container.

Declaration

cs-api-definition
protected virtual void TrackRecursiveContainer(T container)

Parameters

container

T

The container to track.