<?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>Peter Krantz &#187; .NET</title>
	<atom:link href="http://www.peterkrantz.com/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.peterkrantz.com</link>
	<description></description>
	<lastBuildDate>Sat, 04 Feb 2012 09:57:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Will Rails ever run on IronRuby?</title>
		<link>http://www.peterkrantz.com/2008/rails-on-ironruby/</link>
		<comments>http://www.peterkrantz.com/2008/rails-on-ironruby/#comments</comments>
		<pubDate>Mon, 28 Jan 2008 22:23:14 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2008/rails-on-ironruby/</guid>
		<description><![CDATA[I met Ola Bini at the local Geeknight the other day and we had a brief chat ...]]></description>
			<content:encoded><![CDATA[<p>I met Ola Bini at the local Geeknight the other day and we had a brief chat about platforms, Ruby and RDF among other things. Ola mentioned that he wasn&#8217;t sure that Rails wuld run on <a href="http://www.ironruby.net/">IronRuby</a> &#8211; Microsoft&#8217;s implementation of Ruby for the CLR.</p>
<p>I have been following what John Lam has been writing about their progress (and I correctly <a href="http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/">predicted him joining Microsoft</a>:-) and it appears that running Rails is a goal of the IronRuby project. But, will that be of interest to Microsoft? MS recently launched the first version of an <a href="http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx">MVC framework for the ASP.NET platform</a>. This seems like an attempt to satisfy the curiosity of .net developers that have seen screen casts and office mates develop apps in Ruby on Rails.  The framework is part of the Visual Studio 2008 offerings.</p>
<p>If you were able to deploy a Rails app by dropping a DLL on a Windows web server I can see Rails popularity exploding. The .net platform seems to occupy a mid-level segment of application hosting operations, right where Rails development seem to be.</p>
<p>Only time will tell I guess.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/rails-on-ironruby/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Microsoft to release MVC framework with Visual Studio 2008</title>
		<link>http://www.peterkrantz.com/2007/ms-aspnet-mvc-framework/</link>
		<comments>http://www.peterkrantz.com/2007/ms-aspnet-mvc-framework/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 19:08:17 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/ms-aspnet-mvc-framework/</guid>
		<description><![CDATA[As someone hinted in the comments to my previous posts on ASP.NET MVC frameworks, Microsoft is apparently ...]]></description>
			<content:encoded><![CDATA[<p>As someone hinted in the comments to my <a href="http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/">previous posts on ASP.NET MVC frameworks</a>, Microsoft is apparently releasing a new <a href="http://codebetter.com/blogs/jeffrey.palermo/archive/2007/10/05/altnetconf-scott-guthrie-announces-asp-net-mvc-framework-at-alt-net-conf.aspx">MVC framework</a> to make ASP.NET development simpler. According to the latest news, it will be released sometime after Visual Studio 2008. Last time I heard VS2008 is <a href="http://geekswithblogs.net/sdorman/archive/2007/07/10/Visual-Studio-2008-release-date.aspx">scheduled for a late february 2008 release</a> which means we should be lucky to see this framework sometime in March.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/ms-aspnet-mvc-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When PHP makes sense</title>
		<link>http://www.peterkrantz.com/2007/when-php-makes-sense/</link>
		<comments>http://www.peterkrantz.com/2007/when-php-makes-sense/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 20:42:31 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/when-php-makes-sense/</guid>
		<description><![CDATA[I have been looking into development frameworks for a web based software product. I want the product to be able to be installed on a variety of platforms, including Windows server with IIS. First I was looking at creating the app in ASP.NET and make it run under Mono. Unfortunately I can't find an <a href="http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/">MVC framework for ASP.NET</a> that works the way I want. Ruby on Rails has really lowered the threshold of what I can put up with in the form of configuration and learning curve. Damn you DHH and your rapid web framework:-)]]></description>
			<content:encoded><![CDATA[<p>I have been looking into development frameworks for a web based software product. I want the product to be able to be installed on a variety of platforms, including Windows server with IIS. First I was looking at creating the app in ASP.NET and make it run under Mono. Unfortunately I can&#8217;t find an <a href="http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/">MVC framework for ASP.NET</a> that works the way I want. Ruby on Rails has really lowered the threshold of what I can put up with in the form of configuration and learning curve. Damn you DHH and your rapid web framework:-)</p>
<p>Ruby on Rails runs happily on Linux and in Java environments thanks to JRuby. It does not work well with IIS yet (until IronRuby is here I guess). There is, however, interesting work being done in the <a href="http://www.codeplex.com/RORIIS">RORIIS project</a> (also see Dorje McKinnon&#8217;s <a href="http://dorjem.blogspot.com/2007/02/to-setup-rails-on-iis-and-enable-it-for.html">Set up Rails on IIS blog post</a>). The only problem I have is that I have heard a lot of reports where Rails under IIS isn&#8217;t working properly and that the RORIIS bundles several components that Windows server managers may find scary.</p>
<p>Django and Turbogears does not seem to work well under IIS either. For <a href="http://code.djangoproject.com/wiki/DjangoOnWindowsWithIISAndSQLServer">Django, the PyISAPI is required</a> and apparently it hasen&#8217;t been actively developed for a while leading to bugs in the latest version of Django (you also have to run Python 2.4 instead of 2.5).</p>
<p><a href="http://turbogears.org/">Turbogears</a> seems to be <a href="http://docs.turbogears.org/1.0/BehindIIS">close to work on IIS</a>. Only problem is that it requires a <a href="http://www.saltypickle.com/Home/16">reverse proxy filter</a> that hasen&#8217;t been actively developed since 2005 which makes me wary about using it.</p>
<p>So, looking at <a href="http://www.symfony-project.com/">Symfony, the Rails inspired PHP framework</a>, I am beginning to wonder if that would be the best choice right now. The <a href="http://www.symfony-project.com/cookbook/1_0/web_server_iis">installation instructions for Windows/IIS</a> seem straightforward. Symfony recommends the <a href="http://www.isapirewrite.com/">commercial ISAPIRewrite filter</a> (lite version os free). For IIS7 it looks like Microsoft is stepping up to the plate with a <a href="http://blogs.iis.net/bills/archive/2006/10/31/PHP-on-IIS.aspx">decent Fast CGI module</a>. Performance seems to be adequate too. </p>
<p>So, right now, Symfony/PHP seems like a decent choice for this app if I can live with the <a href="http://www.bitstorm.org/edwin/en/php/">intricacies of PHP</a>. Who would have thought&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/when-php-makes-sense/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Looking for ASP.NET MVC Frameworks&#8230;</title>
		<link>http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/</link>
		<comments>http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 15:37:09 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/</guid>
		<description><![CDATA[I have been looking for an open source alternative to the default way of buildig web sites ...]]></description>
			<content:encoded><![CDATA[<p>I have been looking for an open source alternative to the default way of buildig web sites in ASP.NET with Visual Studio. After having build a couple of applications with Ruby on Rails it hard to go back to the <a href="http://martinfowler.com/eaaCatalog/pageController.html">Page Controller pattern</a> that Microsoft introduced in ASP.NET. Coming back to the ASP.NET page event model makes it clear that they created it for VB6 application developers that were used to Windows forms-centered development. Apparently they didn&#8217;t want to those developers to have to learn about HTTP and HTML to be able to write applications.<span id="more-101"></span></p>
<p>I guess from a marketing persepective it may have been the right choice (for Microsoft), but right now it feels like a horrible mess for me. So, I spent a couple of hours researching the alternatives. There are a number of commercial packages available (LLBLGen et al) but I only found three that looked interesting for my purposes:</p>
<ol>
<li><a href="http://www.castleproject.org/">MonoRail</a>: The Ruby on Rails-inspired framework with an ActiveRecord component based on NHibernate.</li>
<li><a href="http://www.springframework.net/">Spring.NET: A port of the Spring framework for Java.</a></li>
<li><a href="http://www.codeplex.com/PixelDragonsMVC">PixelDragons MVC</a>: this looks promising but seems to lack real world use? Requires further investigation.</li>
</ol>
<p>Looking at the <a href="http://www.springframework.net/docs/1.1-RC1/reference/html/quickstarts.html">quickstart documentation for Spring.NET</a> I decided that it was way too much configuration involved to get things running. Ruby on Rails has definitely lowered my tolerance for lengthy project setups.</p>
<p>The <a href="http://www.castleproject.org/monorail/gettingstarted/">getting started tutorial for MonoRail</a> looked much more pleasant. The MonoRail framework comes with a nice MSI installer and a <a href="http://www.castleproject.org/castle/vsintegration.html">custom project wizard</a> to quickly set up a project skeleton in Visual Studio 2005. There is even an option to create an associated test project from the start.</p>
<p>After some initial problems with getting the application talking to my SQL Server 2005 database (Microsoft has drastically increased security for the 2005 version resulting in a number of configuration steps to be able to talk to the db at all) I had a sample app going. Users of Ruby on Rails will feel at home since you can do nice stuff like:</p>
<pre class="brush: csharp; title: ; notranslate">
public void CreateUser()
{
      User owner = new User();
      owner.FirstName = &quot;Peter&quot;;
      owner.LastName = &quot;Krantz&quot;;
      owner.Create();
}
</pre>
<p>Then I wanted to try a TDD approach and this is where I am currently stuck. The MonoRail project wizard creates a sample test project with a sample test of a controller. However, according to people in the forum that approach is deprecated and a different way of testing controllers is described on the MonoRail wiki. But that approach does not work for testing your model classes and there is no information on how to get an application context to do that. Or maybe I have missed it when Googling for a solution.</p>
<h2>Can I have just the O/RM please?</h2>
<p>So, if I go back to the Page Controller pattern, can I please have an open source persistence framework that allows me to write code like above? I was happy to find this <a href="http://csharp-source.net/open-source/persistence">rather extensive list of persistence frameworks</a>. The only problem is that most of them are not actively developed anymore. Or, they have simply disappeared as Microsoft is <a href="http://www.gotdotnet.com/workspaces/default.aspx">shutting down the GotDotNet website</a> where many of them are/were hosted.</p>
<p>If you stick to the default pattern in ASP.NET you have a wealth of excellent tutorials and documentation from Microsoft and others. Going off the beaten track seems more difficult though. Hopefully the MonoRail issue will be solved and I can use it for my product idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/aspnet-mvc-frameworks/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Bringing Ruby to the .NET environment</title>
		<link>http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/</link>
		<comments>http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/#comments</comments>
		<pubDate>Tue, 05 Jun 2007 09:04:15 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/</guid>
		<description><![CDATA[Things are heating up in the Ruby-as-a-dotnet-language area. Martin Fowler voiced his concerns on Microsoft not being ...]]></description>
			<content:encoded><![CDATA[<p>Things are heating up in the Ruby-as-a-dotnet-language area. <a href="http://martinfowler.com/bliki/RubyMicrosoft.html">Martin Fowler voiced his concerns</a> on Microsoft not being able to look at source code and therefore having trouble implementing Ruby properly. Microsoft, with <a href="http://www.iunknown.com/">John Lam</a> in the cockpit, is implementting Ruby for the .net platform (if you have been reading my previous blog posts I predicted way <a href="http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/">back in february 2006</a> that John Lam would get scooped up my Microsoft:-).</p>
<p><a href="http://ola-bini.blogspot.com/2007/06/there-can-be-only-one-tale-about-ruby.html">Ola Bini is also concerned</a> about Microsoft not letting ther developers look at the Ruby implementation. If you remember the whole SCO debacle I guess it isn&#8217;t that strange. Microsoft is in the position where software they develop potentially may end up in millions of computers. Apparently the US legal system awards damages in proportion to this. Thus, any issues with a Ruby implementation on .net can quickly become costly.</p>
<p>It is all quite bizarre. Does this mean that the Microsoft version of the Ruby language is different from the &#8220;original&#8221; Ruby? I guess we will never know. Developers will probably write a lot of Ruby code that runs happily on the CLR. Rails applications will be deployed. But I am sure that there will be &#8220;special cases&#8221; where IronRuby will differ from &#8220;original&#8221; Ruby.</p>
<p>Therefore is was refreshing to see that Queensland University of Technology are progressing steadily with <a href="http://plas2003.fit.qut.edu.au/Ruby.NET/">their Ruby.NET implementation</a>. Currently you can actually compile a Ruby script into a .NET 2.0 assembly that other CLR languages can talk to. This may be the spearhead into the <a href="http://www.peterkrantz.com/2007/enterprise-rails-deployment/">other half of enterprise deployment options</a>.</p>
<p>All in all the future of software development looks bright. Will developers that invested a lot of time in Java or C# switch? Or will they move on to maintaining applications?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/bringing-ruby-to-the-net-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enterprise Rails Deployment Getting Closer (thanks to Ola Bini and the JRuby team)&#8230;</title>
		<link>http://www.peterkrantz.com/2007/enterprise-rails-deployment/</link>
		<comments>http://www.peterkrantz.com/2007/enterprise-rails-deployment/#comments</comments>
		<pubDate>Mon, 07 May 2007 19:21:43 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Trends]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/enterprise-rails-deployment/</guid>
		<description><![CDATA[Let&#8217;s forget about that for a while. Ola Bini and the JRuby team is quickly moving forward ...]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s forget about that for a while. <a href="http://ola-bini.blogspot.com/">Ola Bini</a> and the JRuby team is quickly moving forward with something I would consider a breakthrough in Rails deployment options. In fact, it could well mean a breakthrough in Rails adoption in many organizations.<span id="more-80"></span></p>
<h2>Why (some) IT-managers like Rails but don&#8217;t like deploying it</h2>
<p>When I was a consultant I talked to many IT-managers that had heard about Ruby on Rails. They were intrigued by the fact that Ruby and Rails were created for developers rather than machines. Most of them realized that developer time costs more than computer performance today (although some of them were still spending money at developers writing unnecessarily complicated code to run fast on hardware that costs less than 20 developer hours).</p>
<p>However, these IT-managers weren&#8217;t too keen on deploying Rails applications in their environment. You see, if you spent the last five years creating a homogenous server environment it is likely that you have invested a lot in it. The following typically applies in this type of environment:</p>
<ul>
<li>You have specialized server administrators that know how to deploy, run and monitor aplications in the environment.</li>
<li>One or more large vendors have sold you expensive software in which you run your applications.</li>
<li>The same vendors have sent you a lot of marketing material telling you how lucky you are to be running their software and that your competitors are running the same thing.</li>
<li>Developing software for the environment requires expensive consultants. This, obviously, means that you get professionals.</li>
<li>Software typically runs fine in the environment.</li>
</ul>
<p>The environment may be Java or .NET. The investment is typically bigger if it is Java.</p>
<p>And then Rails developers come to you and say that your investment in this homogenous environment should be thrown away. You staff should be retrained and deployment no longer takes a week. Obviously these developers must be lying.</p>
<h2>Why Ola Bini and the Jruby team may increase Rails adoption</h2>
<p>Any day now it will be possible to wrap up your <a href="http://headius.blogspot.com/2006/12/another-step-toward-rails-war-files.html">Rails app in a WAR-file</a> and put it right into a Java server environment. It may already work for all I know. Server administrators may not even see the difference between a Rails app and a regular Java app.</p>
<p>When this is easy to do I believe that Rails will se a much larger adoption in larger organizations (with these types of environments). And from there it will only get better. Thoughtworks seem to be in on <a href="http://studios.thoughtworks.com/2007/5/7/mingle-to-run-on-jruby">the same track</a>.</p>
<p>I guess both Sun and Microsoft realized the importance of being able to run Rails applications in existing environments. Sun is supporting JRuby and Microsoft <a href="http://www.iunknown.com/">hired John Lam</a> to make Ruby run on the CLR (they already had <a href="http://blogs.msdn.com/hugunin/archive/2004/10/11/240841.aspx">Jim Hugunin</a> make it possible to run Python code fast on the CLR).</p>
<p><strong>Interesting times are ahead!</strong></p>
<p>I guess we will have to thank Ola and the JRuby team for that&#8230;</p>
<p>Update: I was just told that <a href="http://flickr.com/photos/x180/245186478/">James DD snapped a picture of me</a> sitting next to Ola at Railsconf London. It is a small world after all.</p>
<p>Update 2: And here are instructions on how to <a href="http://letsgetdugg.com/view/How_to_deploy_a_self_contained_Rails_application_on_Tomcat,_painlessly">create a WAR file of a Rails app</a> for deployment in Tomcat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/enterprise-rails-deployment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Two additional problems for Rails: eat SOAP and connect to MSSQL</title>
		<link>http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/</link>
		<comments>http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/#comments</comments>
		<pubDate>Sat, 24 Jun 2006 12:46:16 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/</guid>
		<description><![CDATA[At the opening keynote here at RailsConf in Chicago Dave Thomas (of Pragmatic Programmer fame) presented three ...]]></description>
			<content:encoded><![CDATA[<p>At the opening keynote here at <a href="http://railsconf.org/">RailsConf</a> in Chicago Dave Thomas (of Pragmatic Programmer fame) presented three problems for the Rails community to solve. His idea was that these would help Rails become more popular in organizations. I would like to add two more: a SOAP library and an improved MSSQL-server driver.</p>
<p>Judging from the amount of Microsoft-bashing going on here I would venture to guess that these aren&#8217;t on the top of the list for most Rails developers. However, I believe they would make it a lot easier to implement Rails applications in the corporate world and increase the Rails adoption rate.</p>
<ol>
<li>A SOAP library that at least can consume other SOAP services (including bastardized interfaces returning .net datasets) would ease the adoption of Rails in internal CRUD applications. Rails isn&#8217;t alone in the world and while it is easy to say that other people&#8217;s SOAP interfaces are crap the reality is that they are there and there is little you can do about it. Changing existing web service interfaces is a tricky task as it may invlove a lot of other applications.</li>
<li>The MSSQL driver is necessary to remove another obstacle in the decision process of selecting Rails. Most companies standardize on their production server platforms. This means they will typically have a cluster with a specific database engine somewhere which other applications share. Brian Hogan has done some excellent work in showing how <a href="http://www.napcs.com/howto/rails/deploy/">Rails can be deployed in a Windows Server environment</a>. From what I hear  the <a href="http://wiki.rubyonrails.org/rails/pages/HowtoConnectToMicrosoftSQLServer">current incarnation of the MSSQL-server driver</a> for Ruby isn&#8217;t up to par with the rest of the pack.</li>
</ol>
<p>I believe that being able to deploy Rails in your existing Microsoft environment using MSSQL-server would make it easier for managers to give a go ahead for Rails projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/two-additional-problems-for-rails-eat-soap-and-connect-to-mssql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Ruby as a .NET language</title>
		<link>http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/</link>
		<comments>http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/#comments</comments>
		<pubDate>Thu, 02 Feb 2006 10:29:12 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/</guid>
		<description><![CDATA[John Lam has created an initial version of RubyCLR which allows you to use Ruby through the ...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.iunknown.com/">John Lam</a> has created an <a href="http://www.iunknown.com/articles/2006/01/12/first-drop-of-rubyclr">initial version of RubyCLR</a> which allows you to use Ruby through the .NET CLR. Although there is no support for generics or marshaling of user-defined value types it is still a very interesting release.</p>
<p>Microsoft will undoubtedly monitor his progress closely. Maybe he will go the same way as <a href="http://hugunin.net/">Jim Hugunin</a> who created <a href="http://www.ironpython.com/">IronPython</a> and then joined <a href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20051110PythonJH/manifest.xml">Microsoft&#8217;s CLR team</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/using-ruby-as-a-net-language/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Selenium for automated functional testing of ASP.NET applications</title>
		<link>http://www.peterkrantz.com/2005/selenium-for-aspnet/</link>
		<comments>http://www.peterkrantz.com/2005/selenium-for-aspnet/#comments</comments>
		<pubDate>Wed, 28 Dec 2005 11:54:32 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2005/selenium-for-aspnet/</guid>
		<description><![CDATA[This is an introdution to how you can use Selenium to do automated functional testing of ASP.NET applications.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.openqa.org/selenium/">Selenium (by Thoughtworks)</a> is on open source  tool for automated functional tests. It&#8217;s simplicity makes it an excellent candidate for introducing automated functional testing in your project. <span id="more-9"></span>(<strong>Hi!</strong> This article is now several years old and updates may have changed how Selenium works)</p>
<p>Setting it up for an ASP.NET application is done in a few simple steps:</p>
<ol>
<li><a href="http://www.openqa.org/selenium/download.action">Download Selenium</a> (choose the full install).</li>
<li>Create a folder &#8220;selenium&#8221; in your web site root folder.</li>
<li>Unpack the zip file and move the selenium files to to the selenium folder.</li>
</ol>
<p>That&#8217;s it! Selenium is now installed. You can test the installation by running the Selenium self-test by pointing your browser to <a href="http://localhost/selenium/TestRunner.html">http://localhost/selenium/TestRunner.html</a>. Selenium runs in your browser of choice and there is nothing more to install.</p>
<h2>Creating your own tests</h2>
<p>Getting started with your own test suite is easy. A test suite consists of one or more test cases. A test case consists of a <a href="http://www.openqa.org/selenium/seleniumReference.html">series of commands and verification points</a> which you specify in a table in an HTML file. A sample test case looks like this:</p>
<pre>&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="3"&gt;Test search query&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;open&lt;/td&gt;
&lt;td&gt;/default.aspx&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;verifyTextPresent&lt;/td&gt;
&lt;td&gt;Welcome to the sample search application&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;type&lt;/td&gt;
&lt;td&gt;StartpageFramework1_QuickSearch1_txtSearchPhrase&lt;/td&gt;
&lt;td&gt;ultramarine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;clickAndWait&lt;/td&gt;
&lt;td&gt;StartpageFramework1_QuickSearch1_btnSearch&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;verifyTextPresent&lt;/td&gt;
&lt;td&gt;No match found&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</pre>
<p>It should be fairly obvious what this test case does; the page default.aspx is opened in the browser, the text &#8220;Welcome to the sample search application&#8221; is identified, &#8220;ultramarine&#8221; is typed into the search box field, the search button is clicked and then we verify that the text &#8220;No match found&#8221; was displayed.</p>
<p>As you can see, the type command needs a way to locate which field to type the text into. The easiest way is to use the id of the HTML element (<a href="http://www.openqa.org/selenium/seleniumReference.html#element-locators">there are other ways to locate an element</a>). If you use runat=server controls ASP.NET will have generated the HTML element id for you and depending on it&#8217;s position it may look something like StartpageFramework1_QuickSearch1_txtSearchPhrase. Unfortunately the id will change if you move the search field to a different container. This would force us to update the test case every time we did minor changes to the page.</p>
<p>Thus, a better way to identify fields and buttons is to use an <a href="http://www.w3schools.com/xpath/xpath_intro.asp">XPATH expression</a>:</p>
<pre>//input[contains(@id, "txtSearchPhrase")]</pre>
<p>This will make the test case independent of control hierarchy changes.</p>
<p>After you have saved the test case to a file (name it &#8220;searchtest.htm&#8221; and put it in the selenium directory for now) you can create a test suite where we point out one or more test cases. A test suite is also described in an HTML table like this:</p>
<table>
<tbody>
<tr>
<td>My test suite</td>
</tr>
<tr>
<td><a href="http://www.peterkrantz.com/searchtest.htm">Search function test</a></td>
</tr>
</tbody>
</table>
<p>Each test case in the suite is identified with a link in a single table row. Save the test suite (name it &#8220;searchsuite.htm&#8221; and put it in the selenium directory).</p>
<h2>Run your tests</h2>
<p>Now it is time to test your application. To open Selenium with your test suite, point your browser to <a href="http://localhost/selenium/TestRunner.html?test=searchsuite.htm">http://localhost/selenium/TestRunner.html?test=searchsuite.htm</a> and start it. You can follow the progress as the test is carried out.</p>
<h2>Next step</h2>
<p>All in all Selenium is a quick way to get started with automated functional testing. Apart from opening URL:s and verifying text fragments Selenium is also capable of handling javascript dialogs, variables, continuous testing/reporting and many other features. For more details see the Selenium web site.</p>
<p>You can also combine Selenium with NUnit to get a complete testing environment. Instead of running test cases in the browser it is possible to <a href="http://www.openqa.org/selenium/driven.html">install the .NET test driver</a> which gives you control of the browser process via .NET code.</p>
<h2>More information</h2>
<ul>
<li><a href="http://www-128.ibm.com/developerworks/library/wa-selenium-ajax/">Selenium for functional testing of a Ruby on Rails and Ajax application</a></li>
<li><a href="http://seleniumrecorder.mozdev.org/">Record Selenium scripts in Firefox</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2005/selenium-for-aspnet/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

Served from: www.peterkrantz.com @ 2012-02-04 11:04:18 -->
