Specflow-Nunit-Fresher

135 views
Skip to first unread message

priya lakshmi

unread,
Aug 5, 2018, 2:14:53 PM8/5/18
to SpecFlow
Hi All,

  I am new to C#/Specflow, I have experience in Java/Cucumber/Selenium. After downloading all the dependencies related to selenium/Specflow/Nunit,When i try to create a new (default)feature file and generated default Step Definition from the feature file. When I try to rebuild the solution, I am getting Errors and all errors are pointing to the default file [.feature.cs] that got generated. And when I opened the desired '.feature.cs' file i have the following content:

System.Globalization.CultureNotFoundException: Culture is not supported.
Parameter name: name
{not-specified} is an invalid culture identifier.
   at System.Globalization.CultureInfo.GetCultureInfo(String name)
   at TechTalk.SpecFlow.Configuration.AppConfig.AppConfigConfigurationLoader.LoadAppConfig(SpecFlowConfiguration specFlowConfiguration, ConfigurationSectionHandler configSection)
   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.GeneratorContainerBuilder.CreateContainer(SpecFlowConfigurationHolder configurationHolder, ProjectSettings projectSettings)
   at TechTalk.SpecFlow.Generator.TestGeneratorFactory.CreateGenerator(ProjectSettings projectSettings)
   at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.Actions.GenerateTestFileAction.GenerateTestFile(GenerateTestFileParameters opts)

Request you to guide me where I am lagging, because the exception I am getting is related to the default sample feature file content. Is there any other pre-requisite apart from downloading the Specflow for Visual Studio & DLLs like Specflow,Nunit,Selenium from Nuget Manager? I am really lost here kindly provide me suggession.

Please find below was the list of Error Messages displayed

Severity

Code

Description

Line

Suppression State

Error

CS0116

A namespace cannot directly contain members such as fields or methods

1

Active

Error

CS1022

Type or namespace definition, or end-of-file expected

1

Active

Error

CS1022

Type or namespace definition, or end-of-file expected

1

Active

Error

CS1003

Syntax error, '(' expected

2

Active

Error

CS1001

Identifier expected

2

Active

Error

CS1003

Syntax error, ',' expected

2

Active

Error

CS1003

Syntax error, ',' expected

2

Active

Error

CS1001

Identifier expected

2

Active

Error

CS1026

) expected

2

Active

Error

CS1002

; expected

3

Active

Error

CS1022

Type or namespace definition, or end-of-file expected

3

Active

Error

CS1002

; expected

3

Active

Error

CS1003

Syntax error, '(' expected

4

Active

Error

CS1001

Identifier expected

4

Active

Error

CS1003

Syntax error, ',' expected

4

Active

Error

CS1003

Syntax error, ',' expected

4

Active

Error

CS1002

; expected

4

Active

Error

CS1002

; expected

5

Active

Error

CS1002

; expected

6

Active

Error

CS1002

; expected

7

Active

Error

CS1002

; expected

8

Active

Error

CS1002

; expected

9

Active

Error

CS1002

; expected

10

Active

Error

CS0246

The type or namespace name 'not' could not be found (are you missing a using directive or an assembly reference?)

1

Active

Error

CS0246

The type or namespace name 'supported' could not be found (are you missing a using directive or an assembly reference?)

1

Active

Error

CS0538

'supported' in explicit interface declaration is not an interface

1

Active

Error

CS0246

The type or namespace name 'name' could not be found (are you missing a using directive or an assembly reference?)

2

Active

Error

CS0246

The type or namespace name 'name' could not be found (are you missing a using directive or an assembly reference?)

2

Active

Error

CS0246

The type or namespace name 'an' could not be found (are you missing a using directive or an assembly reference?)

3

Active

Error

CS0246

The type or namespace name 'culture' could not be found (are you missing a using directive or an assembly reference?)

3

Active

Error

CS0246

The type or namespace name 'identifier' could not be found (are you missing a using directive or an assembly reference?)

3

Active

Error

CS0538

'identifier' in explicit interface declaration is not an interface

3

Active

Error

CS0501

'<invalid-global-code>.at(CultureInfo.GetCultureInfo, String)' must declare a body because it is not marked abstract, extern, or partial

4

Active

Error

CS0426

The type name 'GetCultureInfo' does not exist in the type 'CultureInfo'

4

Active

Error

CS0246

The type or namespace name 'String' could not be found (are you missing a using directive or an assembly reference?)

4

Active

Error

CS0246

The type or namespace name 'at' could not be found (are you missing a using directive or an assembly reference?)

5

Active

Error

CS0538

'AppConfigConfigurationLoader' in explicit interface declaration is not an interface

5

Active

Error

CS0501

'<invalid-global-code>.LoadAppConfig(SpecFlowConfiguration, ConfigurationSectionHandler)' must declare a body because it is not marked abstract, extern, or partial

5

Active

Error

CS0246

The type or namespace name 'SpecFlowConfiguration' could not be found (are you missing a using directive or an assembly reference?)

5

Active

Error

CS0246

