Note that there are some explanatory texts on larger screens.

plurals
  1. POspecflow plugin with nunit and TFS build
    primarykey
    data
    text
    <p>I am in the middle of trying to get specflow UI tests working with TFS build and I am very very close. </p> <p>I wanted to be able to run the same test on a number of browsers, and so after some research I found this: </p> <p><a href="http://www.baseclass.ch/blog/Lists/Beitraege/Post.aspx?ID=4&amp;mobile=0" rel="nofollow">http://www.baseclass.ch/blog/Lists/Beitraege/Post.aspx?ID=4&amp;mobile=0</a></p> <p>And it works like a dream for local test runs. the next step was to get this to call a selenium grid during a TFS 2010 build.</p> <p>After getting the nunit community build task into my build template, I am now stuck with an error I can't seem to resolve. The build reports the following error: </p> <blockquote> <p>Error: The system cannot find the file specified. Stack Trace: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at TfsBuildExtensions.Activities.CodeQuality.NUnit.RunProcess(String fullPath, String workingDirectory, String arguments) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 339 at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishMSTestResults(String resultTrxFile, String collectionUrl, String buildNumber, String teamProject, String platform, String flavor) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 394 at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishTestResultsToTFS(ActivityContext context, String folder) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 387 at TfsBuildExtensions.Activities.CodeQuality.NUnit.InternalExecute() in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 299 at TfsBuildExtensions.Activities.BaseCodeActivity.Execute(CodeActivityContext context) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Common\BaseCodeActivity.cs:line 67. </p> </blockquote> <p>however, this seems to be masking a deeper error as to me it simply says that nunit can't load a custom assembly. So I had a look through the binaries folder on the build server for the nunit logs, and sure enough in my test run .xml file I find another error:</p> <blockquote> <p>System.Configuration.ConfigurationErrorsException : The type 'OpenQA.Selenium.Remote.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin' could not be found. It may require assembly qualification, e.g. "MyType, MyAssembly".</p> <p>at Autofac.Configuration.ConfigurationRegistrar.LoadType(String typeName, Assembly defaultAssembly) at Autofac.Configuration.ConfigurationRegistrar.RegisterConfiguredComponents(ContainerBuilder builder, SectionHandler configurationSection) at Autofac.Configuration.ConfigurationRegistrar.RegisterConfigurationSection(ContainerBuilder builder, SectionHandler configurationSection) at Autofac.Configuration.Core.ConfigurationModule.Load(ContainerBuilder builder) at Autofac.Module.Configure(IComponentRegistry componentRegistry) at Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules) at Autofac.ContainerBuilder.Build(ContainerBuildOptions options) at RegistrationForm.Tests.Acceptance.Features.UserRegistrationFeature.FeatureSetup() in c:\Builds\1\Testing\RegistrationForm - Nightly - Main\Sources\Testing\RegistrationForm\Main\RegistrationForm.Tests.Acceptance\Features\UserRegistration.feature.cs:line 0</p> </blockquote> <p>From this I started to look at the path to the custom assembly. This is specified in the app.config file for the project (which is transformed during the build. I also checked to ensure the file is being transformed, and in the binaries directory on the build server it is). the relevant section of the file is this. </p> <pre><code> &lt;specFlow&gt; &lt;stepAssemblies&gt; &lt;stepAssembly assembly="SpecFlow.Assist.Dynamic" /&gt; &lt;stepAssembly assembly="Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings" /&gt; &lt;/stepAssemblies&gt; &lt;unitTestProvider name="SeleniumNUnit" /&gt; &lt;plugins&gt; &lt;add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="..\packages\Baseclass.Contrib.SpecFlow.Selenium.NUnit.1.2.0\tools" /&gt; &lt;/plugins&gt; </code></pre> <p></p> <p>Which works locally. I figured I just need to change the path in the transformed file. At first I assumed the working directory was the binaries directory so in the transform file I have this:</p> <pre><code>&lt;specFlow&gt; &lt;plugins xdt:Transform="Replace"&gt; &lt;add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="." /&gt; &lt;/plugins&gt; </code></pre> <p></p> <p>The dll is in the same dir (binaries) so I tried ".", "", ".\" - none of these worked. So after thinking a little more and reading the errors more carefully I thought I needed to look in the Sources folder on the build server. The Dll is in the packages folder (nuget package restore), and so the path should be the same as I use locally. this didn't work either. So what about a path relative to the ".feature" file throwing the error? this simply needed an extra "..\" - still no luck.</p> <p>So i am at a bit of a loss, I feel I have tried all the paths i can think of, but my knowledge of specflow plugins and TFS build is letting me down. can anyone give me any pointers?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload