Class
SilverlightApp

Class that represents a Silverlight Application hosted in a browser.

Definition

Namespace:ArtOfTest.WebAii.Silverlight

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public class SilverlightApp : VisualTreeHost, IApplication, IAutomationHost, ISupportSearchHost, IAnnotationHost

Inheritance: objectVisualTreeHostSilverlightApp

Implements: IAnnotationHostIApplicationIAutomationHostISupportSearchHost

Inherited Members VisualTreeHost.LocateInHost(string[])VisualTreeHost.GetHostRoot()VisualTreeHost.UpdateInterHostLinks()VisualTreeHost.FixAnnotationArea(Rectangle)VisualTreeHost.GetWindowRectangle()VisualTreeHost.OwnerAppVisualTreeHost.VisualTreeVisualTreeHost.StateHashCodeVisualTreeHost.ShouldDisplayAnnotation

Constructors

SilverlightApp(HtmlControl)

Declaration

cs-api-definition
public SilverlightApp(HtmlControl plugin)

Parameters

plugin

HtmlControl

Properties

Annotator

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override Annotator Annotator { get; }

Property Value

Annotator

Overrides VisualTreeHost.Annotator

Implements IAnnotationHost.Annotator

Bounds

Get the Rectangle bounds of this application relative to the entire screen.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public Rectangle Bounds { get; }

Property Value

Rectangle

Implements IApplication.Bounds

Content

Gets the 'content' object of this plugin: plugin.content.xxx

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public SilverlightAppContent Content { get; }

Property Value

SilverlightAppContent

ContentWindow

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override Window ContentWindow { get; }

Property Value

Window

Overrides VisualTreeHost.ContentWindow

Implements IAnnotationHost.ContentWindow

CustomAssemblies

Gets the list of custom assemblies included

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public static string[] CustomAssemblies { get; }

Property Value

string[]

Desktop

Get the Desktop object used for real Keyboard/Mouse automation.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public Desktop Desktop { get; }

Property Value

Desktop

Implements IApplication.Desktop

EnableValidateMouseLocation

Gets / Sets whether to validate mouse click locations before allowing user interaction automation

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public bool EnableValidateMouseLocation { get; set; }

Property Value

bool

Implements IApplication.EnableValidateMouseLocation

Find

Gets the XamlFind object used to search the silverlight plugin VisualTree.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public VisualFind Find { get; }

Property Value

VisualFind

Implements IApplication.Find

FriendlyName

Returns a friendly name for this host

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override string FriendlyName { get; }

Property Value

string

Overrides VisualTreeHost.FriendlyName

Implements IAutomationHost.FriendlyName

Host

Gets the Html tag hosting this Silverlight App as an HtmlControl object. (The parent Html tag of the object/embed tag)

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public HtmlControl Host { get; }

Property Value

HtmlControl

IsConnected

Gets whether the SilverlightApp is connected to the automation host

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public bool IsConnected { get; }

Property Value

bool

IsLoaded

Gets whether this plugin is loaded or not.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public bool IsLoaded { get; }

Property Value

bool

IsRecordingHost

Indicates whether host has attached recorder.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public bool IsRecordingHost { get; }

Property Value

bool

Implements IApplication.IsRecordingHost

ManagedProxy

The proxy that allows this app to communicate with the managed world inside a silverlight application

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public ICommunicationProxy ManagedProxy { get; }

Property Value

ICommunicationProxy

Implements IApplication.ManagedProxy

Manager

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override Manager Manager { get; }

Property Value

Manager

Overrides VisualTreeHost.Manager

Implements IAnnotationHost.Manager

OwnerBrowser

Gets the owner browser object instance of this silverlight application.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public Browser OwnerBrowser { get; }

Property Value

Browser

Plugin

Gets the actual plugin element (object or embed) as an HtmlControl

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public HtmlControl Plugin { get; }

Property Value

HtmlControl

Popups

List of popup elements.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public IList<VisualTreeHost> Popups { get; }

Property Value

IList<VisualTreeHost>

Implements IApplication.Popups

Settings

Gets the 'settings' object of this plugin: plugin.settings.xxx

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public SilverlightAppSettings Settings { get; }

Property Value

SilverlightAppSettings

TechnologyType

VisualTreeHosts are only used for Silverlight

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override TechnologyType TechnologyType { get; }

Property Value

TechnologyType

Overrides VisualTreeHost.TechnologyType

Implements IAutomationHost.TechnologyType

UniqueId

A unique identifier that identifies this plugin instance. This id is updated only when the plug-in is reloaded on a postback or a browser refresh.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override string UniqueId { get; }

Property Value

string

Overrides VisualTreeHost.UniqueId

Implements IAutomationHost.UniqueId

Window

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override Window Window { get; }

Property Value

Window

Overrides VisualTreeHost.Window

Implements IAnnotationHost.Window

Methods

AddCustomAssembly(string, MemoryStream)

Add a custom assembly to the list of types that will be available for automation in addition to what ArtOfTest.WebAii.Silverlight.UI contains.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public static void AddCustomAssembly(string assemblyName, MemoryStream assembly)

Parameters

assemblyName

string

The name of the assembly to add.

assembly

MemoryStream

The assembly to include as a MemoryStream. This must be a Silverlight compiled assembly.

Capture()

Return a bitmap of the host

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public Bitmap Capture()

Returns

Bitmap

Implements IAutomationHost.Capture()

Capture(FrameworkElement)

Captures the image of an element

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public Bitmap Capture(FrameworkElement element)

Parameters

element

FrameworkElement

The element to capture an image of

Returns

Bitmap

Element image as bitmap.

Implements IApplication.Capture(FrameworkElement)

ClearAppCache()

Clear the application's cache.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public static void ClearAppCache()

ClearHighlight()

