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

118 views
Skip to first unread message

Vadivel Sekar

unread,
Sep 16, 2021, 10:24:58 AM9/16/21
to Selenium Users
Hi,

specflow test script displays error in Visual Studio 2019 V16.11.2

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.d__26.MoveNext() SeleniumWebdriver

Expected : Build generation should be successful

Environment
OS: Windows 10
specflow version: 3.9.22
Selenium version: 4.0.0-rc1
Language Bindings version: C#
Visual Studio version: 2019 V16.11.2

Regards,
Vadivel Sekar

Adrian

unread,
Sep 17, 2021, 6:48:02 PM9/17/21
to Selenium Users
Hi,
The 1st error looks to be that it can't find the unitTestProvider.  
What unitTestProvider do you use?  I use NUnit.


Cheers,
Adrian.

S Vadivel

unread,
Sep 18, 2021, 3:21:43 AM9/18/21
to seleniu...@googlegroups.com, lord.s...@gmail.com
Hi Adrian,

Thanks for the update,

I am using MSTest and when the below tag is keyed-in in the App.config, the error is displayed.

<specFlow>
<unitTestProvider name="MsTest" />
</specFlow>

When the tag is removed, the error disappears, but the tests are not reflected in the MSTest-TestExplorer.

Note: The issue occurs in the "SpecFlow.MSTest version: 3.9.22".

Regards,
Vadivel Sekar


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/877a5702-f067-402a-9b5b-75916f38b819n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages