在自动构建期间运行编码的UI测试和单元测试 [英] Running Coded UI Tests and Unit Tests during an automated build

查看:60
本文介绍了在自动构建期间运行编码的UI测试和单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


 


最近升级到Visual Studio 2010,我一直在玩Coded UI测试。我已经创建了一些,并且在我的工作站上运行时没有任何问题。
但是,当我尝试将这些作为自动构建的一部分包含在内时,他们不会在我的专用构建服务器上运行。自动构建还运行编码Web测试和单元测试,两者都运行良好(已在构建服务器上设置IIS,用于单元
测试使用)。


 


构建服务器是使用带有.NET 4.0的Windows Server 2008 R2(64位)和安装的所有必需的Visual Studio零件。我确保
Team Foundation Build Service正在运行且处于交互模式,并且我已关闭IE增强安全配置。我还设置了‘强制测试以32位进程运行’ testsettings文件中的选项。


 


如果我将主机类型更改为‘默认’在testsettings文件中,Coded UI测试运行正常。但是,我需要将此设置为"ASP.NET’
单位测试工作。


 


在ASP.NET中运行时,编码UI测试的结果总是返回:


 


单元测试适配器引发异常:


无法加载一个或多个请求的类型。检索LoaderExceptions属性以获取更多信息..


 


如果我错过了关键信息,我很抱歉!我已经做了很多搜索,并且无法真正找到解释为什么会发生这种情况的主题…

解决方案

< blockquote>

如果您在Build Agent计算机上运行了Visual Studio 2010 Ultimate或Premium(测试运行的地方),请尝试加载测试项目并从VS IDE运行。如果有效,请告诉我们。


 


Hi all,

 

Having recently upgraded to Visual Studio 2010, I've been playing around with Coded UI tests. I’ve created a few and had no issues when running them on my workstation. However, when I try and include these as part of an automated build, they won’t run on my dedicated build server. The automated build also runs Coded Web Tests and Unit Tests, both of which run fine (IIS has been setup on the build server for the Unit Tests to use).

 

The build server is using Windows Server 2008 R2 (64-bit) with .NET 4.0 and all of the necessary Visual Studio bits and pieces installed. I’ve made sure that Team Foundation Build Service is running and is in interactive mode, and I’ve switched off IE Enhanced Security Configuration. I’ve also set the ‘Force tests to run in 32 bit process’ option inside the testsettings file.

 

If I change the Host type to ‘Default’ within the testsettings file, the Coded UI tests run fine. However, I need to have this set to ‘ASP.NET’ for the Unit Tests to work.

 

When running in ASP.NET, the results for the Coded UI tests always come back as:

 

Unit Test Adapter threw exception:

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..

 

Sorry if I’ve missed out crucial information! I’ve done a lot of searching and can’t really find any topics that explain why this is happening…

解决方案

If you have Visual Studio 2010 Ultimate or Premium installed on your Build Agent machine (where your tests run), please try loading your test project and run from VS IDE. let us know if this works.

 


这篇关于在自动构建期间运行编码的UI测试和单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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