找不到元素“specflow"的架构信息 Visual Studio Professional 2013 [英] could not find schema information for the element 'specflow' Visual Studio Professional 2013

查看:25
本文介绍了找不到元素“specflow"的架构信息 Visual Studio Professional 2013的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio Professional 2013 中编译我的 webdriver C# 代码我已经安装了 Specflow

I am compiling my webdriver C# code in Visual Studio professional 2013 I have installed Specflow

我收到以下错误找不到元素specflow"的架构信息

I get the following error could not find schema information for the element 'specflow'

我的 AppConfig 文件具有以下设置:

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>

为什么它会抱怨找不到 specflow 的架构信息?

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();
        }
    }

推荐答案

注意:由于您的 specFlow 配置部分是空的,您可以删除它.在任何一种情况下,SpecFlow 都将使用默认值.

Note: Since your specFlow config section is empty, you can just delete it. SpecFlow will use defaults for everything in either case.

找不到元素specFlow"的架构信息.

Could not find schema information for the element 'specFlow'.

这些消息仅供参考.许多 configSections 没有模式,因为它们非常简单、非常复杂或具有跟不上的插件选项.

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.

您始终可以根据文档或使用 XML 文件作为示例来创建 XML 架构.要从示例中创建一个(当然,这可能会过拟合示例),请打开 XML 文件 (app.config) 并选择菜单命令 XML » Create Schema.

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.

在 App.config 的情况下,架构将用于整个配置.只需将其缩减为 specflow 配置部分.我是用我的,它指导为 MS 测试而不是 NUnit 生成代码.然后,我通过为 unitTestProvider 的名称创建一个枚举来使之更加生动.

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>

这篇关于找不到元素“specflow"的架构信息 Visual Studio Professional 2013的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