Class
DesktopElementContainer

Base class for containers of Desktop elements in the Project.cs file

Definition

Constructors

DesktopElementContainer(DesktopFind)

Initializes a new DesktopElementContainer object.

Declaration

cs-api-definition
public DesktopElementContainer(DesktopFind find)

Parameters

find

DesktopFind

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

Declaration

cs-api-definition
public bool EnsureClickable { get; set; }

Property Value

bool

Find

Gets the Find object scoped to this container.

Declaration

cs-api-definition
public DesktopFind Find { get; }

Property Value

DesktopFind

Methods

Get(DesktopFindExpression)

Find a matching element. Waits the default amount of time for the element to exist.

Declaration

cs-api-definition
public override DesktopElement Get(DesktopFindExpression expr)

Parameters

expr

DesktopFindExpression

The DesktopFindExpression that defines how to find the right element.

Returns

DesktopElement

An DesktopElement or null if no matching element found.

Overrides ElementContainer<DesktopElement, DesktopFindExpression>.Get(DesktopFindExpression)

Get<TControl>(DesktopFindExpression)

Find a matching element in the DOM tree. Waits the default amount of time for the element to exist.

Declaration

cs-api-definition
public TControl Get<TControl>(DesktopFindExpression expr) where TControl : DesktopControl, new()

Parameters

expr

DesktopFindExpression

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

cs-api-definition
public TControl Get<TControl>(DesktopFindExpression expr, bool waitOnElement, int timeout) where TControl : DesktopControl, new()

Parameters

expr

DesktopFindExpression

The DesktopFindExpression that defines how to find the right element.

waitOnElement

bool

Whether or not to wait for the element to exist.

timeout

int

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

cs-api-definition
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

cs-api-definition
protected override DesktopElement GetElement(DesktopFindExpression expr, bool waitOnElement, int timeout)

Parameters

expr

DesktopFindExpression

The DesktopFindExpression that defines how to find the right element.

waitOnElement

bool

Whether or not to wait for the element to exist.

timeout

int

The amount of time to wait for the element to exist.

Returns

DesktopElement

An DesktopElement or null if no matching element found.

Overrides ElementContainer<DesktopElement, DesktopFindExpression>.GetElement(DesktopFindExpression, bool, int)

WaitFor(Func<bool>, bool, int, int)

Wait for predicate to become true or timeout to occur.

Declaration

cs-api-definition
public void WaitFor(Func<bool> predicate, bool stopOnException = false, int delay = 500, int timeout = 2500)

Parameters

predicate

Func<bool>

Predicate to wait for.

stopOnException

bool

Stop waiting when predicate throws exception.

delay

int

Delay in milliseconds before invoking the predicate.

timeout

int

Operation timeout in milliseconds.

WaitForNot(Func<bool>, bool, int, int)

Wait for predicate to become false or timeout to occur.

Declaration

cs-api-definition
public void WaitForNot(Func<bool> predicate, bool stopOnException = false, int delay = 500, int timeout = 2500)

Parameters

predicate

Func<bool>

Predicate to wait for.

stopOnException

bool

Stop waiting when predicate throws exception.

delay

int

Delay in milliseconds before invoking the predicate.

timeout

int

Operation timeout in milliseconds.