Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 从目标机器执行编码的UI测试';MSS测试(独立)。Dll';需要s/文件!!:(_Unit Testing_Visual Studio 2012_Mstest_Coded Ui Tests - Fatal编程技术网

Unit testing 从目标机器执行编码的UI测试';MSS测试(独立)。Dll';需要s/文件!!:(

Unit testing 从目标机器执行编码的UI测试';MSS测试(独立)。Dll';需要s/文件!!:(,unit-testing,visual-studio-2012,mstest,coded-ui-tests,Unit Testing,Visual Studio 2012,Mstest,Coded Ui Tests,我在目标计算机上设置了mstest作为独立程序,而没有安装visual studio。因此,我将mstest所需的文件(*.exe,dll)复制到目标计算机上,并在gac中注册mstest运行单元测试所需的所有dll 到目前为止,在正常的单元测试中工作正常。 实际上,我尝试将mstest设置为运行编码的ui测试。我已将一些新的dll复制到目标计算机: - Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll - Microsof

我在目标计算机上设置了mstest作为独立程序,而没有安装visual studio。因此,我将mstest所需的文件(*.exe,dll)复制到目标计算机上,并在gac中注册mstest运行单元测试所需的所有dll

到目前为止,在正常的单元测试中工作正常。

实际上,我尝试将mstest设置为运行编码的ui测试。我已将一些新的dll复制到目标计算机:

- Microsoft.VisualStudio.QualityTools.CodedUITestFramework.dll
- Microsoft.VisualStudio.TestTools.UITest.Common.dll,TestTools.UITest.Extensions.dll
- Microsoft.VisualStudio.TestTools.UITesting.dll
- Microsoft.VisualStudio.HostingProcess.Utilities.Sync
但是,当我尝试在目标计算机上通过mstest.exe对cmd.exe执行测试时,测试将运行,但总是失败(在我的本地计算机Visual Studio 2012上运行良好)。这是一个非常简单的测试:

  - just click on "Start", 
  - type in "calc press enter" 
两台机器使用相同的操作系统

我想MSTest.exe仍然需要一些dll来执行代码测试。糟糕的是,缺少的dll没有显示在cmd.exe中,没有错误,没有提示,什么都没有:/
测试运行正常,但会使所有测试失败

cmd输出:

Microsoft (R) Test Execution Command Line Tool Version 11.0.50727.1
Copyright (c) Microsoft Corporation. All rights reserved.

Loading D:\Users\Jenkins\Desktop\CodedUITestProject1\CodedUITestProject1\bin\Debug\CodedUITestProject1.dll...
Starting execution...

Results               Top Level Tests
-------               ---------------
Failed                CodedUITestProject1.CodedUITest1.CodedUITestMethod1
0/1 test(s) Passed, 1 Failed

Summary
-------
Test Run Failed.
  Failed  1
  ---------
  Total   1
Results file:  C:\VS2011Stub\Common7\IDE\TestResults\Jenkins_MSGP166C 2013-05-24 12_36_28.trx
Test Settings: Default Test Settings

有人知道mstest.exe需要哪些文件才能以正确的方式运行codeduitests吗?

编辑:我检查了*.trx文件,并将丢失的dll复制到我的目标机器上

我尝试再次运行测试,但再次失败。我再次检查trx文件,收到一条非常棒的消息:/

  <Results>
    <UnitTestResult executionId="4652eeb1-e1b4-4782-a288-dbd4bb0bda5a" testId="484ddbfe-fdc6-0f5d-9e7b-bab4da5b5905" testName="CodedUITestMethod1" computerName="MSGP166C" duration="00:00:00.0887388" startTime="2013-05-24T16:30:24.1716290+02:00" endTime="2013-05-24T16:30:24.6266745+02:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Failed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="4652eeb1-e1b4-4782-a288-dbd4bb0bda5a">
      <Output>
        <ErrorInfo>
          <Message>Error calling Initialization method for test class CodedUITestProject1.CodedUITest1: System.IO.FileNotFoundException: Das System kann die angegebene Datei nicht finden. (Ausnahme von HRESULT: 0x80070002)</Message>
          <StackTrace>    bei System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   bei System.Reflection.Assembly.LoadFile(String path)
   bei Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager.LoadAssembly(String assemblyFile)
</StackTrace>
        </ErrorInfo>
      </Output>
    </UnitTestResult>
  </Results>

调用测试类CodedUITestProject1.CodedUITest1的初始化方法时出错:System.IO.FileNotFoundException:Das System kann die ANGEBENE Datei nicht finden。(Ausnahme von HRESULT:0x80070002)
bei System.Reflection.RuntimeAssembly.nLoadFile(字符串路径,证据)
bei System.Reflection.Assembly.LoadFile(字符串路径)
bei Microsoft.VisualStudio.TestTools.UITest.Framework.UITestExtensionPackageManager.LoadAssembly(字符串汇编文件)
那么现在缺少什么组件呢???没有提到




提前感谢

我将安装VS测试代理,而不是试图通过DLL进行复制。它比visual studio轻得多,可以让您进行mstest。这是我在测试机器上运行CodedUI测试时使用的方法

  • 下载在其中构建项目的测试代理的版本。 (其实没关系)
  • 打开安装程序时将有3个选项。您需要测试代理
  • 您现在应该拥有mstest和codedui所需的一切
  • 另一个有效的方法是将所有codedui测试放入一个有序的测试中,并将其传递到mstest中

    MSTest/TestContainer:OrderedTest1.orderedtest


    应该这样做吗?

    当测试失败时,你没有得到任何错误或异常吗?没有,它只是说codeduitest.dll中的测试失败了:/通过VS打开
    .trx
    文件以查看错误。它应该在其中可见。有许多事情必须配置,并且有许多原因导致测试失败。如果你不给我们任何提示,请取消幸运的是,我们无法帮助您。是的,我现在检查了这个文件,并将所需的dll复制到了我的目标计算机上。但是我在下一个trx文件中仍然得到了一个FileNotFoundException,内容非常棒:调用测试类CodedUITestProject1.CodedUITest1:System.IO.FileNotFoundException:Das System kann die Angebene Datei nich的初始化方法时出错t finden.(ausname von HRESULT:0x80070002):(程序集缺失???????正常异常如下所示:调用测试类CodedUITestProject1.CodedUITest1:System.IO.FileNotFoundException:Die Date Order Assembly的初始化方法时出错“Microsoft.VisualStudio.Diagnostics.Measurement,Version=11.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”是davon wurde nicht gefunden.Das系统的一部分。但它没有说明在新的trx文件中找不到哪个文件:/