Code UI Test -- 手动编写Coded UI Test(existing browser)
2012-07-03 18:15
393 查看
目的: 手动编写代码,在已经打开的浏览器中, 在文本框输入2012/03/03。 //通过进程名字获取进程(数组) Process[] processes = Process.GetProcessesByName("iexplore"); // 获取进程ID //Window Title 可以使用Coded UI Test Builder 获取 int intProcessID = 0; for (int i = 0; i < processes.Length; i++) { if (processes[i].MainWindowTitle == "10.2.8.18 - Windows Internet Explorer") { intProcessID += i; } } //使用上面获得的进程初始化浏览器窗口 BrowserWindow browserWindow = BrowserWindow.FromProcess(processes[intProcessID]); //通过搜索相关属性获取控件 UITestControl uIEffectiveDateEdit = new UITestControl(browserWindow); uIEffectiveDateEdit.TechnologyName = "Web"; uIEffectiveDateEdit.SearchProperties.Add(HtmlEdit.PropertyNames.ClassName, "HtmlTextBox"); uIEffectiveDateEdit.SearchProperties.Add(HtmlEdit.PropertyNames.FriendlyName, "Effective Date"); uIEffectiveDateEdit.Text = "2012/03/03";
Any Issues, please feel free to tell me.
相关文章推荐
- Coded UI 英文资料大全 -Content Index for Coded UI Test
- Coded UI Test在Windows Vista、2003和2008上需要Windows Automation API 3.0(转)
- Coded UI Test--Method of search control
- 持续集成实践:使用Visual Studio 2010 Coded UI Test 制作能自动安装/卸载UI应用的程序
- CodeUI Test:UIMap录制文件分析一
- How does “Coded UI test” finds a control ?
- Coded UI Test在Windows Vista、2003和2008上需要Windows Automation API 3.0
- Coded UI Test(二)创建一个Coded UI Test
- 代码里手动编写UI
- Coded UI Test 同时执行多个测试用例不必每次都关闭浏览器
- 如何将code ui test的测试结果加入到work item
- Code UI Automation脱离VS黑盒自动化测试工具编写
- Coded UI Test(一)概述
- CodeUI Test:创建第一个CodeUI Test
- 如何打开Coded UI Test Builder
- VisualStudio 自动化测试框架 - Coded UI Test
- Coded UI Test中的数据驱动测试
- Series on Coded UI Test Extensibility
- password in Coded UI Test
- Code UI Test中测试code coverage需要什么条件?