ClassDesktopFind
Contains methods for searching desktop elements.
Definition
Namespace:ArtOfTest.WebAii.DesktopAutomation
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class DesktopFind
Inheritance: objectDesktopFind
Properties
OwnerHost
Returns the host the element.
Declaration
public IDesktopAutomationHost OwnerHost { get; }
Property Value
Methods
AllByClassName(string, int, int, int)
Find all desktop elements with particular class name.
Declaration
public DesktopElement[] AllByClassName(string className, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
className
Element class name.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
Array of DesktopElements that match specified criteria.
AllByControlType(int, int, int, int)
Find all desktop elements of particular control type.
Declaration
public DesktopElement[] AllByControlType(int controlType, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
controlType
Control type identifier. Use constants from DesktopControlTypeIds for well known controls.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
Array of DesktopElements that match specified criteria.
AllByControlTypeName(string, int, int, int)
Find all desktop elements of particular control type.
Declaration
public DesktopElement[] AllByControlTypeName(string controlTypeName, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
controlTypeName
Control type name.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
Array of DesktopElements that match specified criteria.
AllByExpression(DesktopFindExpression, int, int, int)
Find all desktop elements that match specific find expression.
Declaration
public DesktopElement[] AllByExpression(DesktopFindExpression expression, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
expression
Find expression that specifies element property values.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
Array of DesktopElements that match specified criteria.
AllByName(string, int, int, int)
Find all desktop elements with particular name.
Declaration
public DesktopElement[] AllByName(string name, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
name
Element name.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
Array of DesktopElements that match specified criteria.
AllByXPath(string, int, int, int)
Find all desktop elements that match specific xpath.
Declaration
public DesktopElement[] AllByXPath(string xPath, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
xPath
XPath to match.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
Array of DesktopElements that match specified criteria.
ByAutomationId(string, int, int, int)
Find a desktop element with particular automation id.
Declaration
public DesktopElement ByAutomationId(string id, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
id
Element automation id.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
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
public DesktopElement ByClassName(string className, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
className
Element class name.
occurrence
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
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
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
public DesktopElement ByControlType(int controlType, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
controlType
Control type identifier. Use constants from DesktopControlTypeIds for well known controls.
occurrence
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
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
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
public DesktopElement ByControlTypeName(string controlTypeName, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
controlTypeName
Control type name.
occurrence
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
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
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
public DesktopElement ByExpression(DesktopFindExpression expression, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
expression
Find expression that specifies element property values.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
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
public DesktopElement ByName(string name, int occurrence = 0, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
name
Element name.
occurrence
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
Search depth
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
DesktopElement that matches specified criteria. Null if no match is found.
ByXPath(string, int, int, int)
Find a desktop element matching specific xpath.
Declaration
public DesktopElement ByXPath(string xPath, int maxDepth = 50, int maxRetries = 3, int retryDelay = 250)
Parameters
xPath
XPath to match.
maxDepth
Search depth.
maxRetries
How many times to repeat the search if element is not found.
retryDelay
Delay in ms between search retries.
Returns
DesktopElement that matches specified criteria. Null if no match is found.