ClassControl
The base object for all controls.
Definition
Namespace:ArtOfTest.WebAii.Controls
Assembly:ArtOfTest.WebAii.dll
Syntax:
public abstract class Control
Inheritance: objectControl
Derived Classes:
Constructors
Control(Element)
Create new control and assigns it a base element.
Declaration
public Control(Element element)
Parameters
element
The DOM element representing this control.
Properties
BaseElement
Gets the DOM element representing this test control
IsRefresh
Gets whether the control is executing a Refresh call.
Locator
Gets the FindParam that describes this control. The base Control returns null.
Declaration
public virtual FindParam Locator { get; }
Property Value
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
public virtual IFindExpression LocatorExpression { get; }
Property Value
OwnerBrowser
Gets the owner browser that owns this control.
TelerikComponentsVersion
The Telerik Components version which should be used for creating this control expression
Declaration
protected TelerikComponentsVersion TelerikComponentsVersion { get; }
Property Value
ThrowOnInvalidAssignment
Gets whether the control should throw on invalid assignments
Methods
AssignElement(Element)
Assign this control a base element. Performs any initialization for this control.
Declaration
public virtual void AssignElement(Element e)
Parameters
e
The element to assign.
AssignFailed(Exception)
Mark the assignment to failed. Throw if the framework is set for throwing.
Declaration
protected void AssignFailed(Exception exceptionToThrow)
Parameters
exceptionToThrow
The exception to throw.
GetFamilyElement(int, Element)
Finds the nth parent/child of the specified element.
Declaration
public static Element GetFamilyElement(int level, Element e)
Parameters
level
Number of levels to move up/down. Negative values move up. Positive values move down.
e
The element to start at.
Returns
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
public static bool MatchControl(Element element, FindParam paramToMatch)
Parameters
element
The element to match.
paramToMatch
The FindParam.
Returns
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
public virtual void Refresh()
SetTelerikComponentsVersion(TelerikComponentsVersion?)
Set the version of the Telerik Components in the application under test
Declaration
protected virtual void SetTelerikComponentsVersion(TelerikComponentsVersion? newTelerikComponentsVersion)
Parameters
newTelerikComponentsVersion
The version of Telerik Components