Class
WpfApplication

Actions for automating WPF applications.

Definition

Namespace:ArtOfTest.WebAii.Wpf

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class WpfApplication

Inheritance: objectWpfApplication

Properties

AppFileName

Gets the application file name

Declaration

cs-api-definition
public string AppFileName { get; }

Property Value

string

HasExited

Indicates whether application under test exited.

Declaration

cs-api-definition
public bool HasExited { get; }

Property Value

bool

MainWindow

Application main window.

Declaration

cs-api-definition
public WpfWindow MainWindow { get; }

Property Value

WpfWindow

Manager

The Manager object that owns this application

Declaration

cs-api-definition
public Manager Manager { get; }

Property Value

Manager

Pid

The application's process id

Declaration

cs-api-definition
public int Pid { get; }

Property Value

int

Process

Application under test process.

Declaration

cs-api-definition
public Process Process { get; }

Property Value

Process

QuitOnDetach

Whether to close all of this application's windows when the testing framework detaches from the application.

Declaration

cs-api-definition
public bool QuitOnDetach { get; set; }

Property Value

bool

Windows

The application's collection of windows

Declaration

cs-api-definition
public IList<WpfWindow> Windows { get; }

Property Value

IList<WpfWindow>

Methods

Detach()

Detach the current application.

Declaration

cs-api-definition
public void Detach()

Detach(bool)

Detach the current application.

Declaration

cs-api-definition
public void Detach(bool quitOnDetach)

Parameters

quitOnDetach

bool

Close the application under test.

GetWindow(string)

Given a window caption get the corresponding window object.

Declaration

cs-api-definition
public WpfWindow GetWindow(string caption)

Parameters

caption

string

The full caption or partial caption of the window. (case-insensitive)

Returns

WpfWindow

Quit()

Detach the current application and kill application under test.

Declaration

cs-api-definition
public void Quit()

WaitForWindow(string)

Wait for a window to show up and be ready for automation. Uses the Settings.ClientReadyTimeout

Declaration

cs-api-definition
public WpfWindow WaitForWindow(string caption)

Parameters

caption

string

The caption of the window

Returns

WpfWindow

The window if found.

WaitForWindow(string, int)

Wait for a window to show up and be ready for automation

Declaration

cs-api-definition
public WpfWindow WaitForWindow(string caption, int timeout)

Parameters

caption

string

The caption of the window

timeout

int

The timeout to wait in msec.

Returns

WpfWindow

The window if found.

Events

NewWindow

Fired when new window is detected.

Declaration

cs-api-definition
public event EventHandler<GenericEventArgs<WpfWindow>> NewWindow

Event Value

EventHandler<GenericEventArgs<WpfWindow>>