C# Class White.Core.Application

Represents a process which contains windows.
Inheritance: IDisposable
Exibir arquivo Open project: PulseMiningSystems/White Class Usage Examples

Public Methods

Method Description
Attach ( Process process ) : Application

Attaches with existing process

Attach ( int processId ) : Application

Creates an Application object for existing process

Attach ( string executable ) : Application

Attaches with existing process

AttachOrLaunch ( ProcessStartInfo processStartInfo ) : Application

Attaches to the process if it is running or launches a new process

Close ( ) : void

Tries to find the main window, then close it. If it hasn't closed in 5 seconds, kill the process

Dispose ( ) : void
Equals ( object obj ) : bool

Two applications are equal if they have the same process

Find ( Predicate match, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window

Looks at all the windows visible for the application and finds one which matches the condition. The match is run against the title of the windows

FindSplash ( ) : White.Core.UIItems.WindowItems.Window
GetHashCode ( ) : int
GetWindow ( White.Core.UIItems.Finders.SearchCriteria searchCriteria, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window

Find the first window which belongs to this application and satisfies the critera.

GetWindow ( string title ) : White.Core.UIItems.WindowItems.Window

Get visible window

GetWindow ( string title, White.Core.Factory.InitializeOption option ) : White.Core.UIItems.WindowItems.Window

Get visible window

GetWindows ( ) : List

All windows belonging to the application

Kill ( ) : void

Kills the applications and waits till it is closed

KillAndSaveState ( ) : void

Kills the application. Read Application.Kill. It also saves the application test execution state. This saves the position of the window UIItems which would be loaded next time automatically for improved performance. You would need to use InitializedOption.AndIdentifiedBy for specifying the identification of window.

Launch ( ProcessStartInfo processStartInfo ) : Application

Lauches the process and creates and Application object for it

Launch ( string executable ) : Application

Runs the process identified by the executable and creates Application object for this executable

WaitWhileBusy ( ) : void

Waits till application is busy.

Protected Methods

Method Description
Application ( ) : System

Private Methods

Method Description
Application ( Process process ) : System
ReplaceLast ( string replaceIn, string replace, string with ) : string

Method Details

Application() protected method

protected Application ( ) : System
return System

Attach() public static method

Attaches with existing process
public static Attach ( Process process ) : Application
process System.Diagnostics.Process
return Application

Attach() public static method

Creates an Application object for existing process
public static Attach ( int processId ) : Application
processId int
return Application

Attach() public static method

Attaches with existing process
public static Attach ( string executable ) : Application
executable string
return Application

AttachOrLaunch() public static method

Attaches to the process if it is running or launches a new process
public static AttachOrLaunch ( ProcessStartInfo processStartInfo ) : Application
processStartInfo System.Diagnostics.ProcessStartInfo
return Application

Close() public method

Tries to find the main window, then close it. If it hasn't closed in 5 seconds, kill the process
public Close ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

Equals() public method

Two applications are equal if they have the same process
public Equals ( object obj ) : bool
obj object
return bool

Find() public method

Looks at all the windows visible for the application and finds one which matches the condition. The match is run against the title of the windows
public Find ( Predicate match, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window
match Predicate
initializeOption White.Core.Factory.InitializeOption option for the window which matches the condition
return White.Core.UIItems.WindowItems.Window

FindSplash() public method

public FindSplash ( ) : White.Core.UIItems.WindowItems.Window
return White.Core.UIItems.WindowItems.Window

GetHashCode() public method

public GetHashCode ( ) : int
return int

GetWindow() public method

Find the first window which belongs to this application and satisfies the critera.
public GetWindow ( White.Core.UIItems.Finders.SearchCriteria searchCriteria, White.Core.Factory.InitializeOption initializeOption ) : White.Core.UIItems.WindowItems.Window
searchCriteria White.Core.UIItems.Finders.SearchCriteria
initializeOption White.Core.Factory.InitializeOption found window would be initialized with this option
return White.Core.UIItems.WindowItems.Window

GetWindow() public method

Get visible window
public GetWindow ( string title ) : White.Core.UIItems.WindowItems.Window
title string Title text of window displayed on desktop
return White.Core.UIItems.WindowItems.Window

GetWindow() public method

Get visible window
public GetWindow ( string title, White.Core.Factory.InitializeOption option ) : White.Core.UIItems.WindowItems.Window
title string Title text of window displayed on desktop
option White.Core.Factory.InitializeOption Option which would be used to initialize the window.
return White.Core.UIItems.WindowItems.Window

GetWindows() public method

All windows belonging to the application
public GetWindows ( ) : List
return List

Kill() public method

Kills the applications and waits till it is closed
public Kill ( ) : void
return void

KillAndSaveState() public method

Kills the application. Read Application.Kill. It also saves the application test execution state. This saves the position of the window UIItems which would be loaded next time automatically for improved performance. You would need to use InitializedOption.AndIdentifiedBy for specifying the identification of window.
public KillAndSaveState ( ) : void
return void

Launch() public static method

Lauches the process and creates and Application object for it
public static Launch ( ProcessStartInfo processStartInfo ) : Application
processStartInfo System.Diagnostics.ProcessStartInfo
return Application

Launch() public static method

Runs the process identified by the executable and creates Application object for this executable
public static Launch ( string executable ) : Application
executable string location of the executable
return Application

WaitWhileBusy() public method

Waits till application is busy.
public WaitWhileBusy ( ) : void
return void