Class
SilverlightProxy

For internal use only.

Definition

Namespace:ArtOfTest.WebAii.Silverlight

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class SilverlightProxy : ICommunicationProxy

Inheritance: objectSilverlightProxy

Implements: ICommunicationProxy

Constructors

SilverlightProxy(SilverlightApp)

Declaration

cs-api-definition
public SilverlightProxy(SilverlightApp hostApp)

Parameters

hostApp

SilverlightApp

Properties

Application

Get the parent application object.

Declaration

cs-api-definition
public IApplication Application { get; }

Property Value

IApplication

Implements ICommunicationProxy.Application

Methods

GetAllVisualTrees()

Gets all visual trees of the application

Declaration

cs-api-definition
public string GetAllVisualTrees()

Returns

string

An encoded string containing all the visual trees of the application in the format (@@[length]@@[tree])+.

Implements ICommunicationProxy.GetAllVisualTrees()

GetPeerHashCode(IAutomationPeer)

Gets the hash code of the peer.

Declaration

cs-api-definition
public int GetPeerHashCode(IAutomationPeer peer)

Parameters

peer

IAutomationPeer

The peer to get the hash code from.

Returns

int

The hash code.

Implements ICommunicationProxy.GetPeerHashCode(IAutomationPeer)

GetProperties(IAutomationPeer)

Gets a collection of the properties of an element whose values we are able to transfer from the application back to the testing framework.

Declaration

cs-api-definition
public Dictionary<string, string> GetProperties(IAutomationPeer peer)

Parameters

peer

IAutomationPeer

Returns

Dictionary<string, string>

Implements ICommunicationProxy.GetProperties(IAutomationPeer)

GetProperty(AutomationProperty, IAutomationPeer)

Get a property for an automation peer

Declaration

cs-api-definition
public object GetProperty(AutomationProperty property, IAutomationPeer peer)

Parameters

property

AutomationProperty

peer

IAutomationPeer

Returns

object

Implements ICommunicationProxy.GetProperty(AutomationProperty, IAutomationPeer)

GetRectangle(IAutomationPeer)

Get the real rectangle of an elements

Declaration

cs-api-definition
public object GetRectangle(IAutomationPeer peer)

Parameters

peer

IAutomationPeer

Returns

object

Implements ICommunicationProxy.GetRectangle(IAutomationPeer)

GetRectangle(IAutomationPeer, IAutomationPeer)

Get the rectangle of one element relative to another

Declaration

cs-api-definition
public object GetRectangle(IAutomationPeer peer, IAutomationPeer relativeTo)

Parameters

peer

IAutomationPeer

relativeTo

IAutomationPeer

Returns

object

Implements ICommunicationProxy.GetRectangle(IAutomationPeer, IAutomationPeer)

GetRectangle(IAutomationPeer, int)

Get the bounding rectangle for an automation peer

Declaration

cs-api-definition
public object GetRectangle(IAutomationPeer peer, int maxUiBlockingTime)

Parameters

peer

IAutomationPeer

Peer.

maxUiBlockingTime

int

Max UI blocking time in ms.

Returns

object

Implements ICommunicationProxy.GetRectangle(IAutomationPeer, int)

GetTextRecursive(AutomationReference)

Gets the text content of an element or property. Recursively descends into children of an element and collects the text of all TextBlocks contained in it. Or if the reference is string-valued, simply returns that string

Declaration

cs-api-definition
public string GetTextRecursive(AutomationReference targetRef)

Parameters

targetRef

AutomationReference

Returns

string

The text content, as described above

Implements ICommunicationProxy.GetTextRecursive(AutomationReference)

GetVirtualizedViewportOffset(IAutomationPeer)

Declaration

cs-api-definition
public int GetVirtualizedViewportOffset(IAutomationPeer virtualizingPanel)

Parameters

virtualizingPanel

IAutomationPeer

Returns

int