The type or namespace name 'ConfigurationSectionHandler' could not be found (are you missing a using directive or an assembly reference?)

5

Active

Error

CS0246

The type or namespace name 'at' could not be found (are you missing a using directive or an assembly reference?)

6

Active

Error

CS0538

'ConfigurationLoader' in explicit interface declaration is not an interface

6

Active

Error

CS0501

'<invalid-global-code>.Load(SpecFlowConfiguration, ISpecFlowConfigurationHolder)' must declare a body because it is not marked abstract, extern, or partial

6

Active

Error

CS0246

The type or namespace name 'SpecFlowConfiguration' could not be found (are you missing a using directive or an assembly reference?)

6

Active

Error

CS0246

The type or namespace name 'ISpecFlowConfigurationHolder' could not be found (are you missing a using directive or an assembly reference?)

6

Active

Error

CS0246

The type or namespace name 'at' could not be found (are you missing a using directive or an assembly reference?)

7

Active

Error

CS0538

'Generator.Configuration.GeneratorConfigurationProvider' in explicit interface declaration is not an interface

7

Active

Error

CS0234

The type or namespace name 'Generator' does not exist in the namespace 'TechTalk.SpecFlow' (are you missing an assembly reference?)

7

Active

Error

CS0501

'<invalid-global-code>.LoadConfiguration(SpecFlowConfiguration, SpecFlowConfigurationHolder)' must declare a body because it is not marked abstract, extern, or partial

7

Active

Error

CS0246

The type or namespace name 'SpecFlowConfiguration' could not be found (are you missing a using directive or an assembly reference?)

7

Active

Error

CS0246

The type or namespace name 'SpecFlowConfigurationHolder' could not be found (are you missing a using directive or an assembly reference?)

7

Active

Error

CS0246

The type or namespace name 'at' could not be found (are you missing a using directive or an assembly reference?)

8

Active

Error

CS0538

'Generator.GeneratorContainerBuilder' in explicit interface declaration is not an interface

8

Active

Error

CS0234

The type or namespace name 'Generator' does not exist in the namespace 'TechTalk.SpecFlow' (are you missing an assembly reference?)

8

Active

Error

CS0501

'<invalid-global-code>.CreateContainer(SpecFlowConfigurationHolder, ProjectSettings)' must declare a body because it is not marked abstract, extern, or partial

8

Active

Error

CS0246

The type or namespace name 'SpecFlowConfigurationHolder' could not be found (are you missing a using directive or an assembly reference?)

8

Active

Error

CS0246

The type or namespace name 'ProjectSettings' could not be found (are you missing a using directive or an assembly reference?)

8

Active

Error

CS0246

The type or namespace name 'at' could not be found (are you missing a using directive or an assembly reference?)

9

Active

Error

CS0538

'Generator.TestGeneratorFactory' in explicit interface declaration is not an interface

9

Active

Error

CS0234

The type or namespace name 'Generator' does not exist in the namespace 'TechTalk.SpecFlow' (are you missing an assembly reference?)

9

Active

Error

CS0501

'<invalid-global-code>.CreateGenerator(ProjectSettings)' must declare a body because it is not marked abstract, extern, or partial

9

Active

Error

CS0246

The type or namespace name 'ProjectSettings' could not be found (are you missing a using directive or an assembly reference?)

9

Active

Error

CS0246

The type or namespace name 'at' could not be found (are you missing a using directive or an assembly reference?)

10

Active

Error

CS0538

'VisualStudio.CodeBehindGenerator.Actions.GenerateTestFileAction' in explicit interface declaration is not an interface

10

Active

Error

CS0234

The type or namespace name 'VisualStudio' does not exist in the namespace 'TechTalk.SpecFlow' (are you missing an assembly reference?)

10

Active

Error

CS0501

'<invalid-global-code>.GenerateTestFile(GenerateTestFileParameters)' must declare a body because it is not marked abstract, extern, or partial

10

Active

Error

CS0246

The type or namespace name 'GenerateTestFileParameters' could not be found (are you missing a using directive or an assembly reference?)

10

Active

Error

CS0161

'<invalid-global-code>.Parameter(name, name)': not all code paths return a value

2

Active

Error

CS0103

The name 'not' does not exist in the current context

3

Active

Error

CS0103

The name 'specified' does not exist in the current context

3

Active


Regards,
Priya

Stephen McCafferty

unread,
Aug 6, 2018, 5:08:18 PM8/6/18
to SpecFlow
Is it possible that your app.config file contains a culture that is not supported by Gherkin? What culture have you entered? Can you share your app.config file?

priya lakshmi

unread,
Aug 8, 2018, 6:23:34 AM8/8/18
to SpecFlow
Hi Stephen,

  Thank you for the reply :) , but I solved that issue by adding the following tags in the app.config xml file - 
    <language feature="en-US" tool="" />
    <bindingCulture name="en-US" />
Since this definition was missing I got errors in the .feature.cs file that got generated by default.  

Regards,
Priya
Reply all
Reply to author
Forward
0 new messages