Reputation: 4072
I am compiling my webdriver C# code in Visual Studio professional 2013 I have installed Specflow
I get the following error could not find schema information for the element 'specflow'
My AppConfig file has the following settings:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
</configSections>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc- config -->
</specFlow>
<appSettings>
...
</appSettings>
</configuration>
Why is it complaining about could not find schema info for specflow?
In my step definition file i have included at the top of the class
using NUnit.Framework;
using OpenQA.Selenium;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TechTalk.SpecFlow;
using G.Selenium;
namespace WebdriverBdd
{
[Binding]
public class SearchSteps : SeleniumWebDriver
{
[Given(@"user is on g search page")]
public void UserIsOnGSearchPage()
{
SeleniumWebDriver selenium_driver = new SeleniumWebDriver();
}
}
Upvotes: 2
Views: 4665
Reputation: 20812
Note: Since your specFlow config section is empty, you can just delete it. SpecFlow will use defaults for everything in either case.
Could not find schema information for the element 'specFlow'.
The message(s) are informational only. Many configSections don't have schemas because they are very simple, very complex or have plugin options that aren't kept up with.
You can always create an XML schema from documentation or using an XML file as an example. To create one from an example (which of course, might be overfit to the example), open the XML file (app.config) and select the menu command XML » Create Schema.
In the case of an App.config, the schema will be for the whole configuration. Simply pare it down to the specflow config section. I did this with mine, which directs code generation for MS Test instead of NUnit. I then jazzed it up a bit by creating an enumeration for the name of the unitTestProvider.
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="specFlow">
<xs:annotation>
<xs:documentation>
Customizes SpecFlow code generation. This unofficial schema is hand-crafted based on actual use.
For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config.
Should occur zero or one times in an app.config.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element name="unitTestProvider">
<xs:complexType>
<xs:attribute name="name" type="SpecFlowUnitTestProvider" use="required" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="SpecFlowUnitTestProvider">
<xs:restriction base="xs:string">
<xs:enumeration value="MsTest" />
<xs:enumeration value="NUnit" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
Upvotes: 2