Class
Control

The base object for all controls.

Definition

Namespace:ArtOfTest.WebAii.Controls

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public abstract class Control

Inheritance: objectControl

Derived Classes: HtmlControl

Constructors

Control()

Create new control.

Declaration

cs-api-definition
public Control()

Control(Element)

Create new control and assigns it a base element.

Declaration

cs-api-definition
public Control(Element element)

Parameters

element

Element

The DOM element representing this control.

Properties

BaseElement

Gets the DOM element representing this test control

Declaration

cs-api-definition
public Element BaseElement { get; }

Property Value

Element

IsRefresh

Gets whether the control is executing a Refresh call.

Declaration

cs-api-definition
public bool IsRefresh { get; }

Property Value

bool

Locator

Gets the FindParam that describes this control. The base Control returns null.

Declaration

cs-api-definition
public virtual FindParam Locator { get; }

Property Value

FindParam

Remarks

This property is provided for convenience and can be overriden by custom controls as a place to put and store the FindParam that describes them.

LocatorExpression

Returns the FindExpression for this control. Since this is a abstract base class it always returns null.

Declaration

cs-api-definition
public virtual IFindExpression LocatorExpression { get; }

Property Value

IFindExpression

OwnerBrowser

Gets the owner browser that owns this control.

Declaration

cs-api-definition
public Browser OwnerBrowser { get; }

Property Value

Browser

TelerikComponentsVersion

The Telerik Components version which should be used for creating this control expression

Declaration

cs-api-definition
protected TelerikComponentsVersion TelerikComponentsVersion { get; }

Property Value

TelerikComponentsVersion

ThrowOnInvalidAssignment

Gets whether the control should throw on invalid assignments

Declaration

cs-api-definition
protected bool ThrowOnInvalidAssignment { get; }

Property Value

bool

Methods

AssignElement(Element)

Assign this control a base element. Performs any initialization for this control.

Declaration

cs-api-definition
public virtual void AssignElement(Element e)

Parameters

e

Element

The element to assign.

AssignFailed(Exception)

Mark the assignment to failed. Throw if the framework is set for throwing.

Declaration

cs-api-definition
protected void AssignFailed(Exception exceptionToThrow)

Parameters

exceptionToThrow

Exception

The exception to throw.

GetFamilyElement(int, Element)

Finds the nth parent/child of the specified element.

Declaration

cs-api-definition
public static Element GetFamilyElement(int level, Element e)

Parameters

level

int

Number of levels to move up/down. Negative values move up. Positive values move down.

e

Element

The element to start at.

Returns

Element

A parent/child element or null if an attempt is made to go beyond the ends of the DOM tree.

MatchControl(Element, FindParam)

Given a FindParam this method returns true/false whether this FindParam matches the passed in element.

Declaration

cs-api-definition
public static bool MatchControl(Element element, FindParam paramToMatch)

Parameters

element

Element

The element to match.

paramToMatch

FindParam

The FindParam.

Returns

bool

True/False whether the FindParam matches.

Remarks

For a FindParam to match an element, the following condition must be met: 1. The FindParam.TagName is set, needs to match the element's tagName. 2. If FindParam.Type=Content, then the content as described by FindParam needs to match. 3. The FindParam.Attributes and FindParam.PartialAttributes need to match if any are set. 4. If FindParam.Type=TagIndex/XPath or NodeIndexPath will throw an exception since they do not apply in this scenario since they apply only when matching an element within a full DOM hierarchy not an atomic element matching.

Refresh()

Refresh this control within the current DOM and update this control property values.

Declaration

cs-api-definition
public virtual void Refresh()

SetTelerikComponentsVersion(TelerikComponentsVersion?)

Set the version of the Telerik Components in the application under test

Declaration

cs-api-definition
protected virtual void SetTelerikComponentsVersion(TelerikComponentsVersion? newTelerikComponentsVersion)

Parameters

newTelerikComponentsVersion

TelerikComponentsVersion?

The version of Telerik Components