ClassElementFinder
Provides infrastructure for accessing elements defined by FindParamAttribute on test methods and classes. Replaces the Find.Elements dictionary which has been obsoleted.
Definition
Namespace:ArtOfTest.WebAii.Core
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class ElementFinder
Inheritance: objectElementFinder
Constructors
ElementFinder(Manager, object)
Create a new ElementFinder against a specific class instance
Properties
ReturnElementProxyWhenNotFound
Gets or sets a flag that indicates to the ElementFinder to return an ElementProxy object when the element is not found instead of null or an exception. The Element proxy object is an Element object that is only initialized with the FindParam object it needs to use. You can then call Element.Wait.ForExists() on it to wait for it to be found. You can check whether an Element is a proxy element by checking the Element.IsProxy
Declaration
public bool ReturnElementProxyWhenNotFound { get; set; }
Property Value
WaitOnElements
Gets or sets whether to wait on elements to exist in the DOM tree if they can't be found initially. If set, will use the WaitOnElementsTimeout as the default timeout for the wait. Default is false Note: This property overrides ReturnElementProxyWhenNotFound if set.
WaitOnElementsTimeout
Gets or sets the timeout to use when waiting on elements. WaitOnElements=true.
Methods
Get(string)
Get an element defined by a FindAttribute.
Declaration
public ITargetElement Get(string elementKey)
Parameters
elementKey
The FindAttribute to use to locate the element.
Returns
The element from the DOM or a proxy element that can be used later for another search.
GetHtml(string)
Get an HTML element
GetHtml<T>(string)
Get an HTML element.
Declaration
public T GetHtml<T>(string elementKey) where T : Control, new()
Parameters
elementKey
The key as defined by the Find() attribute.
Returns
T
The control.
GetXaml(string)
Get a Xaml element.
Declaration
public FrameworkElement GetXaml(string elementKey)
Parameters
elementKey
The element key as defined by the Find() attribute
Returns
The found element
GetXaml<T>(string)
Get a Xaml element
Declaration
public T GetXaml<T>(string elementKey) where T : FrameworkElement
Parameters
elementKey
The key as defined by the Find() attribute
Returns
T
The found element
Merge(Type)
Merge a set of FindAttribute declarations defined on a type. The parameters will be available using Get, GetHtml or GetXaml