<?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; Testing</title>
	<atom:link href="http://www.peterkrantz.com/category/testing/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>Quotes from the Nato Software Engineering Conference in 1968</title>
		<link>http://www.peterkrantz.com/2011/software-engineering-in-1968/</link>
		<comments>http://www.peterkrantz.com/2011/software-engineering-in-1968/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 15:47:40 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Trends]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[software quality]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=422</guid>
		<description><![CDATA[Sometimes we forget that other people have faced the same problems we face today in software development. These quotes are from the proceedings of the Nato Software Engineering conference in 1968.]]></description>
			<content:encoded><![CDATA[<p>Sometimes we forget that other people have faced the same problems we face today in software development. These quotes are from the <a href="http://homepages.cs.ncl.ac.uk/brian.randell/NATO/nato1968.PDF">proceedings of the Nato Software Engineering conference in 1968</a>.<span id="more-422"></span></p>
<p>On the management of software projects:</p>
<blockquote><p>Programming management will continue to deserve its current poor reputation for cost and schedule effectiveness until such time as a more complete understanding of the program design process is achieved.</p>
<p>We build systems like the Wright brothers built airplanes — build the whole thing, push it off the cliff, let it crash, and start over again.</p>
<p>Production of large software has become a scare item for management. By reputation it is often an unprofitable morass, costly and unending. This reputation is perhaps deserved.</p></blockquote>
<p>On the distinction between design and production:</p>
<blockquote><p>Software production takes us from the result of the design to the program to be executed in the computer. The distinction between design and production is essentially a practical one, imposed by the need for a division of the labor. In fact, there is no essential difference between design and production [...]</p>
<p>The most deadly thing in software is the concept, which almost universally seems to be followed, that you are going to specify what you are going to do, and then do it. And that is where most of our troubles come from.</p></blockquote>
<p>On dealing with user requirements:</p>
<blockquote><p>Users are interested in systems requirements and buy systems in that way. But that implies that they are able to say what they want. Most of the users aren’t able to.</p>
<p>We should have feedback from users early in the design process.</p></blockquote>
<p>On programmer performance (compare with the essay <a href="http://www.paulgraham.com/gh.html">Great Hackers by Paul Graham</a>):</p>
<blockquote><p>I have a question on the huge range of variability of programmer performance. Are similar ranges found in other engineering areas? [..] The variation range in programming is in fact greater than in other fields.</p></blockquote>
<p>On the production of software:</p>
<blockquote><p>We are starting gradually, and building up. My motto is ‘do something small, useful, now.</p>
<p>Large systems must evolve, and cannot be produced all at one time. You must have an initial small core system that works really well.</p></blockquote>
<p>On testing software:</p>
<blockquote><p>System testing should be automated as well. A collection of executable programs should be produced and maintained to exercise all parts of the system. [...] As an output of a test validation run, each test should list the modules it has exercised, and as well, should list the interfaces and tables it has tested. It is important to document success, as well as failure.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2011/software-engineering-in-1968/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Beta testing the UR TWEETS SUCK Tee</title>
		<link>http://www.peterkrantz.com/2010/beta-testing-the-ur-tweets-suck-tee/</link>
		<comments>http://www.peterkrantz.com/2010/beta-testing-the-ur-tweets-suck-tee/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 09:16:12 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[Trends]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[t-shirt]]></category>
		<category><![CDATA[tee]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=371</guid>
		<description><![CDATA[My son has the dubious pleasure of being the primary beta tester of T-shirt messages. This time ...]]></description>
			<content:encoded><![CDATA[<p>My son has the dubious pleasure of being the primary beta tester of T-shirt messages. This time it is the first draft of the model that will be called “Twat”. Turned out pretty OK… Also see the <a href="http://www.peterkrantz.com/2008/ballmer-tee-v/">Ballmer Tee</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2010/beta-testing-the-ur-tweets-suck-tee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The broken state of EU legal information on the web</title>
		<link>http://www.peterkrantz.com/2008/broken-eu-legal-information/</link>
		<comments>http://www.peterkrantz.com/2008/broken-eu-legal-information/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 15:25:51 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[EU]]></category>
		<category><![CDATA[eurlex]]></category>
		<category><![CDATA[law]]></category>
		<category><![CDATA[RDF]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=194</guid>
		<description><![CDATA[In my pet project eurlex.nu I find a lot of weird stuff when scraping documents from the ...]]></description>
			<content:encoded><![CDATA[<p>In my pet project <a href="http://eurlex.nu">eurlex.nu</a> I find a lot of weird stuff when scraping documents from the official website <a href="http://eur-lex.europa.eu">eur-lex.europa.eu</a>. The most recent specimen &#8211; <a href="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32008B0607:en:NOT">Final adoption of amending budget No 4 of the European Union for the financial year 2008</a> &#8211; has the publish date 80/80/2200. That&#8217;s almost two hundred years into the future with an invalid day/month combo on top. This leads me to believe that the system is in such a broken state that even simple date validation isn&#8217;t implemented.</p>
<p>Someone delivered a really poor software project for our tax money. I would love to redo the european legal information website with proper standards (e.g. validating HTML, RDF and proper semantics).</p>
<p>Oh well&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/broken-eu-legal-information/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick site performance improvement</title>
		<link>http://www.peterkrantz.com/2008/quick-site-performance-improvemen/</link>
		<comments>http://www.peterkrantz.com/2008/quick-site-performance-improvemen/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 13:38:00 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=164</guid>
		<description><![CDATA[I have been playing with YSlow, Yahoo&#8217;s tool for web site profiling, for a while. If you ...]]></description>
			<content:encoded><![CDATA[<p>I have been playing with <a href="http://developer.yahoo.com/yslow/">YSlow</a>, Yahoo&#8217;s tool for web site profiling, for a while. If you haven&#8217;t tried YSlow (which is a Firefox addon to Firebug) I recommend you try it right away. Install the <a href="http://getfirebug.com/">Firebug</a> extension first and then add YSlow.<span id="more-164"></span></p>
<p>It is amazing how much you can improve the percieved site speed by some minor changes to your htaccess file. This site runs WordPress and I was tempted to install the <a href="http://ocaoimh.ie/wp-super-cache/">WP-Super-Cache</a> plugin but was put off by some of the incompatibility issues that were reported with the latest version of WordPress and PHP safe mode. Until then I managed to lift my YSlow site score from grade F to grade C by:</p>
<p>1. <a href="http://developer.yahoo.com/performance/rules.html#etags">Removing ETag headers</a> by adding the following lines to my htaccess file (outside the wordpress-specific rewrite area):</p>
<pre>Header unset ETag
FileETag None</pre>
<p>2. <a href="http://developer.yahoo.com/performance/rules.html#expires">Setting a future expires header</a> for static files by adding this to htaccess:</p>
<pre>&lt;FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"&gt;
Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"
&lt;/FilesMatch&gt;</pre>
<p>If your app/blog uses some sort of dynamic generation of images you can modify the matching rule above for a more precise selection of files (e.g. only files in the templates folder).</p>
<p>Presto! Two simple additions to htaccess and cached access is down to two requests (of which one is Google&#8217;s javascript file for ads):</p>
<p><img class="size-full wp-image-165" title="site-speed" src="http://www.peterkrantz.com/wp-content/uploads/2008/07/site-speed.gif" alt="YSlow stats showing improved performance for this website." /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/quick-site-performance-improvemen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Does your webserver give HEAD?</title>
		<link>http://www.peterkrantz.com/2008/does-your-webserver-give-head/</link>
		<comments>http://www.peterkrantz.com/2008/does-your-webserver-give-head/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 17:01:34 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Standards]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/?p=147</guid>
		<description><![CDATA[In the process of constructing a crawler that finds and checks PDF documents on a website I ...]]></description>
			<content:encoded><![CDATA[<p>In the process of constructing a crawler that finds and checks PDF documents on a website I discovered a lot of sites that don&#8217;t return information for <a href="http://en.wikipedia.org/wiki/HTTP#Request_methods">HEAD requests</a>. A HEAD request should return the same set of HTTP headers as a normal GET request only without the actual payload.</p>
<p>The typical response seem to be status 500 (internal server error) on a lot of IIS sites. So, now is a good time to check your own sites to see what you get back from a:</p>
<p><kbd>curl --head http://www.mysite.com</kbd></p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2008/does-your-webserver-give-head/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New release of the Ruby Accessibility Analysis Kit and online interface</title>
		<link>http://www.peterkrantz.com/2007/raakt-052/</link>
		<comments>http://www.peterkrantz.com/2007/raakt-052/#comments</comments>
		<pubDate>Sun, 01 Apr 2007 20:37:43 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/raakt-052/</guid>
		<description><![CDATA[The current version has some minor bug fixes that will speed up testing. The online test interface ...]]></description>
			<content:encoded><![CDATA[<p>The current version has some minor bug fixes that will speed up testing. The <a href="http://www.peterkrantz.com/bacc/">online test interface</a> has been updated to support direct input of markup. This is for those of you unable to install Raakt locally.</p>
<p>This means that there is no reason to skip basic accessibility testing of whatever you are developing! To find out more on how you can integrate Raakt in your testing framework check out the <a href="http://www.peterkrantz.com/raakt/wiki/">Raakt wiki</a> which now has a lot more information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/raakt-052/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A new version of the Ruby Accessibility Analysis Kit</title>
		<link>http://www.peterkrantz.com/2007/raakt-in-watir/</link>
		<comments>http://www.peterkrantz.com/2007/raakt-in-watir/#comments</comments>
		<pubDate>Sat, 03 Mar 2007 16:58:22 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/raakt-in-watir/</guid>
		<description><![CDATA[This is to announce that RAAKT (The Ruby Accessibility Analysis Kit) has been updated. This release includes ...]]></description>
			<content:encoded><![CDATA[<p>This is to announce that <a href="http://rubyforge.org/projects/raakt">RAAKT (The Ruby Accessibility Analysis Kit)</a> has been updated. This release includes more accessibility tests and an initial mapping of tests to the <a href="http://www.wabcluster.org/uwem/tests/">Unified Web Evaluation Methodology</a> (UWEM). Also, thanks to Derek Perrault RAAKT now uses <a href="http://code.whytheluckystiff.net/hpricot/">Hpricot</a> to parse the HTML document. This solves the problem where the previous parser (RubyfulSoup) declared a class &#8220;Tag&#8221; that was likely to clash with your local classes in Rails.</p>
<p>To install the new version simply type <kbd>gem update raakt</kbd> or <kbd>gem install raakt</kbd> if you have a previous version installed.</p>
<h2>Changelog</h2>
<p>Summary of changes from version 0.4 to version 0.5.1.</p>
<ul>
<li>Example of how to use RAAKT in <a href="http://wtr.rubyforge.org/">Watir unit tests</a>.</li>
<li>Tests for area element alt attribute.</li>
<li><a href="http://www.wabcluster.org/uwem/tests/">UWEM</a> mapped in comments for relevant test methods.</li>
<li>Test to check that input fields of type image have an alt attribute with text.</li>
<li>Refactoring of some methods for more compact syntax. Patch by Derek Perrault.</li>
<li>Added test to verify that fieldsets have legends.</li>
<li>Fixed alt_to_text that needed to check element type before attempting to read attribute value.</li>
<li>Fixed language attribute check (downcased value). Added iso language code list.</li>
<li>Applied patch from Derek Perrault (better use of Hpricot features).</li>
<li>Fixed check for lang attribute (now requires a value as well). </li>
<li>Test for charset mismatch in http headers and document meta element.</li>
<li>Switch to Hpricot. Patch by Derek Perrault.</li>
</ul>
<p>An article on the value of, and how to integrate basic accessibility tests in your development process is in the works for <a href="http://www.standards-schmandards.com/">standards-schmandards.com</a>. In the meantime check out the <a href="http://www.peterkrantz.com/raakt/wiki/">Raakt wiki</a>.</p>
<p>If you are using Watir it is very simple:</p>
<p>require &#8216;watir&#8217;<br />
require &#8216;raakt&#8217;<br />
require &#8216;test/unit&#8217;</p>
<p>class TC_myTest < Test::Unit::TestCase<br />
	attr_accessor :ie</p>
<p>	def setup<br />
		@ie = Watir::IE.start(&#8220;http://www.peterkrantz.com&#8221;)<br />
	end</p>
<p>	def test_startPagePassesBasicAccessibilityCheck<br />
		#set up the accessibility test and pass html to raakt<br />
		raakttest = Raakt::Test.new(@ie.document.body.parentelement.outerhtml)</p>
<p>		#run all tests on the current page<br />
		result = raakttest.all</p>
<p>		#make sure raakt didn&#8217;t return any error messages<br />
		assert(result.length == 0, result)<br />
	end<br />
end</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/raakt-in-watir/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Parsing ASP.NET sites with WWW::Mechanize and Hpricot</title>
		<link>http://www.peterkrantz.com/2007/mechanize-on-aspnet/</link>
		<comments>http://www.peterkrantz.com/2007/mechanize-on-aspnet/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 20:16:07 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2007/mechanize-on-aspnet/</guid>
		<description><![CDATA[Users of Hpricot (which WWW::Mechanize is using as the default html parser) may have discovered that the ...]]></description>
			<content:encoded><![CDATA[<p><img src='http://www.peterkrantz.com/wp-content/uploads/2007/02/mechanize-hpricot-trsp.gif' alt='' class='right'/>Users of <a href="http://code.whytheluckystiff.net/hpricot/">Hpricot</a> (which <a href="http://mechanize.rubyforge.org/">WWW::Mechanize</a> is using as the default html parser) may have discovered that the buffer size for attribute values is set to 16384 bytes default. Typically this isn&#8217;t a problem, I mean who would put 16Kb of data into an HTML attribute? Well, ASP.NET uses a hidden input field to store view state in order to save a few clock cycles on the server side (and spare developers the hazzle of coding view state). </p>
<p>Typically, developers tend to forget to turn off view state resulting in a lot of data that never is used. The guy who made the decision to have this default view state behaviour has probably caused a lot of unnecessary bytes clogging your internet connection (as it typically is included in each request).</p>
<p>If you are using mechanize and/or Hpricot to parse such a site you may have come across this error:</p>
<p><samp>ran out of buffer space on element &lt;input&gt;, starting on line 38. (Hpricot::ParseError)</samp></p>
<p>If you want to try it out, load <a href='http://www.peterkrantz.com/wp-content/uploads/2007/02/viewstatesample.htm'>this sample viewstate file</a> into Hpricot. The <a href='http://code.whytheluckystiff.net/hpricot/ticket/13'>buffer space error</a> has been reported in the Hpricot issue tracker.</p>
<p>Fortunately, from version 0.5 of Hpricot it is easy to increase the buffer size before loading data. This is done by setting the buffer_size attribute to a sufficiently large number:</p>
<p>require &#8216;hpricot&#8217;<br />
Hpricot.buffer_size = 262144</p>
<h2>Fixing Mechanize</h2>
<p>As mechanize uses Hpricot as the default parser this error will happen when loading many ASP.NET pages. Fortunately, mechanize allows the user to specify a custom parser class through the <a href='http://mechanize.rubyforge.org/classes/WWW/Mechanize/PluggableParser.html'>pluggable_parser </a> attribute. To make mechanize use Hpricot with a larger buffer size:</p>
<p>require &#8216;hpricot&#8217;<br />
require &#8216;mechanize&#8217;</p>
<p>Hpricot.buffer_size = 262144<br />
agent = WWW::Mechanize.new<br />
agent.pluggable_parser.default = Hpricot<br />
agent.get(&#8216;http://www.peterkrantz.com/wp-content/uploads/2007/02/viewstatesample.htm&#8217;)</p>
<p>&#8230;and we&#8217;re back on track mechanizing the world again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2007/mechanize-on-aspnet/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using Selenium for functional testing in Ruby on Rails</title>
		<link>http://www.peterkrantz.com/2006/selenium-for-ror/</link>
		<comments>http://www.peterkrantz.com/2006/selenium-for-ror/#comments</comments>
		<pubDate>Mon, 06 Feb 2006 22:39:29 +0000</pubDate>
		<dc:creator>Pete</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.peterkrantz.com/2006/selenium-for-ror/</guid>
		<description><![CDATA[Update: There is now a nice demo of how selenium on rails works. Jonas Bengtsson has created ...]]></description>
			<content:encoded><![CDATA[<p>Update: There is now a nice <a href="http://andthennothing.net/archives/2006/02/20/show-dont-tell">demo of how selenium on rails works</a>.</p>
<p><a href="http://andthennothing.net/">Jonas Bengtsson</a> has created an <a href="http://andthennothing.net/archives/2006/02/19/new-version-of-selenium-on-rails">initial version of a Selenium plugin</a> for <acronym title="Ruby on Rails">RoR</acronym>.</p>
<p>I have been using Selenium for a while now and this certainly looks promising. There are some minor details in this release that need to be fixed such as coloring of completed test actions and test cases (mine are not highlighted). A nice addition would be if <a href="http://radrails.org">RadRails</a> supported code completion of <a href="http://www.openqa.org/selenium/seleniumReference.html">selenium actions</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.peterkrantz.com/2006/selenium-for-ror/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:32:17 -->
