我正在使用teamcity运行一些测试用例。它正在成功保存文本文件中的数据,但是当我尝试从同一位置读取该数据时,它会发出以下错误
SetUp方法失败。 System.Runtime.InteropServices.COMException: 使用CLSID创建COM组件的实例 来自IClassFactory的{0002DF01-0000-0000-C000-000000000046}失败 由于以下错误:800704a6。在 WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri,LogonDialogHandler logonDialogHandler,Boolean createInNewProcess)at WatiN.Core.IE..ctor()
并用System.String[]
替换保存的数据。还试图给用户所有的permisssions但仍然无法解决它。请帮忙。
我也启用了大多数IE8设置。知道是什么导致了这个
以下是构建日志
[11:50:09]: NUnit report watcher
[11:50:09]: [NUnit report watcher] Watching paths: <no paths>
[11:50:09]: Project "Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target(s)): (2m:10s)
[11:50:13]: Tests.dll (2m:06s)
[11:52:19]: [Tests.dll] Tests.bTests
[11:52:19]: [Tests.bTests] SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6.
[11:52:19]: [Tests.bTests] SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6.
at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, LogonDialogHandler logonDialogHandler, Boolean createInNewProcess)
at WatiN.Core.IE..ctor()
at Tests.bTests.Setup() in Z:\TestProjects\Tests\Tests\bTests.vb:line 14
[11:52:20]: Some tests has failed in Z:\TestProjects\Tests\Tests\bin\Release\Tests.dll, tests run continued. Child test failed
[11:52:20]: 1 Test(s) failed.
[11:52:20]: [Project "Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target(s)):] Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx(17, 5): c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp exited with code 1.
[11:52:20]: MSBuild output:
[11:52:20]: CoreResGen:
[11:52:20]: All outputs are up-to-date.
[11:52:20]: CoreCompile:
[11:52:20]: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics /optionstrict:custom /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /nostdlib /rootnamespace:Tests /sdkpath:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /doc:obj\Release\Tests.xml /define:"CONFIG=\"Release\",TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:"C:\Program Files (x86)\NUnit 2.4.8\bin\nunit.framework.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll","C:\Program Files (x86)\WatiN\bin\WatiN.Core.dll" /debug:pdbonly /optimize+ /out:obj\Release\Tests.dll /resource:obj\Release\Tests.Resources.resources /target:library aTests.vb bTests.vb cAmendmentTests.vb Functions.vb dCancelRefundTests.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb" "C:\BuildAgent\temp\buildTmp\.NETFramework,Version=v4.0.AssemblyAttributes.vb"
[11:52:20]: _CopyAppConfigFile:
[11:52:20]: Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
[11:52:20]: CopyFilesToOutputDirectory:
[11:52:20]: Copying file from "obj\Release\Tests.dll" to "bin\Release\Tests.dll".
[11:52:20]: Tests -> Z:\TestProjects\Tests\Tests\bin\Release\Tests.dll
[11:52:20]: Copying file from "obj\Release\Tests.pdb" to "bin\Release\Tests.pdb".
[11:52:20]: Copying file from "obj\Release\Tests.xml" to "bin\Release\Tests.xml".
[11:52:20]: Done Building Project "Z:\TestProjects\Tests\Tests\Tests.vbproj" (default targets).
[11:52:20]: Done Building Project "Z:\TestProjects\Tests\Tests.sln" (default targets).
[11:52:20]: TeamCity_Generated_NUnitTests:
[11:52:20]: c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp
[11:52:20]: Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx(17,5): error : c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp exited with code 1.
[11:52:20]: Done Building Project "Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target(s)) -- FAILED.
[11:52:20]: Build FAILED.
[11:52:20]: "Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target) (1) ->
[11:52:20]: (TeamCity_Generated_NUnitTests target) ->
[11:52:20]: Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx(17,5): error : c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp exited with code 1.
[11:52:20]: 0 Warning(s)
[11:52:20]: 1 Error(s)
[11:52:20]: Time Elapsed 00:02:10.92
[11:52:20]: Build finished
答案 0 :(得分:6)
不确定这是否已经解决,但我在用C#编写的另外两个不同的测试装置1中遇到了同样的错误,另一个用VB.NET编写。
对于C#fixture我需要做的就是解决这个问题,当我创建一个新的WatIn.IE实例时,我将第二个参数添加到:IE var ie = new IE(url, true ) “true”告诉WatIn“createInNewProcess”,它在新进程中打开下一个IE。
然而,由于某种原因,这对于用VB.NET编写的测试夹具不起作用。 对于这个fixture,我不得不在我们的一个C#库中调用一个方法来强制每个Tests“TearDown”方法中的IE闭包。 以下C#代码实现了这一诀窍:
public static void CloseInternetExplorers()
{
var processes = from process in Process.GetProcesses()
where process.ProcessName == "iexplore"
select process;
foreach (var process in processes)
{
while (!process.HasExited)
{
process.Kill();
process.WaitForExit();
}
}
}
答案 1 :(得分:2)
答案 2 :(得分:0)