?????????????к??Web UI?????????????????WatiN?? Selinimu??WebDriver??????VS2010?е?Coded UI???.  ??Щ???????????Web?е????????????????????????????Web???????????????Щ?????????????????????????IE COM????HTML DOM ??IE????????WEB?????????????
?????????????????Щ????????????  ??????.NET????shdocvm.dll????????IE??????????mshtml.dll????????IE?е? HTML????
???????
?????????????IE COM?????Web??????????????????????????????????????????????????? ????????????Ч??? ????????????WatiN??Щ???????????????????.
???????????
????shdocvm.dll??mshtml.dll?????????COM?????????????dll?????????????????????
????shdocvm.dll ??COM ????????"Microsoft Internet Controls". ???????????Add References->Com Tab-> Microsoft Internet Controls

????mshtml.dll??COM????????"Microsoft.mshtml"?? ???????????Add References-> .NET Tab->Microsoft.mshtml

????????????ú??????????????????
????using mshtml;
????using SHDocVw;
????????IE
???????shdocvm.dll?е?InternetExplorer??????????????? ????Height??Width?????????????IE?????????Щ?????????????????????????С??????????
????
????static void Main(string[] args)
????{     
????InternetExplorer IE = new InternetExplorer();
????IE.Visible = true;
????object nil = new object();
????string CnblogUrl = "http://www.cnblogs.com";
????// ??IE?????????????
????IE.Navigate(CnblogUrl?? ref nil?? ref nil?? ref nil?? ref nil);
????Thread.Sleep(3000);
????// ????IE??????λ??
????IE.Top = 10;
????IE.Left = 10;
????// ????IE???????
????IE.Height = 800;
????IE.Width = 1000;
????// ????????????
????Thread.Sleep(3000);
????string BaiduUrl = "http://www.baidu.com";
????IE.Navigate(BaiduUrl?? ref nil?? ref nil?? ref nil?? ref nil);
????// ?????????
????Thread.Sleep(3000);
????IE.GoBack();
????// ???IE
????Thread.Sleep(3000);
????IE.Refresh();
????// ???IE
????Thread.Sleep(3000);
????IE.Quit();
????}
????
???????IE develop toolbar ??HTML DOM
??????????????????HTML?е????? ??????????????Щ?????id??  ???IE Develop Toolbar????firebug?????????????id.
??????F12???IE Develop Toolbar?? ??????IE???????е?Tools->Develop Tools


????????п????????????е?????textbox??id??"q"
????????IE?е?HTML???
?????????????????????????????????? ????????????????????? ?????"????????"??
???????????mshtml.dll?????getElementById()????????????????HTML???????á? ?????????????????????????????????
????
????static void Main(string[] args)
????{     
????InternetExplorer IE = new InternetExplorer();
????IE.Visible = true;
????object nil = new object();
????string CnblogUrl = "http://www.cnblogs.com";
????// ??IE?????????????
????IE.Navigate(CnblogUrl?? ref nil?? ref nil?? ref nil?? ref nil);
????Thread.Sleep(3000);
????// ???DOM????
????HTMLDocument doc = (HTMLDocument)IE.Document;
????// ???????????????Textbox??id?? "q"
????HTMLInputElement SearchTextBox = (HTMLInputElement)doc.getElementById("q");
????SearchTextBox.value = "С???";
????// ???????????"?????"?????id??"btnBloggerSearch"
????HTMLInputElement SearchButton = (HTMLInputElement)doc.getElementById("btnBloggerSearch");
????SearchButton.click();
????}
???? ????Ч??????: