首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何利用Specrun实现NUnit的并行执行

如何利用Specrun实现NUnit的并行执行
EN

Stack Overflow用户
提问于 2016-10-14 12:28:04
回答 1查看 839关注 0票数 1

我安装了以下NuGets : Specflow.Nunit、specflow、Specrun.Nunit和NUnit 2.6.3。我正在尝试执行runtests.cmd(由specrun.nunit自动生成),但是我得到了以下错误:

TechTalk.SpecRun.Framework.SpecRunException:至少有一个测试线程被中止。--> System.Reflection.TargetInvocationException:调用的目标引发了异常。-> System.MissingMethodException:方法未找到:'Void TechTalk.SpecRun.SpecRunner.Initialize()‘。我的default.srprofile包含:

代码语言:javascript
复制
  <?xml version="1.0" encoding="utf-8"?>
    <TestProfile xmlns="http://www.specrun.com/schemas/2011/09/TestProfile">
      <Settings projectName="<PROJECTNAME>" projectId="{------}" />
      <Execution stopAfterFailures="3" testThreadCount="2" testSchedulingMode="Sequential" />
      <!-- For collecting by a SpecRun server update and enable the following element. For using the 
          collected statistics, set testSchedulingMode="Adaptive" attribute on the <Execution> element.
        <Server serverUrl="http://specrunserver:6365" publishResults="true" />
      -->
      <TestAssemblyPaths>
        <TestAssemblyPath>projectname.dll</TestAssemblyPath>
      </TestAssemblyPaths>
      <DeploymentTransformation>
        <Steps>`enter code here`
          <!-- sample config transform to change the connection string-->
          <!--<ConfigFileTransformation configFile="App.config">
            <Transformation>
              <![CDATA[<?xml version="1.0" encoding="utf-8"?>
                                <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
                    <connectionStrings>
                      <add name="MyDatabase" connectionString="Data Source=.;Initial Catalog=MyDatabaseForTesting;Integrated Security=True" 
                           xdt:Locator="Match(name)" xdt:Transform="SetAttributes(connectionString)" />
                    </connectionStrings>
                                </configuration>
                            ]]>
            </Transformation>
          </ConfigFileTransformation>-->
        </Steps>
      </DeploymentTransformation>
    </TestProfile>

同样在VS输出窗口上,我得到了这个错误:无法加载文件或程序集'TechTalk.SpecRun、Version=1.3.0.76、Culture=neutral、PublicKeyToken=d0fc5cc18b3b389b‘或其依赖项之一。系统找不到指定的文件。,有人能帮我一下吗?

EN

回答 1

Stack Overflow用户

发布于 2018-02-01 06:14:22

您将更改此字符串:

代码语言:javascript
复制
      <RelocateConfigurationFile target="CustomConfig.{TestThreadId}.config" />
      <ConfigFileTransformation configFile="App.config">

完整答案:https://github.com/techtalk/SpecFlow/issues/954

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40043161

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档