6

Tôi đang cố gắng sử dụng các hội đồng như thế này trong một dự án VS2012:kiểm tra UI Coded - không thể giải quyết biểu tượng UITesting

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

Tuy nhiên tôi nhận được một loạt các màu đỏ trong các thử nghiệm của tôi:

enter image description here

Tôi có thể tạo và chạy cục bộ ngay cả với màu đỏ này, nhưng tôi muốn giải quyết vấn đề này nếu có thể. Máy xây dựng của tôi từ chối điều này với các lỗi sau:

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?) 

Bất kỳ mẹo nào? Tất cả các tham chiếu trong dự án thử nghiệm của tôi được thiết lập để sao chép local = true.

CẬP NHẬT - Tôi nhận các tham chiếu hoạt động cục bộ bằng cách thêm tham chiếu đến visualStudio.TestTools.UITesting, nhưng thuộc tính CodedUITest vẫn còn màu đỏ và bản dựng vẫn không thành công với cùng lỗi.

+3

Bạn có sử dụng VS2012 Ultimate hoặc VS2012 Premium không? Giao diện người dùng được mã hóa chỉ chạy trên các IDE này. – neoscribe

Trả lời

7

Bạn cần phải thêm một tham chiếu đến: Microsoft.VisualStudio.QualityTools.CodedUITestFramework

+2

Chính xác những gì tôi đang tìm kiếm, không gian tên trên thuộc tính là gây hiểu nhầm :) – squirrel

+0

cảm ơn, đã làm việc!)) – BMaximus

7

Bạn cần phải thêm tài liệu tham khảo chẳng hạn như trong tập tin đính kèm sau đây:

enter image description here

+2

Tôi cần thêm tất cả các tham chiếu được xác định ở đây vì vậy đây là thông tin hữu ích. Cảm ơn –

+5

wtf arent những tự động được thêm vào khi bạn tạo dự án !!! –

0

Trong VS2017 tôi đã phải sử dụng Trình cài đặt Visual Studio để cài đặt thành phần "Kiểm tra giao diện người dùng được mã hóa" trên máy chủ xây dựng của tôi. Nó được tìm thấy trên tab "Thành phần riêng lẻ" trong phần "Gỡ lỗi và thử nghiệm".

Các vấn đề liên quan