Clear any highlighting on the Silverlight surface.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public void ClearHighlight()

Connect()

Connect to the Silverlight app

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public void Connect()

Connect(int)

Connect the silverlight application to the automation host.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public void Connect(int timeout)

Parameters

timeout

int

ElementFromPoint(int, int)

Returns a proxy for the element at the specified application coordinates

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public FrameworkElement ElementFromPoint(int x, int y)

Parameters

x

int

The x-coordinate of the element

y

int

The y-coordinate of the element

Returns

FrameworkElement

A proxy for the element at those coordinates, or null if no element corresponds to the specified coordinates

Implements IApplication.ElementFromPoint(int, int)

ElementsFromPoint(Point)

Gets a list of FrameworkElements under the specified point in the application

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public IList<FrameworkElement> ElementsFromPoint(Point p)

Parameters

p

Point

The point to hit-test, in application-relative coordinates

Returns

IList<FrameworkElement>

A list of FrameworkElements under the point, starting with the topmost FrameworkElement

EnsureElementClickable(FrameworkElement)

Ensures element is can be clicked.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public void EnsureElementClickable(FrameworkElement element)

Parameters

element

FrameworkElement

Implements IApplication.EnsureElementClickable(FrameworkElement)

EnsureStateIsCurrent()

Will force all visual trees in the application to refresh.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override void EnsureStateIsCurrent()

Overrides VisualTreeHost.EnsureStateIsCurrent()

Implements IAutomationHost.EnsureStateIsCurrent()

FindName(string)

Finds an element with a specific name in the Silverlight Application. If the name is not found using the Root.FindName, it will use the VisualTree to traverse the tree and find the first name occurrence.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public FrameworkElement FindName(string name)

Parameters

name

string

The name to find.

Returns

FrameworkElement

The found FrameworkElement, else returns null.

Remarks

This method is a short-cut for Find.ByName()

FindName<T>(string)

Finds an element with a specific name in the Silverlight Application. If the name is not found using the Root.FindName(), it will use the VisualTree to traverse the tree and find the first name occurrence.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public T FindName<T>(string name) where T : FrameworkElement

Parameters

name

string

The name to find.

Returns

T

The found FrameworkElement, else returns null.

Remarks

This method is a short-cut for Find.ByName()

GetApp(HtmlControl)

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public static SilverlightApp GetApp(HtmlControl host)

Parameters

host

HtmlControl

Returns

SilverlightApp

GetApp(HtmlControl, int, bool)

Gets the Silverlight application for the specified HtmlControl host.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public static SilverlightApp GetApp(HtmlControl host, int timeout, bool catchedOnly)

Parameters

host

HtmlControl

timeout

int

catchedOnly

bool

Returns

SilverlightApp

GetChildHosts()

Get all contained hosts. This will always return an empty array for SilverlightApp hosts.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override IAutomationHost[] GetChildHosts()

Returns

IAutomationHost[]

Contained Hosts

Overrides VisualTreeHost.GetChildHosts()

Implements IAutomationHost.GetChildHosts()

GetScreenRectangle(FrameworkElement)

Gets the rectangle of the element in screen coordinates

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public Rectangle GetScreenRectangle(FrameworkElement element)

Parameters

element

FrameworkElement

Returns

Rectangle

Implements IApplication.GetScreenRectangle(FrameworkElement)

GetToolTipText(FrameworkElement)

Gets the text of a tooltip on the element

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public string GetToolTipText(FrameworkElement element)

Parameters

element

FrameworkElement

Returns

string

Any text contained by the element's tooltip, or null if the element has no toolip

Implements IApplication.GetToolTipText(FrameworkElement)

InitializeCustomTypes()

Searches the AppDomain for assemblies that provide custom Silverlight types and adds the assemblies containing those types to the custom assembly list

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public static void InitializeCustomTypes()

LocateAllInHost(string[])

Locate all in host.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override IList<ITargetElement> LocateAllInHost(string[] expression)

Parameters

expression

string[]

The expression to use.

Returns

IList<ITargetElement>

The list of target elements

Overrides VisualTreeHost.LocateAllInHost(string[])

Implements ISupportSearchHost.LocateAllInHost(string[])

RefreshVisualTrees()

Refreshes the main visual tree for the application as well as any open Popup visual trees.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public void RefreshVisualTrees()

Implements IApplication.RefreshVisualTrees()

ResizeContainer(int, int, int, int)

Resizes the browser or application window so its content rectangle is (x, y, width, height) if possible. If that rectangle doesn't fit on the screen, then try it at the upper left corner of the screen and as close to that size as possible.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public void ResizeContainer(int x, int y, int width, int height)

Parameters

x

int

y

int

width

int

height

int

Implements IApplication.ResizeContainer(int, int, int, int)

ScrollElementVisible(FrameworkElement, ScrollToVisibleType)

Scrolls a control into view

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public void ScrollElementVisible(FrameworkElement element, ScrollToVisibleType scrollType)

Parameters

element

FrameworkElement

Element to scroll to.

scrollType

ScrollToVisibleType

Scroll type.

Implements IApplication.ScrollElementVisible(FrameworkElement, ScrollToVisibleType)

SetWindowFocus()

Makes the window containing this host active

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override bool SetWindowFocus()

Returns

bool

Whether we successfully set the window to active

Overrides VisualTreeHost.SetWindowFocus()

Implements IAutomationHost.SetWindowFocus()

ValidateMouseLocation(Point)

Validate the location of the mouse.

Declaration

cs-api-definition
[Obsolete("Silverlight support has been deprecated!")]
public override void ValidateMouseLocation(Point point)

Parameters

point

Point

Overrides VisualTreeHost.ValidateMouseLocation(Point)

Implements IAutomationHost.ValidateMouseLocation(Point)