如何在没有VS2010旗舰版的计算机上运行编码的UI测试



我在VS2010(旗舰版)中创建了一个CodedUI测试,并将此测试从一个控制台应用程序(在相同的 .Net Framework 4 中构建)。这在我的机器或任何其他安装了VS2010旗舰版的机器上运行良好。当我尝试在没有VS2010 Ultimate的32位机器上运行CodedUI测试时,它抛出以下错误:

Unhandled Exception: Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException: Cannot perform '' on the control. Additional Details: 
The control details were not specified. ---> System.Runtime.InteropServices.COMException:
 Retrieving the COM class factory for component with CLSID {6DA215C2-D80D-42F2-A
514-B44A16DCBAAA} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
   at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.InitPlayback()
   at Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize()
   --- End of inner exception stack trace ---
   at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
   at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, IPlaybackContext context)
   at Microsoft.VisualStudio.TestTools.UITesting.Playback.Initialize()
   at CitrixLANConsole.Program.Main(String[] args) in c:users<username>documentsvisual studio 2010ProjectsCitrixLANConsoleCitrixLANConsoleProgram.cs:
line 27.

谁能告诉我如何在没有安装VS2010旗舰版的机器上运行测试?

我认为您的问题出在平台目标上:您正在尝试32-bit系统上运行x64代码。更改应用程序的Target Platform并再次运行测试。

问题的原因是您试图在测试中操纵错误的类。


嗯,我认为Ultimate包中有一些东西是您在其他机器上无法获得的。不能从堆栈跟踪中确定,但请尝试找到您缺少的类并将其放在GAC中。

regsvr32没有这样做的原因是 .NET 库尝试在 GAC 中查找所需的库,而不是在某些寄存器条目中。查看有关 MSDN 的更多信息。

最新更新