Search code examples
coded-ui-testsspecflowgherkin

CodedUI does not run with SpecFlow 2.1


We have a code only CodedUI project which we use for GUI testing and now we are investigating the possibility of using SpecFlow Feature files. So I:

  1. Created inside this CodedUI project a subfolder 'Gherkin'
  2. Installed nuget SpecFlow 2.1
  3. Installed nuget SpecFlow.MsTest
  4. Added to the folder of step 0 a feature file and generated the C# code.

Now when I embed inside the first Gherkin C# Method, a simple CodedUI statement which opens the browser I get a 'filenotfoundexception: could not load file or assembly Microsoft.VisualStudio.TestTools.UITest.WindowsStoreUtility'

When I uninstall 2.1 and install SpecFlow 1.9 with SpecFlow.plugins.codedui it works without problems!

Is there a solution for 2.1?


Solution

  • With SpecFlow 2.1 we changed the plugin infrastructure and so older plugins do not work anymore.

    But it is not difficult to implement the needed stuff for CodedUI on your own. Please see https://github.com/techtalk/SpecFlow/wiki/Using-SpecFlow-with-CodedUI-API

    The documentation is not yet updated to SpecFlow 2.*, but the interfaces did not have changed. You have to adapt the paths to the new version numbers.

    If you have questions, please join us on our Gitter- Channel.