Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Setting up a new BDD machine

slodge edited this page · 2 revisions

This wiki page describes how I'd setup my perfect BDD machine from new.

Others might prefer to use different tools to me - but this is what I personally do right now. These notes are based on Windows 7, WP7 and Visual Studio 2010. Obviously these notes will be out of date soon as Windows 8, WP8 and Visual Studio 2011 are all on the near horizon.

  1. Start with a clean install of Windows 7 with SP1 - in my case I used win7 professional 32-bit, and installed it as a clean HD with admin username "bdd" and password "not telling you" on machine name "bdd-PC"

  2. Install VS2010 Ultimate with SP1 - choosing default options (complete).

  3. Install IE9 - because IE10 not yet available on Windows 7

  4. Install SpecFlow plugin - from

  5. Install resharper evaluation - from Note that you don't need to use resharper. There are plenty of other test runners available. However, R# is my preferred tool.

  6. Start Visual Studio and choose C# Development Settings, then wait while VS sets itself up, then choose default R#er evaluation and integration settings, then choose Exit. You have to do this before you can install the WP7.1 SDK.

  7. Reboot to clear out some of the setup steps from your new PC...

  8. Reinstall VS2010 SP1 - don't argue - you just need to... this installer takes its time... have a tea... then some biscuits... then finally you can reboot.

  9. Install WP7.1 SDK - from

  10. Now you can finally start coding/testing... so open Visual Studio, and then...

11.1 Create a new WP7 project - PhoneApp1

11.2 add a button to the default page with Content "Click Me!"

11.3 add a Tag property to the button of "auto:ClickMeButton"

11.4 add a Click event handler to the button which executes:

          ((Button)sender).Content = "Clicked";

11.5 Right click on the project and choose Manage NuGet References (if this menu item is not present, then use Tools|Extension manager to download and install NuGet - this will require a restart of VS2010)

11.6 Install the wp7testclient package (App - windows phone test framework)

11.7 At the end of the App.xaml.cs constructor, add:

          #if DEBUG
          #endif // DEBUG

11.8 Build your app (Ctrl+Shift+B)

12.1 Add a new Windows .Net class library - PhoneApp1.Spec

12.2 Delete the class1.cs that is installed

12.3 Right click on the project and choose Manage nuget References

12.4 Install the wp7test package (BDD - Windows phone test framework)

12.5 Add a new SpecFlow feature to this project - Feature1.feature - and enter feature code like:

    Feature: App Test
    In order to test my app
    As a WP7 Developer
    I want to press that button

    Scenario: Start the app
    Given my app is uninstalled
    And my app is installed
    And my app is running
    Then I wait 2 seconds
    Then take a picture
    Then I press the control "ClickMeButton"
    Then take a picture

12.6 Open the project properties for this class library. On the Build tab, change "Any CPU" to "x86" - this is important as the tests use a 32-bit COM API from Microsoft.

12.7 Now set up the app.config for the .Spec project - but be especially careful to make sure that the GUID below is the GUID from your ProjectID inside WMAppManifest.xml in the PhoneApp1 mobile project:

    <add key="EmuSteps.Application.WindowsPhone.ApplicationId" value="{e33eb75b-YOUR-GUID-HERE-da5dd6df7572}" />
    <add key="EmuSteps.Application.WindowsPhone.ApplicationIconPath" value=".\..\..\..\PhoneApp1\bin\debug\ApplicationIcon.png" />
    <add key="EmuSteps.Application.WindowsPhone.ApplicationPackagePath" value=".\..\..\..\PhoneApp1\bin\debug\PhoneApp1.xap" />
    <add key="EmuSteps.Application.WindowsPhone.ApplicationName" value="PhoneApp1" />

12.8 Build the project

13.0 To make sure that the test framework can open a port for communications with the app, open a "run as administrator" command prompt and type:

   netsh http add urlacl url=http://+:8085/ user=<domain>\<user>

where and correspond to the domain and user entered in the PC setup - see step 1. So I used:

   netsh http add urlacl url=http://+:8085/ user=bdd-pc\bdd

On success, this said "URL reservation successfully added"

14.0 Back in Visual Studio 2010, right click on the .Spec project and choose "Run Unit Tests"

The emulator does a full boot... and then the test runs including the button press and the two screenshots :)

Note for the brave... if trying this in a VM, then make sure your VM will be able to support the WP7 emulator before you start - see lots of tales of VM problems around:

For a smoother debug experience you may prefer to set up a separate build configuration for your BDD testing - i.e. DebugBDD to go alongside Debug and Release. To do this, you need to create the configuration using VS2010 and then use the text editor to change the WindowsPhoneTestFramework reference to only be included in the DebugBDD build. For more on this topic see

Something went wrong with that request. Please try again.