<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon Dean</title>
	<atom:link href="http://www.simondean.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simondean.org</link>
	<description>life and times of an agile developer</description>
	<lastBuildDate>Wed, 26 Dec 2012 18:19:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>GoPro Hero3 and the iPad</title>
		<link>http://www.simondean.org/2012/12/gopro-hero3-ipad/</link>
		<comments>http://www.simondean.org/2012/12/gopro-hero3-ipad/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 18:02:28 +0000</pubDate>
		<dc:creator>Simon Dean</dc:creator>
				<category><![CDATA[GoPro Hero3]]></category>
		<category><![CDATA[GoPro Hero3 iPad]]></category>

		<guid isPermaLink="false">http://www.simondean.org/?p=160</guid>
		<description><![CDATA[The GoPro Hero3 supports 64GB SD (SDXC) cards.  64GB SD cards come formatted with the exFAT format.  This works great with the GoPro Hero 3 until you want to connect the Hero3 to an iPad as the iPad doesn&#8217;t support exFAT yet.  You&#8217;ll get a message like &#8220;Contents Unavailable.  The connected storage media may be [...]]]></description>
				<content:encoded><![CDATA[<p>The GoPro Hero3 supports 64GB SD (SDXC) cards.  64GB SD cards come formatted with the exFAT format.  This works great with the GoPro Hero 3 until you want to connect the Hero3 to an iPad as the iPad doesn&#8217;t support exFAT yet.  You&#8217;ll get a message like &#8220;Contents Unavailable.  The connected storage media may be damaged&#8221; or &#8220;Contents not Available.  Cannot read the connected storage media.&#8221;<span id="more-160"></span></p>
<p>The solution to this is to use MiniTool Partition Wizard Home Edition to format the SD card with FAT32.  However, when formatting the card with FAT32, you need to set the cluster size to 32KB, otherwise when you try to use the card with the GoPro you&#8217;ll get the error message &#8220;SD ERR&#8221;.</p>
<p>There&#8217;s two ways to connect the Hero3 to an iPad:</p>
<ul>
<li>Take the SD  card out of the GoPro and insert the SD card into the iPad&#8217;s SD Card Camera Reader cable / Camera Kit</li>
<li>Plug the USB port of the GoPro into the iPad&#8217;s USB Camera Reader cable / Camera Kit</li>
</ul>
<p>If you&#8217;re going down the USB cable route, you&#8217;ll probably get the error message &#8220;Cannot Use Device.  The connected USB device requires too much power.&#8221;  You can fix this by placing a powered USB2 hub between the iPad and the GoPro.  Doing this makes the GoPro draw its power from the hub instead of the iPad.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simondean.org/2012/12/gopro-hero3-ipad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MVC.NET 2 Breaking Changes</title>
		<link>http://www.simondean.org/2012/05/mvcnet-2-breaking/</link>
		<comments>http://www.simondean.org/2012/05/mvcnet-2-breaking/#comments</comments>
		<pubDate>Wed, 02 May 2012 10:35:46 +0000</pubDate>
		<dc:creator>Simon Dean</dc:creator>
				<category><![CDATA[MVC.NET 2]]></category>
		<category><![CDATA[MVC.NET]]></category>

		<guid isPermaLink="false">http://www.simondean.org/?p=146</guid>
		<description><![CDATA[Breaking changes in MVC.NET 2 (aka ASP.NET MVC 2)...]]></description>
				<content:encoded><![CDATA[<p>Breaking changes in MVC.NET 2 (aka ASP.NET MVC 2):</p>
<ul>
<li>There is a change to the behaviour of the Model Binder.  In MVC.NET 1, when a string property had no value to be bound to it, the Model Binder would assign an empty string to the property.  In MVC.NET 2 the model binder will assign null instead.  This can cause many issues.  See <a title="ASP.NET MVC 2.0 Undocumented Model String Property Binding Breaking Change" href="http://brianreiter.org/2010/09/16/asp-net-mvc-2-0-undocumented-model-string-property-breaking-change/">http://brianreiter.org/2010/09/16/asp-net-mvc-2-0-undocumented-model-string-property-breaking-change/</a> for more info.  I&#8217;d recommend getting used to the new MVC.NET 2 behaviour instead of using ModelBinders.Binders.DefaultBinder to go back to the MVC.NET 1 behaviour.</li>
<li>By default you can no longer return JSON from an Action that accepts HTTP GETs.  This is with good reason and closes up some serious potential security holes.  If you understand the implications, you can bypass this restriction on a case-by-case basis using the new overload of the Json method: <a href="http://msdn.microsoft.com/en-us/library/ee430920.aspx">http://msdn.microsoft.com/en-us/library/ee430920.aspx</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simondean.org/2012/05/mvcnet-2-breaking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Assembly Version, Assembly File Version and Assembly Informational Version</title>
		<link>http://www.simondean.org/2012/05/assembly-version-and-assembly-file-version/</link>
		<comments>http://www.simondean.org/2012/05/assembly-version-and-assembly-file-version/#comments</comments>
		<pubDate>Wed, 02 May 2012 10:18:58 +0000</pubDate>
		<dc:creator>Simon Dean</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.simondean.org/?p=132</guid>
		<description><![CDATA[.NET provides three assembly-level attributes for adding a version number to your .NET assembly:

[sourcecode language="csharp" collapse="false"]
[assembly: AssemblyVersionAttribute("1.0.0.0")]
[assembly: AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.0")]
[/sourcecode]
For the last few years I've often left the Assembly Version set to a fixed value (e.g. 1.0.0.0) and then...]]></description>
				<content:encoded><![CDATA[<p>.NET provides three assembly-level attributes for adding a version number to your .NET assembly:</p>
<pre class="brush: csharp; collapse: false; title: ; notranslate">
[assembly: AssemblyVersionAttribute(&quot;1.0.0.0&quot;)]
[assembly: AssemblyFileVersionAttribute(&quot;1.0.0.0&quot;)]
[assembly: AssemblyInformationalVersion(&quot;1.0.0.0&quot;)]
</pre>
<p>For the last few years I&#8217;ve often left the Assembly Version set to a fixed value (e.g. 1.0.0.0) and then set the AssemblyFileVersionAttribute to the something based on a CI build number (e.g. 2.0.0.272 for build 272).</p>
<p>For more info on the purpose of these assembly attributes see: <a href="http://all-things-pure.blogspot.co.uk/2009/09/assembly-version-file-version-product.html">http://all-things-pure.blogspot.co.uk/2009/09/assembly-version-file-version-product.html</a></p>
<p>You can retrieve the value of the Assembly File Version within code.  This can be useful for things like displaying a version number in your UI.  Here&#8217;s the code:</p>
<pre class="brush: csharp; collapse: false; title: ; notranslate">
var assemblyFileVersion = (AssemblyFileVersionAttribute)Assembly
  .GetExecutingAssembly()
  .GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false)
  .Single();
return assemblyFileVersion.Version;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simondean.org/2012/05/assembly-version-and-assembly-file-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Behaviour Driven Development</title>
		<link>http://www.simondean.org/2010/12/behaviour-driven-development/</link>
		<comments>http://www.simondean.org/2010/12/behaviour-driven-development/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 21:52:09 +0000</pubDate>
		<dc:creator>Simon Dean</dc:creator>
				<category><![CDATA[Behaviour Driven Development]]></category>
		<category><![CDATA[Functional Testing]]></category>
		<category><![CDATA[BDD]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Cucumber]]></category>
		<category><![CDATA[Cuke4Nuke]]></category>
		<category><![CDATA[Functional Acceptance Testing]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.simondean.org/?p=115</guid>
		<description><![CDATA[I gave a &#8220;brown bag&#8221; talk on Behaviour Driven Design (BDD) this week.   I enjoyed the researching the content for the talk. Dan North&#8217;s couple of articles on BDD were really helpful: Introducing BDD and What&#8217;s in a Story? It was interesting to see how BDD started as an evolution of Test Driven Development [...]]]></description>
				<content:encoded><![CDATA[<p>I gave a &#8220;brown bag&#8221; talk on Behaviour Driven Design (BDD) this week.   I enjoyed the researching the content for the talk.  Dan North&#8217;s couple of articles on BDD were really helpful: <a href="http://blog.dannorth.net/introducing-bdd/">Introducing BDD</a> and <a href="http://blog.dannorth.net/whats-in-a-story/">What&#8217;s in a Story?</a></p>
<p>It was interesting to see how BDD started as an evolution of Test Driven Development (TDD) but is now as much about stories, acceptance criteria and functional acceptance testing as it is about unit testing.<span id="more-115"></span></p>
<p>In preparing for the talk, I spent some time looking at the current state of BDD tools for .NET.  There seem to be four main options:</p>
<ul>
<li>Cucumber running on Ruby, with the step definitions written in Ruby </li>
<li>Cucumber running on IronRuby, with the step definitions written in Ruby</li>
<li>Cuke4Nuke running on Ruby, with the step definitions written in C#</li>
<li>SpecFlow running on .NET, with the step definitions written in C#</li>
</ul>
<p>To help with understanding how Cuke4Nuke works, I&#8217;ve ported Cucumber&#8217;s calculator example over to C# and Cuke4Nuke.  The code is available on GitHub: <a href="https://github.com/simondean/cuke4nuke-examples">https://github.com/simondean/cuke4nuke-examples</a></p>
<p>In the discussion time after the talk, some interesting topics came up:</p>
<ul>
<li>Adopting BDD on a brownfield project</li>
<li>Executing BDD features against a system &#8220;in-process&#8221; vs via a web browser or HTTP request</li>
<li>Exposing a REST API to test the behaviour of a web-UI-based system instead of testing via the web UI</li>
</ul>
<p>The slides from the talk are available <a title="Behaviour Driven Development (BDD)" href="http://www.simondean.org/wp-content/uploads/2010/12/BDD.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simondean.org/2010/12/behaviour-driven-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Generic Singleton</title>
		<link>http://www.simondean.org/2010/12/generic-singleton/</link>
		<comments>http://www.simondean.org/2010/12/generic-singleton/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 17:10:51 +0000</pubDate>
		<dc:creator>Simon Dean</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.simondean.org/?p=86</guid>
		<description><![CDATA[Occasionally I find myself writing a small .NET assembly that&#8217;s going to be used across a number of difference applications where I can&#8217;t assume that any particular Dependency Injection library fill be available.  In those situations, I often need to implement some sort of singleton object.  It&#8217;s on those occasions that I turn to the [...]]]></description>
				<content:encoded><![CDATA[<p>Occasionally I find myself writing a small .NET assembly that&#8217;s going to be used across a number of difference applications where I can&#8217;t assume that any particular Dependency Injection library fill be available.  In those situations, I often need to implement some sort of singleton object.  It&#8217;s on those occasions that I turn to the following generic singleton class I created based on <a href="http://csharpindepth.com/Articles/General/Singleton.aspx">Jon Skeet&#8217;s singleton implementations</a>.</p>
<p><span id="more-86"></span>
<pre><pre class="brush: csharp; collapse: false; title: ; notranslate">public static class Singleton&lt;T&gt;
  where T : class, new()
{
  public static T Instance
  {
    get
    {
      return Nested.Instance;
    }
  }

  class Nested
  {
    internal static readonly T Instance = new T();

    // Explicit static constructor to tell C# compiler
    // not to mark type as beforefieldinit
    static Nested()
    {
    }    
  }
}</pre>
<p>The class is based on Jon&#8217;s fifth version of a singleton implementation.  With Jon&#8217;s approach, you have to copy the singleton code into your class that you want to make a singleton.  With my variation, you can copy the Singleton&lt;T&gt; class into any C# project (or compile it into a reusable assembly) and then reuse it with any .NET class that has a default constructor.  You access the singleton instance of a class like this: <strong>Singleton<SomeClass>.Instance</strong> </p>
<p>Here&#8217;s an example of using the Singleton<T> class:</p>
<pre><pre class="brush: csharp; collapse: false; title: ; notranslate">
public class HelloWorldService
{
  public HelloWorldService
  {
    System.Console.WriteLine(&quot;New object!&quot;);
  }
  
  public void SayHello()
  {
    System.Console.WriteLine(&quot;Hello World!&quot;);
  }

  public void SayGoodbye()
  {
    System.Console.WriteLine(&quot;Goodbye World!&quot;);
  }
}

public class Program
{
  public static void Main(string[] args)
  {
    Singleton&lt;HelloWorldService&gt;.Instance.SayHello();
    Singleton&lt;HelloWorldService&gt;.Instance.SayGoodbye();
  }
}
</pre>
<p>When you run the example you get this console output:</p>
<pre><pre class="brush: plain; collapse: false; title: ; notranslate">
New object!
Hello World!
Goodbye World!
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.simondean.org/2010/12/generic-singleton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using WebDriver with CSharp</title>
		<link>http://www.simondean.org/2009/12/using-webdriver-with-csharp/</link>
		<comments>http://www.simondean.org/2009/12/using-webdriver-with-csharp/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 18:58:30 +0000</pubDate>
		<dc:creator>Simon Dean</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Functional Testing]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MVC.NET]]></category>
		<category><![CDATA[WebDriver]]></category>

		<guid isPermaLink="false">http://www.simondean.org/?p=28</guid>
		<description><![CDATA[You can read my previous post if you&#8217;re interested in the background to this post. What follows is a step-by-step guide for using WebDriver from C# test code. Preparation What you&#8217;ll need: IKVM.NET.  I used version 0.40.0.1 and the download was called ikvmbin-0.40.0.1.zip WebDriver &#8220;all&#8221;.  The download will be called something like webdriver-all-7376.zip Once you&#8217;ve [...]]]></description>
				<content:encoded><![CDATA[<p>You can read <a href="http://www.simondean.org/2009/12/moving-away-from-selenium/">my previous post</a> if you&#8217;re interested in the background to this post. What follows is a step-by-step guide for using WebDriver from C# test code.</p>
<h3>Preparation</h3>
<p>What you&#8217;ll need:</p>
<ul>
<li><a href="http://www.ikvm.net/download.html">IKVM.NET</a>.  I used version 0.40.0.1 and the download was called <em>ikvmbin-0.40.0.1.zip</em></li>
<li><a href="http://code.google.com/p/selenium/downloads/list">WebDriver &#8220;all&#8221;</a>.  The download will be called something like <em>webdriver-all-7376.zip</em></li>
</ul>
<p><span id="more-28"></span>Once you&#8217;ve downloaded them, extract the two ZIPs on to your computer.</p>
<h3>Recompile WebDriver from Java to .NET</h3>
<p>Open up a command window and change directory to the directory where you extracted the WebDriver files.</p>
<p>Run the following from the command prompt (all on one line):</p>
<pre class="brush: plain; collapse: false; title: ; notranslate">path\to\ikvm\bin\ikvmc.exe -out:webdriver-all.dll -target:library *.jar</pre>
<p>The above line uses ikvmc.exe to recompile the WebDriver Java code into managed .NET classes.  The managed .NET classes are placed in the <em>webdriver-all.dll </em>assembly.</p>
<p>When I run ikvmc.exe it spits out about 1200 lines of warning messages!  However everything seems to work fine regardless.  I wouldn&#8217;t worry too much about the warning messages, but if anyone has the time, it&#8217;s worth digging into them (first thing to try would be to replace <em>*.jar</em> in the ikvmc.exe command line with a space separated list of all the WebDriver <em>.jar</em> files &#8211; with the files ordered so that every .jar file appears in the list after all the .jar files its dependent on).  Some of the warning messages like <em>duplicate class name</em>&#8230; and skipping class&#8230;<em>class is already available in referenced assembly</em>&#8230; are harmless.</p>
<h3>Using WebDriver from a Visual Studio Project</h3>
<p>Open Visual Studio 2008 and create a new C# Console Application project  called <em>WebDriverAndCSharp</em>.</p>
<p>Right click the project in Solution Explorer and add a references to the following DLLs:</p>
<ul>
<li>The <em>webdriver-all.dll</em> that you created above</li>
<li>All the DLLs in the <em>bin</em> directory that you extracted from the IKVM.NET download &#8211; except don&#8217;t add a reference to the <em>ikvm-native.dll</em> file</li>
</ul>
<dl id="attachment_40" class="wp-caption alignnone" style="width: 150px;">
<dt class="wp-caption-dt"><img class="size-medium wp-image-40 " title="Project References" src="http://www.simondean.org/wp-content/uploads/2009/12/Add-References-with-Highlighting-140x300.png" alt="References after adding webdriver-all.dll and IKVM.NET DLLs" width="140" height="300" /></dt>
</dl>
<h3>Adding ikvm-native.dll to the Project</h3>
<p>IKVM.NET also depends on a native (non-managed) DLL called <em>ikvm-native.dll</em>.  You can&#8217;t add <em>ikvm-native.dll</em> as a project reference due to a limitation of Visual Studio.  Instead you need to add a link to the <em>ikvm-native.dll</em> file by doing the following:</p>
<ol>
<li>Right click the project in Solution Explorer and click <em>Add\Existing Item&#8230;</em></li>
<li>In the Add Existing Item dialog box that appears:
<ol>
<li>Select <em>Executable Files (*.exe; *.dll; *.ocx)</em> in the drop down list of file types</li>
<li>Browse to the directory where you extracted the IKVM.NET download</li>
<li>Select the <em>ikvm-native.dll</em> file in the <em>bin</em> subdirectory</li>
<li>Click the down arrow next to the Add button (don&#8217;t actually click the Add button) and select <em>Add As Link</em></li>
</ol>
</li>
</ol>
<p>Next, right click <em>ikvm-native.dll </em>in the Solution Explorer and click properties. Change the <em>Build Action</em> to <em>None</em> and set <em>Copy to Output Directory</em> to <em>Copy Always</em>.</p>
<div id="attachment_41" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-41" title="ikvm-native.dll Properties" src="http://www.simondean.org/wp-content/uploads/2009/12/ikvm-native.dll-Properties-300x181.png" alt="Amended propeties for ikvm-native.dll" width="300" height="181" /><p class="wp-caption-text">Amended properties for ikvm-native.dll</p></div>
<h3>Adding the Example Code</h3>
<p>Open the Program.cs file and replace its contents with the following:</p>
<pre class="brush: csharp; collapse: false; title: ; notranslate">
namespace WebDriverAndCSharp
{
  using org.openqa.selenium;
  using org.openqa.selenium.firefox;
  using org.openqa.selenium.htmlunit;
  using org.openqa.selenium.ie;

  public class Program
  {
    public static void Main(string[] args)
    {
      SearchTheWeb(new HtmlUnitDriver());
      SearchTheWeb(new FirefoxDriver());
      SearchTheWeb(new InternetExplorerDriver());
      SearchTheWeb(new ChromeDriver());
      `
      System.Console.Out.WriteLine(&quot;Press ENTER to exit&quot;);
      System.Console.In.ReadLine();
    }

    public static void SearchTheWeb(WebDriver driver)
    {
      // And now use this to visit Google
      driver.get(&quot;http://www.google.com&quot;);

      // Find the text input element by its name
      WebElement element = driver.findElement(By.name(&quot;q&quot;));

      // Enter something to search for
      element.sendKeys(&quot;Cheese!&quot;);

      // Now submit the form. WebDriver will find
      // the form for us from the element
      element.submit();

      // Check the title of the page
      System.Console.Out.WriteLine(
        &quot;Page title is: &quot; + driver.getTitle());

      driver.quit();
    }
  }
}
</pre>
<p>The C# code above is a translation of the Java-based WebDriver example code given on the <a href="http://code.google.com/p/selenium/wiki/GettingStarted">WebDriver&#8217;s Getting Started page</a>.</p>
<h3>Running the Example</h3>
<p>Press F5 to launch the console app you&#8217;ve created.  If all goes well, after a few seconds you should see a Firefox window open and perform a search on Google for &#8220;Cheese!&#8221;.  You should then see Internet Explorer do the same.  When the app has finished &#8211; assuming nothing went wrong &#8211; the console app should look like this:</p>
<pre class="brush: plain; title: ; notranslate">
Page title is: Cheese! - Google Search
Page title is: Cheese! - Google Search
Page title is: Cheese! - Google Search
Press ENTER to exit
</pre>
<p>Now press the ENTER key to exit the console app.  The console app should then close.  If it doesn&#8217;t, then part of WebDriver may not have closed down cleanly &#8211; a problem which I&#8217;ve only encountered with Google Chrome (you&#8217;ll notice that Chrome is missing from the code example above).</p>
<h3>If Something Went Wrong</h3>
<p>When you run the example, if you get an exception message saying &#8220;The type initializer for &#8216;com.sun.jna.Native&#8217; threw an exception&#8221;, check the build output folder for your project (normally in the directory &#8220;bin\Debug&#8221; under the directory with your *.csproj file in it) and confirm you can see a file called <em>ikvm-native.dll</em>.  If the DLL isn&#8217;t there, take a look back in this posting at the section called <em>Adding ikvm-native.dll to the Project</em> and check you&#8217;ve followed all the steps there.  If that doesn&#8217;t work for you, another way to get the DLL into your build output directory is to do the following:</p>
<ol>
<li>Right click the project in Solution Explorer and click <em>Properties</em>.</li>
<li>On the left, click the <em>Build Events</em> tab.</li>
<li>Paste the following into the <em>Post-build event command line</em> textbox.  Make sure you replace <em>path\to</em> with the full path to where  you extracted <em>ikvm-native.dll</em> to (when you extracted the IKVM.NET ZIP file).</li>
</ol>
<pre class="brush: plain; title: ; notranslate">
copy /y path\to\ikvm-native.dll $(TargetDir)
</pre>
<p>Following these steps will ensure that the <em>ikvm-native.dll </em>DLL is copied to your build output folder everytime you build the project.</p>
<h3>Browser Support</h3>
<p>So far I&#8217;ve only tested a small fraction of WebDriver&#8217;s functionality from C#.  I&#8217;ll need to use it for a week or two to really get a feel for how stable WebDriver is when running under IKVM.NET.  However initial impressions suggest that WebDriver with C# works fine with the following browsers:</p>
<ul>
<li>HtmlUnit</li>
<li>Firefox</li>
<li>Internet Explorer</li>
</ul>
<h3>Google Chrome</h3>
<p>I encountered an issue getting Google Chrome working: WebDriver leaves the Google Chrome browser open when the ChromeDriver is closed.  This leads to the console app not terminating properly. It&#8217;s a shame because other than that, Chrome seems to work well with WebDriver + .NET.</p>
<p>If you want to try Chrome for yourself, make sure you <a href="http://dev.chromium.org/getting-involved/dev-channel">switch your Chrome browser over to either the beta or dev streams</a> and that your Chrome version is 4.0.206.*+.  I found Google&#8217;s <a href="http://dev.chromium.org/getting-involved/dev-channel/using-the-channel-changer">Channel Changer</a> app very helpful.</p>
<p>See the <a href="http://code.google.com/p/selenium/wiki/ChromeDriver">WebDriver page on the ChromeDriver</a> for more information on using Chrome with WebDriver.</p>
<p><strong>Update: </strong>Daniel Wagner-Hall on the WebDriver discussion group has kindly helped me out with getting ChromeDriver working.  Turns out I should have used driver.quit() instead of driver.close().  I&#8217;ve updated the example above to use driver.quit() (see the WebDrive discussion group for more).  With the change, Chrome nolonger stops the console app from finishing.  However I am still seeing Chrome outputting the wrong page title on the console app &#8211; unlike the other drivers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simondean.org/2009/12/using-webdriver-with-csharp/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Moving away from Selenium</title>
		<link>http://www.simondean.org/2009/12/moving-away-from-selenium/</link>
		<comments>http://www.simondean.org/2009/12/moving-away-from-selenium/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 01:40:36 +0000</pubDate>
		<dc:creator>Simon Dean</dc:creator>
				<category><![CDATA[Functional Testing]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MVC.NET]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[WebDriver]]></category>

		<guid isPermaLink="false">http://www.simondean.org/?p=7</guid>
		<description><![CDATA[Recently I&#8217;ve spent a lot of time developing MVC.NET based web apps. The automated functional tests for these web apps have all been written using Selenium, with the tests written in C#  and organized as NUnit test fixtures. Whilst I found Selenium to be a good tool, I ran into some serious problems with it: Some [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I&#8217;ve spent a lot of time developing MVC.NET based web apps. The automated functional tests for these web apps have all been written using Selenium, with the tests written in C#  and organized as NUnit test fixtures.</p>
<p>Whilst I found Selenium to be a good tool, I ran into some serious problems with it:</p>
<ol>
<li>Some of my Selenium based functional tests would fail approximately 10% of the time when they were run against Firefox.   Switching the exact same tests to using Internet Explorer (still with Selenium) resulted in the tests returning to 100% stability.  This meant abandoning automated functional testing with Firefox in favour of using IE.</li>
<li>Slow performance in Internet Explorer (mitigated to some extent by switching the XPath engine Selenium uses with it).  IE just isn&#8217;t a fast browser when used with Selenium.</li>
<li>Many of Seleniums operations are non-blocking (i.e. asynchronous).  This means Selenium doesn&#8217;t wait for those operations to complete before allowing a test to continue.  For example opening a new webpage in Selenium is a non-blocking operation; Selenium will happily load a page and then (via the next line in the functional test) attempt to click a button on the page when the button hasn&#8217;t even loaded yet.</li>
</ol>
<p>Looking round for an alternative to Selenium, there was one obvious replacement: WebDriver.  <span id="more-7"></span>In many ways WebDriver is quite similar to Selenium.  However the two differ quite markedly in one regard: Selenium performs its automation using its own JavaScript running within the browser it&#8217;s automating whereas WebDriver controls the browser from the outside, using an COM automation API for Internet Explorer and custom browser extensions for Firefox and Google Chrome. The WebDriver approach has proven much more flexible and faster performing than the Selenium approach.  Simon Stewart has written an <a href="http://google-opensource.blogspot.com/2009/05/introducing-webdriver.html">interesting post on the Google Blog</a> that delves further into this topic.  Another important point in WebDriver&#8217;s favour is that <a href="http://clearspace.openqa.org/thread/15646">Selenium and WebDriver have started to merge</a> into a single project / code base.</p>
<p>Having gotten very interested in WebDriver, I was really surprised to find it doesn&#8217;t (yet) support .NET.  At the moment WebDriver can be used from tests written in Java (and Ruby/Python) but not .NET.</p>
<p>Given that I was very keen to use WebDriver with C#, I started to think about any &#8220;out of the box&#8221; ways I could get this working.  I was thinking some sort of interop bridging or remoting between Java and .NET.</p>
<p>First I looked at the new <a href="http://jni4net.sourceforge.net/">jni4net</a> project.  jni4net allows you to fireup an instance of the Java Virtual Machine (JVM) from within your .NET application; you can then interact with the java classes running in the JVM using pre-generated .NET proxy classes.  jni4net looked promising but ultimately wasn&#8217;t a workable solution; the current version of jni4net isn&#8217;t able to generate proxy classes for Java nested static classes &#8211; a Java language feature that the WebDriver API relies on.</p>
<p>Then I came across <a href="http://www.ikvm.net/">IKVM.NET</a> &#8211; a project I&#8217;ve read about before but never used.  I&#8217;m happy to say I was able to get WebDriver to work with C# using IKVM.NET!! The solution even works with JetBrains ReSharper test runner for Visual Studio. Read my <a href="http://www.simondean.org/2009/12/using-webdriver-with-csharp/">step-by-step guide to getting WebDriver working with C#</a> for more info.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simondean.org/2009/12/moving-away-from-selenium/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
