如何使用Specrun for NUnit实现并行执行
我已经安装了以下NUGET:Specflow.Nunit、Specflow、Specrun.Nunit以及Nunit 2.6.3。 我正在尝试执行runtests.cmd(由specrun.nunit自动生成),但出现以下错误:如何使用Specrun for NUnit实现并行执行,nunit,specflow,specrun,Nunit,Specflow,Specrun,我已经安装了以下NUGET:Specflow.Nunit、Specflow、Specrun.Nunit以及Nunit 2.6.3。 我正在尝试执行runtests.cmd(由specrun.nunit自动生成),但出现以下错误: <?xml version="1.0" encoding="utf-8"?> <TestProfile xmlns="http://www.specrun.com/schemas/2011/09/TestProfile">
<?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>
TechTalk.SpecRun.Framework.SpecRunException:至少有一个测试线程中止。-->System.Reflection.TargetInvocationException:调用的目标已引发异常。-->System.MissingMethodException:找不到方法:“Void TechTalk.SpecRun.SpecRunner.Initialize()”。
My default.srprofile包含:
<?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>
projectname.dll
`在这里输入代码`
在VS输出窗口中,我也遇到了以下错误:
无法加载文件或程序集“TechTalk.SpecRun,版本=1.3.0.76,区域性=中性,PublicKeyToken=D0FC5CC18B389B”或其依赖项之一。系统找不到指定的文件。
有人能帮我吗?您想更改此字符串:
<RelocateConfigurationFile target="CustomConfig.{TestThreadId}.config" />
<ConfigFileTransformation configFile="App.config">
完整答案:
要更改此字符串,请执行以下操作:
<RelocateConfigurationFile target="CustomConfig.{TestThreadId}.config" />
<ConfigFileTransformation configFile="App.config">
完整答案:
我认为selenium和bdd标签在这里是不必要的,没有任何selenium或bdd专家可能能够帮助解决这个特定的问题运行特定的问题您可以发布NuGet软件包的确切版本和一些测试代码吗?@AndreasWillich我能够解决这个问题,版本中存在一些冲突。我现在能够并行运行场景。我们可以并行运行功能文件吗?到目前为止,我有很多功能文件,线程随机选取场景。但是我希望线程并行执行特性。此外,我正在使用specRun评估版本。是否存在天数限制或只是延迟?@NRT:为什么要并行执行这些功能?一个特性是一组场景。并行运行一个功能或并行运行其中的所有场景之间的区别是什么?评估版本功能齐全。它只在执行开始时添加延迟。但是我们最好在SpecFlow+板上讨论这个问题:我认为selenium和bdd标签在这里是不必要的,没有任何selenium或bdd专家可能能够帮助解决这个特定于运行的问题您可以发布NuGet软件包和一些测试代码的确切版本吗?@AndreasWillich I能够解决它版本中存在一些冲突。我现在能够并行运行场景。我们可以并行运行功能文件吗?到目前为止,我有很多功能文件,线程随机选取场景。但是我希望线程并行执行特性。此外,我正在使用specRun评估版本。是否存在天数限制或只是延迟?@NRT:为什么要并行执行这些功能?一个特性是一组场景。并行运行一个功能或并行运行其中的所有场景之间的区别是什么?评估版本功能齐全。它只在执行开始时添加延迟。但我们最好在SpecFlow+板上讨论这一点: