ClassLog
Log support for the framework and test cases.
Definition
Namespace:ArtOfTest.WebAii.Core
Assembly:ArtOfTest.WebAii.dll
Syntax:
public class Log : IDisposable
Inheritance: objectLog
Implements:
Properties
FileName
Full file name of the log file. Empty if Settings.CreateLogFile = false
LogLocation
The log location on disk the log files are stored. Empty if Settings.CreateLogFile = false.
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
public void CaptureBrowser(Browser browserToCapture)
Parameters
browserToCapture
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).
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
public void CaptureBrowser(Browser browserToCapture, string fileNamePrefix, bool overrideFile)
Parameters
browserToCapture
The browser to capture.
fileNamePrefix
File name prefix to set.
overrideFile
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
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
public void CaptureDesktop(string fileNamePrefix)
Parameters
fileNamePrefix
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).
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
public void CaptureWindow(IDesktopAutomationHost windowToCapture, string fileNamePrefix)
Parameters
windowToCapture
The window to capture.
fileNamePrefix
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
public void CaptureWindow(IDesktopAutomationHost windowToCapture, string fileNamePrefix, bool overrideFile)
Parameters
windowToCapture
fileNamePrefix
overrideFile
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).
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.WriteLine(LogType, string)
Log information to the event log.
WriteLine(string)
Write a line to the log file.
Declaration
public void WriteLine(string message)
Parameters
message
The message to write.
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
public event EventHandler<LogWriteEventArgs> LogWrite
Event Value