ClassDesktopElementContainer
Base class for containers of Desktop elements in the Project.cs file
Definition
Namespace:ArtOfTest.WebAii.TestTemplates
Assembly:ArtOfTest.WebAii.dll
Syntax:
public abstract class DesktopElementContainer : ElementContainer<DesktopElement, DesktopFindExpression>
Inheritance: objectElementContainer<DesktopElement, DesktopFindExpression>DesktopElementContainer
Inherited Members
Constructors
DesktopElementContainer(DesktopFind)
Initializes a new DesktopElementContainer object.
Declaration
public DesktopElementContainer(DesktopFind find)
Parameters
find
The DesktopFind object use when searching for this element in the DOM tree.
Properties
EnsureClickable
Gets and sets whether to ensure elements are in a clickable region of the browser
Find
Gets the Find object scoped to this container.
Methods
Get(DesktopFindExpression)
Find a matching element. Waits the default amount of time for the element to exist.
Declaration
public override DesktopElement Get(DesktopFindExpression expr)
Parameters
expr
The DesktopFindExpression that defines how to find the right element.
Returns
An DesktopElement or null if no matching element found.
Overrides
Get<TControl>(DesktopFindExpression)
Find a matching element in the DOM tree. Waits the default amount of time for the element to exist.
Declaration
public TControl Get<TControl>(DesktopFindExpression expr) where TControl : DesktopControl, new()
Parameters
expr
The DesktopFindExpression that defines how to find the right element.
Returns
TControl
An element of type TControl or null if no matching element found.
Get<TControl>(DesktopFindExpression, bool, int)
Find a matching element in the DOM tree. Waits the default amount of time for the element to exist.
Declaration
public TControl Get<TControl>(DesktopFindExpression expr, bool waitOnElement, int timeout) where TControl : DesktopControl, new()
Parameters
expr
The DesktopFindExpression that defines how to find the right element.
waitOnElement
Whether or not to wait for the element to exist.
timeout
The amount of milliseconds to wait for the element to exist. If waitOnElement is false, this parameter is not used.
Returns
TControl
An element of type TControl or null if no matching element found.
Get<TControl>(params string[])
Find a matching element. Waits the default amount of time for the element to exist.
Declaration
public TControl Get<TControl>(params string[] clauses) where TControl : DesktopControl, new()
Parameters
clauses
string[]
An array of DesktopFindExpression strings to use to find a matching element.
Returns
TControl
An element of type TControl or null if no matching element found.
GetElement(DesktopFindExpression, bool, int)
Find a matching element.
Declaration
protected override DesktopElement GetElement(DesktopFindExpression expr, bool waitOnElement, int timeout)
Parameters
expr
The DesktopFindExpression that defines how to find the right element.
waitOnElement
Whether or not to wait for the element to exist.
timeout
The amount of time to wait for the element to exist.
Returns
An DesktopElement or null if no matching element found.
Overrides
WaitFor(Func<bool>, bool, int, int)
Wait for predicate to become true or timeout to occur.
Declaration
public void WaitFor(Func<bool> predicate, bool stopOnException = false, int delay = 500, int timeout = 2500)
Parameters
predicate
Predicate to wait for.
stopOnException
Stop waiting when predicate throws exception.
delay
Delay in milliseconds before invoking the predicate.
timeout
Operation timeout in milliseconds.
WaitForNot(Func<bool>, bool, int, int)
Wait for predicate to become false or timeout to occur.
Declaration
public void WaitForNot(Func<bool> predicate, bool stopOnException = false, int delay = 500, int timeout = 2500)
Parameters
predicate
Predicate to wait for.
stopOnException
Stop waiting when predicate throws exception.
delay
Delay in milliseconds before invoking the predicate.
timeout
Operation timeout in milliseconds.