WebAii� DocumentationLanguage Filter
C# VB

Go back to ArtOfTest homepage.
logo
Skip Navigation Links.

Looking for a topic you can't find here? Feel free to let us know.

Getting Started with WebAii

Thanks for using WebAii Automation infrastructure. To get started using WebAii, please follow the instructions below. If you have further questions, feel free to contact us.

IMPORTANT

  • WebAii 1.1 and 2.0 were designed coexist on the same machine.
  • Please uninstall any previous WebAii 1.x installations on your machine before installing the current version. of WebAii 1.x.
  • Please uninstall any previous WebAii 2.0 installations on your machine before installing the current version. of WebAii 2.0.
  • If you are upgrading from 1.0 to 1.1, please make sure to also uninstall the WebAii 1.0 Firefox extension before installing 1.1. WebAii 1.1 and 2.0 beta versions automatically install their respective Firefox extensions. No manual steps are required.

Installing and Setting Up the Infrastructure

To get started, first download the WebAii installer package directly from the Products page. Once the installation is complete, you will have all of the following placed in the WebAii %InstallDir% folder:

  • The WebAii Automation Infrastructure library. ArtOfTest.WebAii.dll & ArtOfTest.Common.dll.
  • WebAii's Internet Explorer client. ArtOfTest.InternetExplorer.dll.
  • WebAii's Firefox client: Automatically installed in your install directory.
  • Safari client: Automatically installed in your install directory.
  • Silverlight plug-in: ArtOfTest.WebAii.Mime.dll.
  • Our HTTP Proxy: ArtOfTest.WebAii.HttpProxy.exe.
  • ASP.NET TestRegion Custom Control. ArtOfTest.WebAii.AspNet.dll.
  • Visual Studio item templates for VS Team Test, NUnit, MbUnit and xUnit (Both VB.NET and C#).These are automatically registered with Visual Studio.
  • 90+ Unit Test Code Samples to help illustrate the different features of WebAii. You will find 4 zipped solutions: (QuickStarts_NUnit_CS.zip, QuickStarts_VSTS_CS.zip, QuickStarts_NUnit_VB.zip, QuickStarts_VSTS_VB.zip). You can use the sample solution that fits your language and testing framework of preference.
  • Release notes. ReleaseNotes.txt
  • API Reference help file. Documentation.chm
  • Link to the online Documentation including the Getting Started Guide.
  • Link to the online community forums.
  • Link to WebAii Premier Support description.

Only needed when using WebAii 1.0
Both the WebAii library and the Internet Explorer client are installed and ready to use once the installation is complete. The templates are also installed into your local templates for the current user. You also have a copy of these templates under %InstallDir%\Visual Studio Templates\. Firefox client is not automatically installed in WebAii 1.0. If you wish to also support Firefox in WebAii 1.0, you can simply install the Firefox client using the following simple steps. In WebAii 1.1 and above the Firefox client is automatically installed by the WebAii installer.

Starting Automation Using WebAii

  • If you are using Visual Studio Team Test, please reference the Using Visual Studio Team Test topic.
  • If you are using NUnit, please reference the Using NUnit topic.
  • If you are not using NUnit or Visual Studio Team Test, you can still use WebAii from a Console Application, a Class Library or a Windows Application. Simply follow the rest of the instructions below.

Once WebAii is installed on the target machine, you can easily start using it from your .NET project by simply referencing the ArtOfTest.WebAii.dll and ArtOfTest.Command.dll files placed in your %InstallDir%. Those are the only dll's you need to reference to get the full functionality of WebAii. To reference the WebAii library:

  1. Select your project in the Solution Explorer in Visual Studio, or start a new project.
  2. Right-click the References folder displayed in the solution and select 'Add Reference...'.
  3. Navigate to the ArtOfTest.WebAii.dll installed on your machine in your %InstallDir%\bin folder.
  4. Select both ArtOfTest.WebAii.dll and ArtOfTest.Common.dll files.
  5. Click OK to finish added the WebAii references needed.

Quick Start Sample Code

Before calling into any of the WebAii library methods, you need to make sure that you have properly initialized an instance of the Manager object passing in the settings you want used for this instance. To initialize the project:

C#

// Initialize the settings you want used.

Settings mySettings = new Settings(BrowserType.InternetExplorer, @"c:\log\");

 

// Create the manager object

Manager myManager = new Manager(mySettings);

 

// Start the manager

myManager.Start();

 

// Launch a new browser instance. [This will launch an IE instance given the setting above]

myManager.LaunchNewBrowser();

 

// Navigate to a certain web page

myManager.ActiveBrowser.NavigateTo("http://www.google.com");

 

// Perform your automation actions.

Element mybtn = myManager.ActiveBrowser.Find.ByTagIndex("input", 3);

myManager.ActiveBrowser.Actions.Click(mybtn);

 

// Shut-down the manager and do all clean-up

myManager.Dispose();

Visual Basic

' Initialize the settings you want used.

Dim mySettings As Settings = New Settings(BrowserType.InternetExplorer, "c:\log\")

 

' Create the manager object

Dim myManager As Manager = New Manager(mySettings)

 

' Start the manager

myManager.Start()

 

' Launch a new browser instance. [This will launch an IE instance given the setting above]

myManager.LaunchNewBrowser()

 

' Navigate to a certain web page

myManager.ActiveBrowser.NavigateTo("http://www.google.com")

 

' Perform your automation actions.

Dim mybtn As Element = myManager.ActiveBrowser.Find.ByTagIndex("input", 3)

myManager.ActiveBrowser.Actions.Click(mybtn)

 

' Shut-down the manager and do all clean-up

myManager.Dispose()

The Manager object exposes all methods/properties needed to perform browser automation, element identification, logging and DOM traversal including TestRegion identification. Below is a brief description of the key objects exposed off the Manager and their corresponding key object properties/methods:

Object Type Name Brief Description Key Objects/Methods Exposed Quick Start Tutorials
Manager.ActiveBrowser ArtOfTest.WebAii.Core.Browser The most recent launched browser instance. You can use it to invoke actions, access the loaded document DOM and perform element identification and extraction using the Browser.Find object. Browser.Actions, Browser.Find, Brower.DomTree, Browser.Window Automating Browser Actions, Finding Page Elements, Multi-Browser Instance Support, JavaScript Support
Manager.ActiveBrowser.
Actions
ArtOfTest.WebAii.Core.Actions Used to invoked direct DOM actions against the loaded document. Actions.Click, Actions.SetText, Actions.Check, Actions.WaitForElement Automating Browser Actions, Ajax support, JavaScript Support
Manager.ActiveBrowser.
Find
ArtOfTest.WebAii.Core.Find Used to search the DOM elements of the associated browser. Find.SearchRegion Finding Page Elements, Introduction to TestRegion's, FindParam's as External Xml DataSource
Manager.ActiveBrowser.
DomTree
ArtOfTest.WebAii. Core.TreeBuilder The full DOM Tree of the currently loaded document. TreeBuilder.TestRegion's, TreeBuilder.Root Finding Page Elements
Manager.ActiveBrowser.
Window
ArtOfTest.WebAii. Win32.Window The window representation of this browser window. Use this object to manipulate the browser window and capture bitmaps. Window.Handler, Window.GetBitmap() Native Win32 Windows Handling, Visual Capturing
Manager.ActiveBrowser. Frames ArtOfTest.WebAii. Core.FramesCollection Retrieves a list of the child frames contained in the browser window. ById, BySrc, RefreshAllDomTrees, WaitUntilReady() Frames Support
Manager.ActiveBrowser. Regions ArtOfTest.WebAii. ObjectModel.TestRegionCollection Retrieves a list of the test regions identified in the DOM. Count, Item, Items Intro to TestRegion's, Using Asp.Net TestRegion Control
Manager.Desktop ArtOfTest.WebAii.Core.Desktop Used to invoke pure UI automation events from the Mouse & Keyboard. Desktop.Mouse, Desktop.Keyboard Automating Browser Actions
Manager.Log ArtOfTest.WebAii.Core.Log Provides logging support for the current manager session. Log.WriteLine, Log.CaptureBrowser() none
Copyrights © 2007-2009 ArtOfTest, Inc. All rights reserved. Privacy Policy | Terms of Use