Class
BaseTest

Base test class for all WebAii unit/coded tests.

Definition

Namespace:ArtOfTest.WebAii.TestTemplates

Assembly:ArtOfTest.WebAii.dll

Syntax:

cs-api-definition
public abstract class BaseTest : IDisposable

Inheritance: objectBaseTest

Implements: IDisposable

Constructors

BaseTest()

Declaration

cs-api-definition
protected BaseTest()

Properties

Actions

Gets the actions object associated with the ActiveBrowser.

Declaration

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

Property Value

Actions

ActiveBrowser

Gets the ActiveBrowser object. (The last browser launched).

Declaration

cs-api-definition
public Browser ActiveBrowser { get; }

Property Value

Browser

Desktop

Gets the Desktop object from the Manager.

Declaration

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

Property Value

Desktop

Elements

Gets the Elements finder to be used to access elements defined by FindAttribute on the test method or class.

Declaration

cs-api-definition
public ElementFinder Elements { get; }

Property Value

ElementFinder

Find

Gets the Find object associated with the ActiveBrowser.

Declaration

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

Property Value

Find

Log

Gets the Log object associated with the Manager.

Declaration

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

Property Value

Log

Manager

Gets the Manager object.

Declaration

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

Property Value

Manager

Wait

Gets a wait object that can be used to wait on specific actions or opertions.

Declaration

cs-api-definition
public WaitSync Wait { get; }

Property Value

WaitSync

Methods

CleanUp()

Shut down and clean-up.

Declaration

cs-api-definition
public void CleanUp()

Dispose()

Dispose of this test and all of its resources. This method simply calls the CleanUp() method.

Declaration

cs-api-definition
public virtual void Dispose()

Implements IDisposable.Dispose()

GetSettings()

This method reads the settings object from the App.Config file and returns a Settings object.

The following is a sample config file that holds certain settings. Any settings not specified in this section, their values will be set to the system defaults:

<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="WebAii.Settings" type="ArtOfTest.WebAii.Core.SettingsConfigSectionHandler,ArtOfTest.WebAii, Version=x.x.xxx.x, Culture=neutral, PublicKeyToken=4FD5F65BE123776C"/> </configSections>

<WebAii.Settings defaultBrowser="InternetExplorer" logLocation="D:\Log" executionTimeout="60000" clientReadyTimeout="50000" /> </configuration>

Declaration

cs-api-definition
public static Settings GetSettings()

Returns

Settings

The settings object read from App.Config.

Remarks

If you call this method and there are not settings present in the App.Config, then the method will create an empty Setting object and reset it to the system default settings.

Also note that all Initialize() methods will call this method to attempt to load the settings.

Initialize()

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize()

Initialize(Settings)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(Settings settings)

Parameters

settings

Settings

The settings to use for initialization.

Initialize(Settings, TestContextWriteLine)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(Settings settings, TestContextWriteLine vsWriteLineDelegate)

Parameters

settings

Settings

The settings to use for initialization.

vsWriteLineDelegate

TestContextWriteLine

A write line delegate to call when logging from Log.WriteLine.

Initialize(TestContextWriteLine)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(TestContextWriteLine vsWriteLineDelegate)

Parameters

vsWriteLineDelegate

TestContextWriteLine

A write line delegate to call when logging from Log.WriteLine.

Initialize(bool)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(bool recycleBrowser)

Parameters

recycleBrowser

bool

True to run all tests in the same browser instance. Make sure that the test fixture tear-down calls the static ShutDown method of this class when using this setting.

Initialize(bool, TestContextWriteLine)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(bool recycleBrowser, TestContextWriteLine vsWriteLineDelegate)

Parameters

recycleBrowser

bool

True to run all tests in the same browser instance. Make sure that the test fixture tear-down calls the static ShutDown method of this class when using this setting.

vsWriteLineDelegate

TestContextWriteLine

A write line delegate to call when logging from Log.WriteLine.

Initialize(bool, string, TestContextWriteLine)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(bool recycleBrowser, string logLocation, TestContextWriteLine vsWriteLineDelegate)

Parameters

recycleBrowser

bool

True to run all tests in the same browser instance. Make sure that the test fixture tear-down calls the static ShutDown method of this class when using this setting.

logLocation

string

The log location where to do the logging.

vsWriteLineDelegate

TestContextWriteLine

A write line delegate to call when logging from Log.WriteLine.

Initialize(string)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(string logLocation)

Parameters

logLocation

string

The log location where to do the logging.

Initialize(string, TestContextWriteLine)

Initialize this test case object.

Declaration

cs-api-definition
public void Initialize(string logLocation, TestContextWriteLine vsWriteLineDelegate)

Parameters

logLocation

string

The log location where to do the logging.

vsWriteLineDelegate

TestContextWriteLine

A write line delegate to call when logging from Log.WriteLine.

SetTestMethod(object, string)

Set the TestMethod executing so that WebAii can extract its attributes.

Declaration

cs-api-definition
public void SetTestMethod(object testObject, string testMethodName)

Parameters

testObject

object

The test object.

testMethodName

string

The test Method name executing.

ShutDown()

Shut down all instances if recycle brower is set.

Declaration

cs-api-definition
public static void ShutDown()

Extension Methods