Thursday 16 September 2021

specflow-Selenium-C# test script displays error in Visual Studio 2019 V16.11.2

🐛 Bug Report



Selenium-specflow test script displays error in VS2019 when the SpecFlow.MSTest v3.9.22 is installed

Error Details:

Severity Code Description Project File Line Suppression State
Error The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.
System.Exception: Error when reading project file. ---> System.Configuration.ConfigurationErrorsException: Unrecognized element 'unitTestProvider'.
at System.Configuration.ConfigurationElement.DeserializeElement(XmlReader reader, Boolean serializeCollectionKey)
at System.Configuration.ConfigurationSection.DeserializeSection(XmlReader reader)
at TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler.CreateFromXml(String xmlContent)
at TechTalk.SpecFlow.Configuration.ConfigurationLoader.Load(SpecFlowConfiguration specFlowConfiguration, ISpecFlowConfigurationHolder specFlowConfigurationHolder)
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProvider.LoadConfiguration(SpecFlowConfiguration specFlowConfiguration, SpecFlowConfigurationHolder specFlowConfigurationHolder)
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProviderExtensions.LoadConfiguration(IGeneratorConfigurationProvider configurationProvider, SpecFlowConfigurationHolder configurationHolder)
at TechTalk.SpecFlow.Generator.Project.ProjectReader.ReadSpecFlowProject(String projectFilePath, String rootNamespace)
--- End of inner exception stack trace ---
at TechTalk.SpecFlow.Generator.Project.ProjectReader.ReadSpecFlowProject(String projectFilePath, String rootNamespace)
at TechTalk.SpecFlow.Generator.Project.MSBuildProjectReader.LoadSpecFlowProjectFromMsBuild(String projectFilePath, String rootNamespace)
at SpecFlow.Tools.MsBuild.Generation.SpecFlowProjectProvider.GetSpecFlowProject()
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() SeleniumWebdriver

Expected behavior :

  • Build generation should be successful

Environment

  1. OS: Windows 10
  2. specflow version: 3.9.22
  3. Selenium version: 4.0.0-rc1
  4. Language Bindings version: C#
  5. Visual Studio version: 2019 V16.11.2
  6. SpecFlow.MSTest version: 3.9.22
1. When the Project is created using the "SpecFlow project" as template, the version is V 3.9.8 where there are no issues.

2. When the Project is created using the "MSTest project" as template and the Specflow is added/installed on top of it, the version is V 3.9.22.
  •    Here the GHerkin and Cucumber versions are creating the issue.
3. If a project is created using the MSTest template and if the SpecFlow version is updated to the V 3.9.22, this issue will occur.



I have created a new project and if SpecFlow is installed dependencies mentioned were not installed (such as BoDi and Cucumber.Message) but in old project these were installed individually and the error persist.

 


No comments:

Post a Comment