| CodedUI | WatiN |
Whether Open Source | No | Yes |
Supported Languages | All .Net Language | All .Net Language |
Supported Browsers | IE, FireFox 3.X | IE,
FF2.X, FF3.X(Need to install jssh-WINNT-3.5.xpi),
Chrome |
Automate all major HTML element with ease | Yes | Yes Mapping Link:
http://watin.org/documentation/element-class-mapping-table/ |
Find element by multiple attributes | Yes | Yes
Find.ById(); Find.ByIndex();Find.ByLabelText();Find.ByName(); etc. |
Native support for Page and Control model | Yes | Yes |
Supports AJAX website testing | Yes | Yes |
Supports creating screenshots of webpages | Seem No. | Yes |
Supports frames (cross domain) and iframes | Yes | Yes |
Handles popup dialogs like alert, confirm, login etc.. | Yes | Yes |
Supports HTML dialogs(modal and modeless) | Yes | Yes |
Easy to integrate with your favorite(unit) test tool | Yes | Yes |
Whether Support Record? | Yes, Support IE well. With the tool Coded UI Test Builder. | Yes, There is a plug-in WaitN Test Recorder. Current support IE, FireFox |
Whether run cases successfully after minimize browser window? | No. | Yes. |
Example-Code:
(How to open a new page?) | #region Open a new page BrowserWindow bw = BrowserWindow.Launch("http://msdn.microsoft.com");bw.Maximized = true;#endregion#region operate controlsHtmlDocument htmlDoc = new
HtmlDocument(bw);HtmlEdit searchEditor = new
HtmlEdit(htmlDoc);searchEditor.SearchProperties[HtmlEdit.PropertyNames.Name] = "query";searchEditor.Text = "Coded UI Sample";HtmlInputButton submit = new
HtmlInputButton(htmlDoc);submit.SearchProperties[HtmlInputButton.PropertyNames.Class] = "SearchButton";Mouse.Click(submit);#endregion#region Add assert statementAssert.IsTrue(bw.Uri.AbsoluteUri.Contains("Coded"),bw.Uri.AbsolutePath);#endregion | IE:
using (Browser msdnHomePage = new
IE("http://msdn.microsoft.com")) {}Firefox3.5: (installed jssh-WINNT-3.5.xpi)FireFox ff = new
FireFox("http://msdn.microsoft.com");ff.TextField(Find.ByName("query")).TypeText("system.xml");
Chrome: |