Vorleak Chy's Blog
Art Of Test WebAii Tests Web UI
My colleague have some problems using Selenium to test the website specifically issues with JavaScript and Ajax. Also we would like to include testing nicely and easily integrated into our build process with continuous integration.
So we did together a bit of searching and found the free .Net automation framework for web testing produced by Art Of Test Inc called WebAii. Just see from the demo it seems to do everything we want.
I would think this is more useful framework rather than the others for now even I’ve just started to use it and there are just a small sample codes of its features. I guess it can be a killer web testing application. I tried it with my colleague and how about you?
Here is an example for you to try it:
Configuration file App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="WebAii.Settings" type="ArtOfTest.WebAii.Core.SettingsConfigSectionHandler,ArtOfTest.WebAii, Version=1.1.900.0, Culture=neutral, PublicKeyToken=4FD5F65BE123776C"/>
</configSections>
<WebAii.Settings
annotateExecution="false"
baseUrl="http://www.google.com/"
clientReadyTimeout="50000"
defaultBrowser="InternetExplorer"
enableScriptLogging="false"
enableUILessRequestViewing="false"
executionDelay="0"
executionTimeout="60000"
localWebServer="None"
logLocation="C:\WebAiiLog\"
queryEventLogErrorsOnExit="false"
simulatedMouseMoveSpeed="0.3"
webAppPhysicalPath=""/>
</configuration>
Abstract class PageBase.cs
using ArtOfTest.WebAii.Core;
using NUnit.Framework;
namespace WebAiiUITest
{
public abstract class PageBase
{
public readonly Manager manager = new Manager(true);
protected Browser browser;
protected Find find;
[SetUp]
public void SetUp()
{
manager.Start();
manager.LaunchNewBrowser();
browser = manager.ActiveBrowser;
find = browser.Find;
browser.NavigateTo("http://www.google.com/");
}
[TearDown]
public void TearDown()
{
browser.Close();
}
}
}
Testing class KeywordSearch.cs
using ArtOfTest.WebAii.Controls.HtmlControls;
using NUnit.Framework;
namespace WebAiiUITest
{
[TestFixture]
public class KeywordSearch : PageBase
{
[Test]
public void Should_keyword_search_found()
{
var searchText = "WowKhmer Tech";
find.ById<htmlinputtext>("q").Value = searchText;
find.ById<htmlinputsubmit>("btnG").Click();
Assert.IsNotNull(find.ById<htmlanchor>(searchText));
}
}
}
This example will run with Internet Explorer browser. You can run with Firefox just change defaultBrowser=”Firefox” in App.config you can either write one line of code but I would like keep it easily in configuration file. It still doesn’t work if it opens with a new tab, from my experience unless you need to have a setting in browser. Click Tools -> Options -> Tabs -> select “a new window” option.
Subscribe-
Search-
Tags-
Categories-
Recent Comments-
- Using UUID as Primary Key in Ruby on Rails Thanks @Chamnap, I have...
- Using UUID as Primary Key in Ruby on Rails Not working. You need to...
- Installing GeoServer on Ubuntu Thanks for that! You saved me a lot...
- Change background color of TextBox or ComboBox in Windows Forms Hi....
- SQL Server 2005 Update Trigger Effect Multiple Rows Its really helpful...
- Copyright 2010 Vorleak Chy's Blog. All Rights Reserved. Powered by Wordpress | Theme designed by Chris Murphy
- Back To Top
- Home


Leave a Comment-