CodedUI测试基本失败 [英] CodedUI tests fail on basics

查看:74
本文介绍了CodedUI测试基本失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定使用哪个特定论坛,因为它与VS 2013.3上的CodedUI有关,也没有"Visual Studio单元测试"也不是"VS2010和VS2012中的测试工具";似乎合适.所以我只使用一般论坛.如果有错,请重定向我.

我们的麻烦是,当前我们的测试主要是好的,但是我们有一台使用VS2013 Ultimate的计算机在导航控制树时似乎在内部Microsoft.VisualStudio.TestTools.UITest.Extension代码中失败.测试失败,并出现NullRef异常 在最基本的步骤上,例如WaitForControlReady()或[...].TryFind().

从我的角度来看,堆栈中最重要的部分是

StackTrace:   
在System.Reflection.RuntimeAssembly._nLoad(AssemblyName文件名,字符串codeBase,证据AssemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& amp; Mark,IntPtr pPrivHostBinder,布尔throwOnFileNotFound,布尔自省,布尔 hibitSecurityChecks)
在System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly处(字符串名称,CultureInfo文化,版本版本,布尔型throwOnFileNotFound,StackCrawlMark& stackMark)
  在System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture,StackCrawlMark& stackMark)
  在System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet处(CultureInfo文化,Dictionary`2 localResourceSets,布尔tryParents,布尔createIfNotExists,StackCrawlMark& stackMark)
  在System.Resources.ResourceManager.InternalGetResourceSet处(CultureInfo requestCulture,布尔值createIfNotExists,布尔值tryParents,StackCrawlMark和stackMark)
  在System.Resources.ResourceManager.InternalGetResourceSet处(CultureInfo文化,布尔型createIfNotExists,布尔型tryParents)
  在System.Resources.ResourceManager.GetString(字符串名称,CultureInfo文化)
  在Microsoft.VisualStudio.TestTools.UITest.Extension.Resources.Messages.get_ControlNotFoundWithQidOrCondition()

它更长,因此,如果您需要更多详细信息,请告诉我.

就在几分钟前,我在一个封闭的Connect项目中找到了这个确切的StackTrace,网址为https://connect.microsoft.com/VisualStudio/feedback/details/846439/ui-test-fails-with-nullreferenceexception-in- update-2-rc

但是,由于这是有关Update 2 RC的,并且已经关闭,所以我本以为Update 3 RTM不会发生这种情况.

任何想法在这里会出什么问题吗?可能是计算机本身还是Visual Studio安装程序,因为完全相同的代码不会在其他计算机上像这样失败,并且代码来自TFS存储库.

欢呼

Daniel

解决方案

丹尼尔,

VS General Question论坛主要讨论Visual Studio IDE的用法,例如 WPF& SL设计器,Visual Studio指导自动化工具包,开发人员文档和帮助系统 Visual Studio编辑器.您的问题与编码的UI测试运行更相关,我认为VS2010和VS2012的测试工具仍然是比VS一般论坛更好的论坛,因此我 将此线程移到了这里.

根据您的描述,相同的代码可以在其他计算机上正常运行,而其他计算机是否与此问题计算机具有相同的VS版本?我觉得您是否在其他计算机上都在此计算机上安装了VS2013 Update 3 有VS2013 Update 3吗?

非常感谢您在此线程中发布了一些堆栈信息,但是堆栈未报告任何有用的信息.我们可以从测试资源管理器"窗口和编码的UI测试" HTML日志中获取详细的错误消息,请参考: 分析编码的UI使用编码的UI测试日志进行测试

基于此消息: Microsoft.VisualStudio.TestTools.UITest.Extension.Resources.Messages.get_ControlNotFoundWithQidOrCondition(),它似乎无法通过ID或其他方式找到控件 特性.我怀疑这台机器上某些属性的值已更改,这导致找不到控件.这个博客描述了类似的情况: 现在,您需要通过测试浏览器"或编码的UI测试html日志找到未找到哪个控件.此外,您还可以调试编码的UI测试以检查错误发生的位置,然后可以检查该错误发生的控件 您可以根据报告的错误进行故障排除.

最好的问候,


Hi,

not sure which specific forum to use as this is about CodedUI on VS 2013.3 and neither "Visual Studio Unit Testing" nor "Test tools in VS2010 and VS2012" seemed appropriate. So I just use the general forum. Please redirect me if wrong.

Our trouble is that currently our tests are mainly fine but we have one machine using VS2013 Ultimate that seems to fail in internal Microsoft.VisualStudio.TestTools.UITest.Extension code when navigating the control tree. The tests fail with a NullRef exception on the most basic steps like WaitForControlReady() or [...].TryFind().

From my perspective the most significant part of the stack is

StackTrace:    
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)
   at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)
   at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
   at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
   at Microsoft.VisualStudio.TestTools.UITest.Extension.Resources.Messages.get_ControlNotFoundWithQidOrCondition()

It is longer, so let me know if you need more detail.

Just a couple of minutes ago I found this exact StackTrace in a closed Connect item at https://connect.microsoft.com/VisualStudio/feedback/details/846439/ui-test-fails-with-nullreferenceexception-in-update-2-rc

But since this was about Update 2 RC and is closed I would have thought it should not happen with Update 3 RTM.

Any ideas what could go wrong here? It might as well be the machine itself or Visual Studio setup as the exact same code does not fail like this on other machines, with the code coming from a TFS repo.

Cheers

Daniel

解决方案

Hi Daniel,

VS General Question forum mainly discusses the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System and Visual Studio Editor. Your issue is more related to Coded UI test run, I think that Test Tools for VS2010 and VS2012 still is a better forum than VS general forum, so I moved this thread here.

Based on your description, the same code can run fine on other machines, whether other machines have the same VS version with this problematic machine? I feel you installed VS2013 Update 3 on this machine, whether other machines have VS2013 Update 3?

Very thank you for posting some stack information in this thread, but the stack did not report any useful information. We can get detailed error messages from Test Explorer window and the Coded UI Test html log, reference: Analyzing Coded UI Tests Using Coded UI Test Logs

Based on this message: Microsoft.VisualStudio.TestTools.UITest.Extension.Resources.Messages.get_ControlNotFoundWithQidOrCondition(), it seems that a control could not be found through the ID or some other properties. I doubt the value of some properties was changed on this machine, which caused the control was not found. This blog described a similar situation: Smart Match & Slow Coded UI Tests

Now you need to find which control was not found through the Test Explorer or coded UI test html log. Also you can debug the coded UI test to check where the error occur, then you can check which control this error occurs, moreover you can troubleshoot it based on the reported error.

Best regards,


这篇关于CodedUI测试基本失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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