Class
DesktopFind

Contains methods for searching desktop elements.

Definition

Namespace:ArtOfTest.WebAii.DesktopAutomation

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class DesktopFind

Inheritance: objectDesktopFind

Properties

OwnerHost

Returns the host the element.

Declaration

cs-api-definition
public IDesktopAutomationHost OwnerHost { get; }

Property Value

IDesktopAutomationHost

Methods

AllByClassName(string, int, int, int)

Find all desktop elements with particular class name.

Declaration

cs-api-definition
public DesktopElement[] AllByClassName(string className, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

className

string

Element class name.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement[]

Array of DesktopElements that match specified criteria.

AllByControlType(int, int, int, int)

Find all desktop elements of particular control type.

Declaration

cs-api-definition
public DesktopElement[] AllByControlType(int controlType, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

controlType

int

Control type identifier. Use constants from DesktopControlTypeIds for well known controls.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement[]

Array of DesktopElements that match specified criteria.

AllByControlTypeName(string, int, int, int)

Find all desktop elements of particular control type.

Declaration

cs-api-definition
public DesktopElement[] AllByControlTypeName(string controlTypeName, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

controlTypeName

string

Control type name.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement[]

Array of DesktopElements that match specified criteria.

AllByExpression(DesktopFindExpression, int, int, int)

Find all desktop elements that match specific find expression.

Declaration

cs-api-definition
public DesktopElement[] AllByExpression(DesktopFindExpression expression, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

expression

DesktopFindExpression

Find expression that specifies element property values.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement[]

Array of DesktopElements that match specified criteria.

AllByName(string, int, int, int)

Find all desktop elements with particular name.

Declaration

cs-api-definition
public DesktopElement[] AllByName(string name, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

name

string

Element name.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement[]

Array of DesktopElements that match specified criteria.

AllByXPath(string, int, int, int)

Find all desktop elements that match specific xpath.

Declaration

cs-api-definition
public DesktopElement[] AllByXPath(string xPath, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

xPath

string

XPath to match.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement[]

Array of DesktopElements that match specified criteria.

ByAutomationId(string, int, int, int)

Find a desktop element with particular automation id.

Declaration

cs-api-definition
public DesktopElement ByAutomationId(string id, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

id

string

Element automation id.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement

DesktopElement that matches specified criteria. Null if no match is found.

ByClassName(string, int, int, int, int)

Find a desktop element with particular class name.

Declaration

cs-api-definition
public DesktopElement ByClassName(string className, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

className

string

Element class name.

occurrence

int

Element occurrence index. If there is more than one element with specified class name use this parameter to specify which element to get. Index is zero based.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement

DesktopElement that matches specified criteria. Null if no match is found.

ByControlType(int, int, int, int, int)

Find a desktop element of particular control type.

Declaration

cs-api-definition
public DesktopElement ByControlType(int controlType, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

controlType

int

Control type identifier. Use constants from DesktopControlTypeIds for well known controls.

occurrence

int

Element occurrence index. If there is more than one element with specified class name use this parameter to specify which element to get. Index is zero based.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement

DesktopElement that matches specified criteria. Null if no match is found.

ByControlTypeName(string, int, int, int, int)

Find a desktop element of particular control type.

Declaration

cs-api-definition
public DesktopElement ByControlTypeName(string controlTypeName, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

controlTypeName

string

Control type name.

occurrence

int

Element occurrence index. If there is more than one element with specified class name use this parameter to specify which element to get. Index is zero based.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement

DesktopElement that matches specified criteria. Null if no match is found.

ByExpression(DesktopFindExpression, int, int, int)

Find a desktop element matching specific find expression.

Declaration

cs-api-definition
public DesktopElement ByExpression(DesktopFindExpression expression, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

expression

DesktopFindExpression

Find expression that specifies element property values.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement

DesktopElement that matches specified criteria. Null if no match is found.

ByName(string, int, int, int, int)

Find a desktop element with particular name.

Declaration

cs-api-definition
public DesktopElement ByName(string name, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

name

string

Element name.

occurrence

int

Element occurrence index. If there is more than one element with specified name use this parameter to specify which element to get. Index is zero based.

maxDepth

int

Search depth

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement

DesktopElement that matches specified criteria. Null if no match is found.

ByXPath(string, int, int, int)

Find a desktop element matching specific xpath.

Declaration

cs-api-definition
public DesktopElement ByXPath(string xPath, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)

Parameters

xPath

string

XPath to match.

maxDepth

int

Search depth.

maxRetries

int

How many times to repeat the search if element is not found.

retryDelay

int

Delay in ms between search retries.

Returns

DesktopElement

DesktopElement that matches specified criteria. Null if no match is found.