51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3011|回复: 0
打印 上一主题 下一主题

[原创] Coded Ui 和 WatiN 的不同之处 <第一部分>

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2011-10-20 23:29:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 v_dozhan 于 2011-10-20 23:36 编辑

CodedUIWatiN
Whether Open Source NoYes
Supported Languages All .Net LanguageAll .Net Language
Supported BrowsersIE, FireFox 3.XIE,
FF2.X, FF3.X(Need to install jssh-WINNT-3.5.xpi),
Chrome
Automate all major HTML element with easeYesYes Mapping Link:
http://watin.org/documentation/element-class-mapping-table/
Find element by multiple attributesYesYes
Find.ById(); Find.ByIndex();Find.ByLabelText();Find.ByName(); etc.
Native support for Page and Control modelYesYes
Supports AJAX website testingYesYes
Supports creating screenshots of webpages Seem No.Yes
Supports frames (cross domain) and iframesYesYes
Handles popup dialogs like alert, confirm, login etc..YesYes
Supports HTML dialogs(modal and modeless)YesYes
Easy to integrate with your favorite(unit) test toolYesYes
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:
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-14 15:27 , Processed in 0.066678 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表