最近我们发现集成测试意外失败,出现以下异常:
我们甚至记得我们对TFS BDT工作流程和测试用例没有任何更改。
错误异常:
调用测试类的初始化方法时出错 UITestDemo.UITestDemo01: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: To 运行与桌面交互的测试,您必须设置测试 代理作为交互式进程运行。更多信息请参阅"如何 以:设置测试代理以运行与 桌面"(http://go.microsoft.com/fwlink/?LinkId=255012(如果你是 将测试作为团队构建的一部分运行,还必须设置 生成代理以作为交互式进程运行。欲了解更多信息, 请参阅"如何:在生成 应用程序"(http://go.microsoft.com/fwlink/?LinkId=254735(
错误堆栈跟踪:
Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize(( Microsoft.VisualStudio.TestTools.UITesting.CodedUITestExtensionExecution.BeforeTestInitialize(Object sender, BeforeTestInitializeEventArgs e( Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecution.RaiseBeforeTestInitialize(BeforeTestInitializeEventArgs 参数( Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestExecuter.RunInitializeMethod((
我们不知道如何解决它。
经过调查,我们发现测试是按帐户运行的:环境中的"computerName$">,而不是测试控制器设置中的指定帐户。
<?xml version="1.0" encoding="utf-8"?>
<SystemInformation>
<ComputerName>ComputerName</ComputerName>
<UserName>ComputerName$</UserName>
<UserDomainName>WORKGROUP</UserDomainName>
<OSInfo>
<OSName>Microsoft Windows Server 2008 R2 Enterprise </OSName>
<OSVersion>Microsoft Windows NT 6.1.7601 Service Pack 1</OSVersion>
<SystemDirectory>C:Windowssystem32</SystemDirectory>
<SystemLocale>English (United States)</SystemLocale>
<UserLocale>English (United States)</UserLocale>
</OSInfo>
<ProcessorInfo>
<Processor0>
<ProcessorName>Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz</ProcessorName>
<ProcessorFamily>Intel64 Family 6 Model 62 Stepping 4</ProcessorFamily>
<ProcessorSpeed>2999</ProcessorSpeed>
</Processor0>
<Error>NoError</Error>
</ProcessorInfo>
<MemoryInfo>
<TotalPhysicalMemory>4945</TotalPhysicalMemory>
<AvailablePhysicalMemory>1541</AvailablePhysicalMemory>
<MemoryLoad>68</MemoryLoad>
<TotalVirtualMemory>2047</TotalVirtualMemory>
<AvailableVirtualMemory>1432</AvailableVirtualMemory>
<Error>NoError</Error>
</MemoryInfo>
<ScreenInfo>
<ScreenHeight>768</ScreenHeight>
<ScreenWidth>1024</ScreenWidth>
<BitsPerPixel>32</BitsPerPixel>
</ScreenInfo>
<IEInfo>
<IEVersion>11.0.9600.16428</IEVersion>
<Error>NoError</Error>
</IEInfo>
</SystemInformation>
溶液:我们在 MTM 测试设置管理器中打开使用测试设置。并重新检查每个环境是否应该在正确的角色上运行测试。
然后重新测试运行通过。