编码的UI测试-无法解析符号UITesting [英] Coded UI tests - cannot resolve symbol UITesting

查看:85
本文介绍了编码的UI测试-无法解析符号UITesting的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在VS2012项目中使用这样的程序集:

I'm trying to use the assemblies like this in a VS2012 project:

using Microsoft.VisualStudio.TestTools.UITesting;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UITest.Extension;

但是我在测试中得到了一堆红色:

However I get a bunch of red in my tests:

即使有这种红色,我也可以在本地构建和运行,但是如果可能的话,我想解决这个问题.我的构建机器拒绝此错误并出现以下错误:

I can build and run locally even with this red, but I'd like to get this stuff resolving if possible. My build machine rejects this with the following errors:

 DashboardTest.cs (7): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 DashboardTest.cs (9): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.cs (9): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.cs (10): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.Designer.cs (19): The type or namespace name 'UITest' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.Designer.cs (20): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.Designer.cs (132): The type or namespace name 'BrowserWindow' could not be found (are you missing a using directive or an assembly reference?)
 DashboardTest.cs (10): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.cs (12): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.cs (13): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.Designer.cs (22): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 UIMap.Designer.cs (23): The type or namespace name 'UITesting' does not exist in the namespace 'Microsoft.VisualStudio.TestTools' (are you missing an assembly reference?)
 DashboardTest.cs (18): The type or namespace name 'CodedUITest' could not be found (are you missing a using directive or an assembly reference?)
 DashboardTest.cs (18): The type or namespace name 'CodedUITestAttribute' could not be found (are you missing a using directive or an assembly reference?)

有什么秘诀吗?我的测试项目中的所有引用都设置为复制local = true.

Any tips? All references in my test project are set to copy local = true.

更新-通过添加对visualStudio.TestTools.UITesting的引用,我使引用在本地工作,但是CodedUITest属性仍然为红色,并且构建仍然失败,并出现相同的错误.

UPDATE - I got the references working locally by adding a reference to visualStudio.TestTools.UITesting, but the CodedUITest attribute is still red and the build still fails with the same errors.

推荐答案

您需要添加引用,例如以下附件:

You need to add references such as in the following attachment:

这篇关于编码的UI测试-无法解析符号UITesting的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