Implements ICommunicationProxy.GetVirtualizedViewportOffset(IAutomationPeer)

GetVisibility(IAutomationPeer)

Get the Visibility property value of an element, where the element inherits the Collapsed value if any of its visual tree ancestors have Visibility == Collapsed

Declaration

cs-api-definition
public Visibility GetVisibility(IAutomationPeer peer)

Parameters

peer

IAutomationPeer

The element whose Visibility value we're retrieving

Returns

Visibility

Collapsed if the element or any of its visual tree ancestors have Visibility == Collapsed. Otherwise, Visible.

Implements ICommunicationProxy.GetVisibility(IAutomationPeer)

GetVisualTree(IAutomationPeer)

Declaration

cs-api-definition
public string GetVisualTree(IAutomationPeer root)

Parameters

root

IAutomationPeer

Returns

string

Implements ICommunicationProxy.GetVisualTree(IAutomationPeer)

GetVisualTree(IAutomationPeer, string)

Declaration

cs-api-definition
public string GetVisualTree(IAutomationPeer root, string hash)

Parameters

root

IAutomationPeer

hash

string

Returns

string

Implements ICommunicationProxy.GetVisualTree(IAutomationPeer, string)

GetVisualTree(string)

Get the full visual tree of the application

Declaration

cs-api-definition
public string GetVisualTree(string startAt)

Parameters

startAt

string

Returns

string

Implements ICommunicationProxy.GetVisualTree(string)

GetVisualTree(string, string)

Get the full visual tree of the application, but only if it's different from the one we already have

Declaration

cs-api-definition
public string GetVisualTree(string startAt, string hash)

Parameters

startAt

string

hash

string

The hash of the visual tree we already have

Returns

string

A string representation of the visual tree, or null if the tree has not changed

Implements ICommunicationProxy.GetVisualTree(string, string)

Highlight(IAutomationPeer, bool)

Highlight an element on the surface

Declaration

cs-api-definition
public void Highlight(IAutomationPeer peer, bool clear)

Parameters

peer

IAutomationPeer

The element to highlight

clear

bool

True/False whether to clear it.

Implements ICommunicationProxy.Highlight(IAutomationPeer, bool)

HitTest(Point)

Gets a list of all FrameworkElements under the specified point

Declaration

cs-api-definition
public IList<FrameworkElement> HitTest(Point p)

Parameters

p

Point

The point to hit test

Returns

IList<FrameworkElement>

List of all elements under the point

InvokeMethod(AutomationMethod, IAutomationPeer)

Invokes method on automation peer's client side.

Declaration

cs-api-definition
public object InvokeMethod(AutomationMethod method, IAutomationPeer peer)

Parameters

method

AutomationMethod

Method to be invoked.

peer

IAutomationPeer

Automation peer, containing the method.

Returns

object

The object client side method returned.

Implements ICommunicationProxy.InvokeMethod(AutomationMethod, IAutomationPeer)

PublishKnownControlTypes(List<string>)

Publish Known Control types

Declaration

cs-api-definition
public void PublishKnownControlTypes(List<string> knownTypes)

Parameters

knownTypes

List<string>

Implements ICommunicationProxy.PublishKnownControlTypes(List<string>)

ScrollToVisible(IAutomationPeer)

Scroll the controls containing an element so that the element comes into view

Declaration

cs-api-definition
public void ScrollToVisible(IAutomationPeer peer)

Parameters

peer

IAutomationPeer

The element to bring into view

Implements ICommunicationProxy.ScrollToVisible(IAutomationPeer)

SetProperty(AutomationProperty, IAutomationPeer, object)

Set a property for an automation peer

Declaration

cs-api-definition
public void SetProperty(AutomationProperty property, IAutomationPeer peer, object value)

Parameters

property

AutomationProperty

peer

IAutomationPeer

value

object

Implements ICommunicationProxy.SetProperty(AutomationProperty, IAutomationPeer, object)