Class
Log

Log support for the framework and test cases.

Definition

Namespace:ArtOfTest.WebAii.Core

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public class Log : IDisposable

Inheritance: objectLog

Implements: IDisposable

Properties

FileName

Full file name of the log file. Empty if Settings.CreateLogFile = false

Declaration

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

Property Value

string

LogLocation

The log location on disk the log files are stored. Empty if Settings.CreateLogFile = false.

Declaration

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

Property Value

string

Text

Log file contents. This is a snap shot the Log file contents runtime.

Declaration

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

Property Value

string

Methods

CaptureBrowser(Browser)

Captures a visual snap shot of a specified browser instance and logs it to the log location. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureBrowser(Browser browserToCapture)

Parameters

browserToCapture

Browser

The browser instance to capture.

CaptureBrowser(Browser, string)

Captures a visual snap shot of a specified browser instance and logs it to the log location. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureBrowser(Browser browserToCapture, string fileNamePrefix)

Parameters

browserToCapture

Browser

The browser instance to capture.

fileNamePrefix

string

File name prefix to set.

CaptureBrowser(Browser, string, bool)

Captures a visual snap shot of a specified browser instance and logs it to the log location. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureBrowser(Browser browserToCapture, string fileNamePrefix, bool overrideFile)

Parameters

browserToCapture

Browser

The browser to capture.

fileNamePrefix

string

File name prefix to set.

overrideFile

bool

If set will override existing file with the same name.

CaptureDesktop()

Captures the entire desktop to the log location. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureDesktop()

CaptureDesktop(string)

Captures the entire desktop to the log location with custom prefix to the file name. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureDesktop(string fileNamePrefix)

Parameters

fileNamePrefix

string

File name prefix to set.

CaptureDesktop(string, bool)

Captures the entire desktop to the log location with custom prefix to the file name. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureDesktop(string fileNamePrefix, bool overrideFile)

Parameters

fileNamePrefix

string

File name prefix to set.

overrideFile

bool

If set will override existing file with the same name.

CaptureWindow(IDesktopAutomationHost, string)

Captures a visual snapshot of a specified desktop application window instance. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureWindow(IDesktopAutomationHost windowToCapture, string fileNamePrefix)

Parameters

windowToCapture

IDesktopAutomationHost

The window to capture.

fileNamePrefix

string

File name prefix to set.

CaptureWindow(IDesktopAutomationHost, string, bool)

Captures a visual snapshot of a specified window instance. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

The window to capture. File name prefix to set. If set will override existing file with the same name.

Declaration

cs-api-definition
public void CaptureWindow(IDesktopAutomationHost windowToCapture, string fileNamePrefix, bool overrideFile)

Parameters

windowToCapture

IDesktopAutomationHost

fileNamePrefix

string

overrideFile

bool

CaptureWindow(WpfWindow, string)

Captures a visual snap shot of a specified wpf window instance. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

Declaration

cs-api-definition
public void CaptureWindow(WpfWindow windowToCapture, string fileNamePrefix)

Parameters

windowToCapture

WpfWindow

The window to capture.

fileNamePrefix

string

File name prefix to set.

CaptureWindow(WpfWindow, string, bool)

Captures a visual snap shot of a specified window instance. Default path is C:\WebAiiLog, supported only if Settings.CreateLogFile is set to true and the Manager is initialized with test settings (add test settings to the test project). Not available in quick execution (no settings file).

The window to capture. File name prefix to set. If set will override existing file with the same name.

Declaration

cs-api-definition
public void CaptureWindow(WpfWindow windowToCapture, string fileNamePrefix, bool overrideFile)

Parameters

windowToCapture

WpfWindow

fileNamePrefix

string

overrideFile

bool

Dispose()

Dispose of this object.

Declaration

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

WriteLine(LogType, string)

Log information to the event log.

Declaration

cs-api-definition
public void WriteLine(LogType type, string message)

Parameters

type

LogType

Log type, LogType.Trace for example.

message

string

Message to log.

WriteLine(string)

Write a line to the log file.

Declaration

cs-api-definition
public void WriteLine(string message)

Parameters

message

string

The message to write.

~Log()

Destructor

Declaration

cs-api-definition
protected ~Log()

Events

LogWrite

This event is invoked every time a Log.WriteLine is invoked. External frameworks can attach to this event to capture logs from this framework to help unify their logging.

Declaration

cs-api-definition
public event EventHandler<LogWriteEventArgs> LogWrite

Event Value

EventHandler<LogWriteEventArgs>