ライブラリ「Baseclass.Contrib.SpecFlow.Selenium.NUnit」とともに SpecRunner を使用したいと考えています。Manage Nuget Packages から SpecFlow 2 の SpecRunner を追加したとき、単体テスト プロバイダーは app.config の 'SpecRun' でした。次に、Manage Nuget Package を使用してソリューションに「Baseclass.Contrib.SpecFlow.Selenium.NUnit」を追加すると、「SeleniumNUnit」の単体テスト プロバイダーも追加されました。機能ファイルとステップ定義を作成し、各機能に「@Browser: Chrome」などのブラウザー タグで注釈を付けてテストを実行し、バインド メソッドで Web ドライバーとして「Browser.Current」構文を使用しようとしたところ、エラー。最初のエラーは、app.config に 2 つの単体テスト プロバイダーがあり、app.config には単体テスト プロバイダーを 1 つしか持てないことでした。そのため、最初の単体テスト プロバイダーをコメント アウトしました。
*エラー 2 #エラー: '生成エラー: ファイルまたはアセンブリ 'TechTalk.SpecFlow、バージョン = 1.9.0.77、カルチャ = ニュートラル、PublicKeyToken = 0778194805d6db41' またはその依存関係の 1 つを読み込めませんでした。システムは、指定されたファイルを見つけることができません。' C:\Users\amadox\documents\visual studio 2013\Projects\SpecFlow\SpecFlow\SpecFlowFeature1.feature.cs 1 8 SpecFlow *
* エラー 33 カスタム ツール エラー: 生成エラー: ファイルまたはアセンブリ 'TechTalk.SpecFlow、バージョン = 1.9.0.77、カルチャ = ニュートラル、PublicKeyToken = 0778194805d6db41' またはその依存関係の 1 つを読み込めませんでした。システムは、指定されたファイルを見つけることができません。C:\Users\amadox\documents\visual studio 2013\Projects\SpecFlow\SpecFlow\SpecFlowFeature1.feature 2 2 SpecFlow *
そこで、最初のユニット テスト プロバイダーのコメントを外し、2 番目の単体テスト プロバイダーのコメントを外してみました。同じ問題。「Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings」が提供するパラメーター化されたクロス ブラウザー テスト機能の柔軟性と共に、Visual Studio 2015 で SpecRun を実行するにはどうすればよいですか? 以前のバージョンの Specflow (1.9) に戻すように求められているようで、Specflow 2 を使用しています。これを行う方法がわかりません。この問題を解決するにはどうすればよいですか?
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration" /></configSections>
<specFlow>
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
<!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><unitTestProvider name="SpecRun" /><plugins>
<add name="SpecRun" />
<add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="..\packages\Baseclass.Contrib.SpecFlow.Selenium.NUnit.1.3.1\tools" /></plugins><unitTestProvider name="SeleniumNUnit" /><stepAssemblies>
<stepAssembly assembly="Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings" />
</stepAssemblies></specFlow>
<appSettings>
<add key="seleniumBaseUrl" value="http://localhost:58909" />
</appSettings><autofac>
<components>
<component name="IE" type="OpenQA.Selenium.IE.InternetExplorerDriver, WebDriver" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
</component>
<component name="Chrome" type="OpenQA.Selenium.Chrome.ChromeDriver, WebDriver" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
</component>
<component name="Firefox" type="OpenQA.Selenium.Firefox.FirefoxDriver, WebDriver" service="OpenQA.Selenium.IWebDriver, WebDriver" instance-scope="per-dependency">
</component>
<!-- Example of using an injected RemoteDriver:
<component
name="IE"
type="Baseclass.Contrib.SpecFlow.Selenium.NUnit.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin"
service="OpenQA.Selenium.IWebDriver, WebDriver"
instance-scope="per-dependency">
<parameters>
<parameter name="url" value="http://127.0.0.1:4444/wd/hub" />
<parameter name="browser" value="InternetExplorer">
</parameter>
</parameters>
</component>-->
</components>
</autofac>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="2.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
*