c# - 使用 specflow Specrun 构建硒解决方案时出现错误
问题描述
我是 selenium 和 specflow specrun 的新手。我正在使用一个框架来进行自动化测试。我在 c# 中使用 specrun 作为我的测试运行和 specflow。在构建解决方案时出现以下错误。
> The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.System.TypeLoadException: Method 'SetTestMethod' in type
> 'TechTalk.SpecRun.SpecFlowPlugin.Generator.SpecRunGenerator' from
> assembly 'SpecRun.Generator.SpecFlowPlugin, Version=3.2.0.0,
> Culture=neutral, PublicKeyToken=null' does not have an implementation.
> at
> TechTalk.SpecRun.SpecFlowPlugin.Generator.SpecFlowGeneratorPlugin.GeneratorPluginEvents_RegisterDependencies(Object
> sender, RegisterDependenciesEventArgs e) at
> TechTalk.SpecFlow.Generator.Plugins.GeneratorPluginEvents.RaiseRegisterDependencies(ObjectContainer
> objectContainer) at
> TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.CreateContainer(SpecFlowConfigurationHolder
> configurationHolder, ProjectSettings projectSettings, IEnumerable`1
> generatorPluginInfos, IObjectContainer parentObjectContainer) at
> SpecFlow.Tools.MsBuild.Generation.WrappedGeneratorContainerBuilder.BuildGeneratorContainer(SpecFlowConfigurationHolder
> specFlowConfigurationHolder, ProjectSettings projectSettings,
> IReadOnlyCollection`1 generatorPluginInfos, IObjectContainer
> rootObjectContainer) at
> SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTaskExecutor.Execute()
> at
> SpecFlow.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask.Execute()
> at
> Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
> at
> Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
解决方案
请将 SpecFlow+ Runner 包更新到版本 3.2.15。
推荐阅读
- javascript - Angular JS 1中的$ location:badpath时如何将url重定向到默认值
- kubernetes - 使用入口 nginx 重写问题
- vba - 如何为全局变量赋值以供全局使用
- laravel - 更新记录时如何解决错误?
- scala - 如何从数据框构建图表?(图X)
- python - 在python字典中将值从一个键转移到另一个键
- python - 如何在python中将单个pdf的多页转换为一个TIFF文件
- react-native - 用玩笑测试应用程序时无法读取未定义的属性“默认”
- python - 通过预先应用的参数移动多个文件
- php - 如果 url 是根域添加类 (PHP)