TestStack.White

参考:http://teststack.azurewebsites.net/White/GettingStarted.html
 
1. 使用VS2010以上版本
 
因为TestStack.White是通过NuGet进行安装的。而NuGet最低仅支持VS2010
 
这里安装到是VS2012
 
2.在VS2012里面安装 NuGet
http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c可以直接下载NuGet
下载后的文件NuGet.Tools.vsix,可以直接双击安装即可。
 
 
3. 使用NuGet安装TestStack.White
 
1)新建一个C#的工程,这里新建了一个Window控制台程序
 
2)右键工程,可以看到下图
3)打开NuGet后,点击“联机”,搜索white,就可以找到TestStack.White,安装即可。
 
安装后:
4)使用White,GetStart里面的代码,无法识别的标示符,直接用VS的解析功能引入头文件。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TestStack.White;
using TestStack.White.Factory;
using TestStack.White.UIItems.WindowItems;
namespace ConsoleApplication1
{
    class Program
    {
        
        static void Main(string[] args)
        {
            Application application = Application.Launch("notepad++.exe");   //先打开notepad++程序
            Window window = application.GetWindow("bar"InitializeOption.NoCache);
        }
                
    }
}


来自为知笔记(Wiz)


posted on 2013-10-06 20:27  修炼思维  阅读(1230)  评论(0编辑  收藏  举报