<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Dubbelfnutt&#039;s blog</title>
	<atom:link href="http://dubbelfnutt.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dubbelfnutt.wordpress.com</link>
	<description>Web development and SEO</description>
	<lastBuildDate>Fri, 27 Jan 2012 11:43:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dubbelfnutt.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/51cd5ecf3bee65ca7fdce8613aab564a?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Dubbelfnutt&#039;s blog</title>
		<link>http://dubbelfnutt.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dubbelfnutt.wordpress.com/osd.xml" title="Dubbelfnutt&#039;s blog" />
	<atom:link rel='hub' href='http://dubbelfnutt.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Canonical urls</title>
		<link>http://dubbelfnutt.wordpress.com/2011/10/24/canonical-urls/</link>
		<comments>http://dubbelfnutt.wordpress.com/2011/10/24/canonical-urls/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 20:54:17 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=181</guid>
		<description><![CDATA[Every webpage on your website should have a unique url. If there are more than one url to a specific webpage, make sure you use the tag &#8220;canonical&#8221; to specify which url should be used. The canonical url is the url stored by search engines. You want all the ranking power to one specific url. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=181&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Every webpage on your website should have a unique url. If there are more than one url to a specific webpage, make sure you use the tag &#8220;canonical&#8221; to specify which url should be used. The canonical url is the url stored by search engines. You want all the ranking power to one specific url. Search engines will not penalize multiple urls to one webpage. Scraping is penalized, but it&#8217;s not really the same thing.</p>
<p><a href="http://www.mattcutts.com/blog/seo-advice-url-canonicalization/" title="Matt Cutts' blog post about canonical urls">Read more at Matt Cutts&#8217; post about canonical urls</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/181/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=181&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2011/10/24/canonical-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamic dates in Selenium IDE</title>
		<link>http://dubbelfnutt.wordpress.com/2011/02/18/dynamic-dates-in-selenium-ide/</link>
		<comments>http://dubbelfnutt.wordpress.com/2011/02/18/dynamic-dates-in-selenium-ide/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 14:18:06 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Selenium]]></category>
		<category><![CDATA[dynamic dates]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=171</guid>
		<description><![CDATA[If you have a test where you need to input a date somewhere, chances are that you want a date sometime in the future. You don&#8217;t want to update your test everytime so you want the date to be dynamic. This can be achieved using javascript. In the following example, I use three selenese commands [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=171&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you have a test where you need to input a date somewhere, chances are that you want a date sometime in the future. You don&#8217;t want to update your test everytime so you want the date to be dynamic. This can be achieved using javascript. In the following example, I use three selenese commands to do this. You can use just one command, but I want to make it simple to understand.</p>
<p>1) Stores a variable with the number of months into the future that I want my date to be. In this case 4 months. If I put this in a separate variable it will be much easier to change at a later time, rather than searching and replacing in the javascript below.</p>
<p><strong>Command: <em>store</em><br />
Target: <em>4</em><br />
Value: <em>monthsToAdd</em></strong></p>
<p>2) Formats and stores the date we want to use. Format in this example is Swedish, like so: &#8220;<em>2011-02-18</em>&#8220;.</p>
<p><strong>Command: <em>store</em><br />
Target: <em>javascript{var dates = new Date();var day = dates.getDate();if (day &#060; 10){day = &#8217;0&#8242; + day;} month = dates.getMonth() + 1 + parseInt(storedVars['monthsToAdd']);var year = dates.getFullYear();if (month &#062; 12){month = month &#8211; 12;year = year + 1;}if (month &#060; 10){month = &#8217;0&#8242; + month;}year + &#8216;-&#8217; + month + &#8216;-&#8217; + day}</em><br />
Value: <em>dynamicDate</em></strong></p>
<p>3) Types our dynamic date into a textbox, whos id contains &#8220;dateInputBox&#8221;.</p>
<p><strong>Command: <em>type</em><br />
Target: <em>//input[contains(@id, 'dateInputBox')]</em><br />
Value: <em>${dynamicDate}</em></strong></p>
<p>You can <a href="http://www.theautomatedtester.co.uk/tutorials/selenium/Selenium_JavaScript.htm">read more about javascripts and Selenium here</a>. If you feel that I am wrong or you have something to add, please comment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/171/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=171&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2011/02/18/dynamic-dates-in-selenium-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>Microsoft Coded UI vs Selenium</title>
		<link>http://dubbelfnutt.wordpress.com/2010/12/08/microsoft-coded-ui-vs-selenium/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/12/08/microsoft-coded-ui-vs-selenium/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 21:45:24 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[automated tests]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[CUI]]></category>
		<category><![CDATA[gui tests]]></category>
		<category><![CDATA[Microsoft Coded UI]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[versus]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=146</guid>
		<description><![CDATA[I have used both Microsofts Coded UI and Selenium, although I don&#8217;t claim to be an expert at anyone of them, and these are my thoughts about them. Why do we want to use automated GUI tests to begin with? They are faster than manual tests. They do exactly the same thing every time. They [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=146&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>I have used both <a href="http://msdn.microsoft.com/en-us/library/dd286726.aspx">Microsofts Coded UI</a> and <a href="http://seleniumhq.org/">Selenium</a>, although I don&#8217;t claim to be an expert at anyone of them, and these are my thoughts about them.</em></p>
<p>Why do we want to use automated <a href="http://en.wikipedia.org/wiki/GUI_software_testing">GUI tests</a> to begin with?</p>
<ul>
<li>They are faster than manual tests.</li>
<li>They do exactly the same thing every time.</li>
<li>They can be executed automatically after nightly builds which provides quicker feedback to developers.</li>
<li>They are perfect for regression testing.</li>
</ul>
<p><strong>Microsoft Coded UI</strong><br />
<a href="http://emea.microsoftstore.com/europe/en-US/Microsoft/Visual-Studio-Professional-2010-Full-(English)">Visual Studio 2010</a> Ultimate and Premium comes with support for Coded UI (CUI). What they have that the other version lack is the <a href="http://msdn.microsoft.com/en-us/library/dd286671.aspx">Test Builder</a>, which is needed to record tests or create GUI mappings. Also included is the <a href="http://www.slideshare.net/MitchDenny/microsoft-test-manager">Test Manager</a> (also called Camano or Testing Center) which seems to be aimed at testers and test managers rather than developers.</p>
<p>What I <strong>like</strong> about Microsoft Coded UI:</p>
<ul>
<li>Test Manager. For managing test cases and creating automated tests from recorded UI tests. You can also start  Test Builder from Test Manager to record a new test.</li>
<li>You can link recorded tests to work items in Team Foundation Server (TFS).</li>
<li>Test Builder uses as many attributes as possible to identify UI controls, which makes the tests less vunerable to changes of the UI control attributes. If you for instance change the CSS class of a UI control, the test will still find the control based on other search criteria.</li>
<li>UI Maps. With detailed UI Maps you can code UI tests without even opening the browser. Working with <a href="http://msdn.microsoft.com/en-us/library/ff398056.aspx">enterprise webapplications, using UI Maps</a> to divide the website in logical units is a must.</li>
<li>Handles both web-, Windows and Silverlight applications. You could also run two separate browsers in the same test to see that they don&#8217;t affect eachother.</li>
<li>Is not depending on javascript.</li>
</ul>
<p>What I <strong>don&#8217;t like</strong> about Microsoft Coded UI:</p>
<ul>
<li>Test Manager. It feels like a beta version, very buggy and unstable (often I can&#8217;t even close it). I am also having some trouble understanding how to work with the Test Manager, but maybe that&#8217;s just me. It doesn&#8217;t look or feel like any other program I have ever used. I guess you need some sort of training to use it properly. Rumour has it that Test Manager will be an incorporated part of the next Visual Studio version.</li>
<li>The Ultimate and Premium versions of Visual Studio are not for free, starting at $799.</li>
<li>Only supports Internet Explorer. There is a buggy beta release of Coded UI that is supposed to support Firefox, but I exclude that.</li>
<li>You need to set the ClientIDMode of all your UI controls to not use AutoID.</li>
<li>No Mac support whatsoever.</li>
</ul>
<p><strong>Selenium</strong><br />
The Selenium IDE plugin for Firefox allows for recording and playback of tests. You can export recorded tests to various programming languages. In C# they are exported as NUnit tests.</p>
<p>Selenium RC (Remote Control) is a stand alone application that can be used to run tests. Selenium RC starts an instance of Firefox (or other browser) and runs the tests provided. Requires Java.</p>
<p>Selenium Grid is used to distribute a large amount of tests to different Selenium RC (that can be on separate computers, running separate browsers). This effectively cuts the time needed to run all the tests. Requires JDK and Ant.</p>
<p>What I <strong>like</strong> about Selenium:</p>
<ul>
<li>It&#8217;s free!</li>
<li>There is a very low threshold to get started and you can gradually make your work with the Selenium applications as complex as you want. I use Selenium IDE for every day work when I need to do mundane tasks repeatedly. You don&#8217;t have to be a system developer to start using Selenium.</li>
<li>Tests and test suites are saved as HTML files and you can therefor edit them with any editing tool, like Notepad. Also, imagine a scenario where you generate the tests based on templates using Perl or PowerShell scripting and thereby controlling parameters in the tests without having to write code and compile.</li>
<li>The possibility to export tests to different programming languages.</li>
<li>Expandable. Selenium uses javascript to record and run the tests and you can <a href="http://seleniumhq.org/docs/08_user_extensions.html">write your own user-extensions</a>. For instance, you may want to add an assert or change the how the C# code is generated (so that it&#8217;s not NUnit tests but Microsoft Unit tests).</li>
<li>Selenium RC allows running Selenium tests in all common browsers (Firefox, Internet Explorer, Opera, Safari, Chrome etc).</li>
<li>Using Selenium RC and Grid, you can distribute tests on multiple platforms, cutting execution time and adding <a href="http://selenium-grid.seleniumhq.org/step_by_step_installation_instructions_for_osx.html">Mac support</a>.</li>
</ul>
<p>What I <strong>don&#8217;t like</strong> about Selenium:</p>
<ul>
<li>Only for web. You can&#8217;t test Windows applications.</li>
<li>Requires javascript. Recording and playback of tests require that javscript is available in the web browser.</li>
<li>Selenium IDE is only available as plugin to Firefox. You have to use Selenium RC to test in Internet Explorer.</li>
<li>Only records a flow of action as a test. It is twisty to add for instance a login action in the middle of a test, especially if you have exported the test to code.</li>
</ul>
<p><a href="http://dubbelfnutt.files.wordpress.com/2010/12/codedui_vs_selenium.png"><img class="aligncenter size-full wp-image-153" title="codedui_vs_selenium" src="http://dubbelfnutt.files.wordpress.com/2010/12/codedui_vs_selenium.png" alt="Microsoft Coded UI vs Selenium, IK+ style." width="505" height="369" /></a></p>
<p><strong>Conclusion</strong><br />
If you want to test a Windows application, Coded UI is your choice. I think the UI Maps with support for a logical structure is great, but is mainly for large companies, with dedicated test developers.</p>
<p>Selenium is free and easy to use. If you haven&#8217;t tried it yet, start right away by <a href="https://addons.mozilla.org/de/firefox/addon/2079/">downloading Selenium IDE for Firefox</a> and play with it a bit. I mainly work with web application development so Selenium is my first hand choice. At the moment&#8230;</p>
<p><em>If you have something to add or you feel that I am wrong about any of this, please comment.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/146/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/146/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/146/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=146&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/12/08/microsoft-coded-ui-vs-selenium/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>

		<media:content url="http://dubbelfnutt.files.wordpress.com/2010/12/codedui_vs_selenium.png" medium="image">
			<media:title type="html">codedui_vs_selenium</media:title>
		</media:content>
	</item>
		<item>
		<title>Identifying controls and values in Selenium IDE</title>
		<link>http://dubbelfnutt.wordpress.com/2010/08/02/identifying-controls-and-values-in-selenium-ide/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/08/02/identifying-controls-and-values-in-selenium-ide/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 09:09:58 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[webapplication]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=136</guid>
		<description><![CDATA[Some tips for identifying controls and dropdown values in Selenium IDE when testing a .NET web application.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=136&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When recording a Selenium test with Selenium IDE, I <a href="https://addons.mozilla.org/sv-SE/firefox/addon/2079/">use it with Firefox</a>, a command for clicking a specific button might look something like this:</p>
<p><code>Command: click<br />
Target: ctl00_ctl00_ctl00_MainPlaceHolder_MainContentPlaceHolder_Main_c7c270_btnNavigateNext<br />
Value:</code></p>
<p>The problem with this is that the id recorded by Selenium IDE is <a href="http://www.asp.net/master-pages/tutorials/control-id-naming-in-content-pages-vb">automatically generated by .NET at runtime</a>, and therefor it could change at anytime without your control (sort of, but let&#8217;s not get into that right now). The id I specified at designtime was of course &#8220;btnNavigateNext&#8221; and the long prefix is added by .NET to make sure no two controls in the same page end up having the same id. What we really want to do here is click a button that I have named &#8220;btnNavigateNext&#8221;, and as long I don&#8217;t give any other control in the same page the same name, here&#8217;s how you could change the Selenium command:</p>
<p><code>Command: click<br />
Target: //input[contains(@id, 'btnNavigateNext')]<br />
Value:</code></p>
<p>The target is now specified by an <a href="http://www.w3schools.com/xpath/default.asp">Xpath</a>, which you can tell by the initial two slashes. First we specify what type of control to look for, in this case an input control, and then how to identify it. I used the contains function in Xpath to specify that the id attribute (marked with the at sign) should contain &#8220;btnNavigateNext&#8221;. Try the Locate button next to the Target input in Selenium IDE &#8211; your button should get a green frame in the browser window if correct. Otherwise you get an error in the log.</p>
<p>When recording a selection in a dropdown control you get something like this in Selenium IDE:</p>
<p><code>Command: select<br />
Target: ctl00_ctl00_ctl00_MainPlaceHolder_MainContentPlaceHolder_Main_c7c30_lvItems_ctrl0_ddlColor<br />
Value: label=Pale blue</code></p>
<p>Here, we experience the same problem with the id as with the example above &#8211; we need to change the logic for identifying the control. The second problem with this is that the values in my dropdown are dynamic, and I can&#8217;t be sure that &#8220;Pale blue&#8221; is an option when I want to run this test later. Therefor, I will have to change the identifying logic for the value as well. No need to do this if your dropdown values are static. Here&#8217;s what I changed my command to:</p>
<p><code>Command: select<br />
Target: //select[contains(@id, 'lvItems_ctrl0_ddlColor')]<br />
Value: index=1</code></p>
<p>Now the test will pick the first color in my dropdown list. The downside of this is of course that I can&#8217;t tell what color will be chosen so if some later part of this test is counting on a specific color this approach won&#8217;t do.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=136&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/08/02/identifying-controls-and-values-in-selenium-ide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>Firefox localhost slow debug fix</title>
		<link>http://dubbelfnutt.wordpress.com/2010/07/29/firefox-localhost-slow-debug-fix/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/07/29/firefox-localhost-slow-debug-fix/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 12:57:21 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=132</guid>
		<description><![CDATA[Fix for slow Firefox localhost problem.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=132&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Firefox has a bug with IPv6 that makes it run really slow when using localhost as domain name. There are some easy solutions for this:</p>
<ul>
<li><a href="http://kb.mozillazine.org/Network.dns.disableIPv6">Change the IPv6 setting.</a></li>
<li>Simply change localhost to 127.0.0.1 or your local computer name.</li>
</ul>
<p>This effectively cut response times for me while debugging from 25-30 s to 3-4 s. A MAJOR difference. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/132/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/132/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/132/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=132&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/07/29/firefox-localhost-slow-debug-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>Selenium RC and .NET C#, how to get started</title>
		<link>http://dubbelfnutt.wordpress.com/2010/07/26/selenium-rc-and-net-c-how-to-get-started/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/07/26/selenium-rc-and-net-c-how-to-get-started/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 11:20:41 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[automated tests]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Coded UI]]></category>
		<category><![CDATA[gui tests]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[Selenium RC]]></category>
		<category><![CDATA[unit tests]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=127</guid>
		<description><![CDATA[How to get started with Selenium RC and C# .NET in Visual Studio.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=127&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://seleniumhq.org/">Selenium</a> is a powerful, free tool for automated testing. <a href="http://seleniumhq.org/projects/ide/">Selenium IDE</a> can be used with Mozilla Firefox, or another browser of your choice, to easily create and run tests. <a href="http://seleniumhq.org/projects/remote-control/">Selenium RC</a> allows for more advanced testing by enabling the possibility of using your own code, in a language of your choice, to handle the tests. Both Selenium IDE and Selenium RC use <a href="http://seleniumhq.org/projects/core/">Selenium Core</a>, but they are included and you don’t have to download them separately.</p>
<p>In this post, I will try to explain how I setup automated testing with Selenium RC and some custom C# code in <a href="http://www.microsoft.com/visualstudio/en-gb/download">Visual Studio 2010</a>. I will assume you are somewhat familiar with Visual Studio and C#.</p>
<p>First off, <a href="http://seleniumhq.org/download/">download the Selenium RC</a> and unpack the zip-file to a folder of your choice. Selenium RC contains two folders that are of interest to us, the selenium-dotnet-client-driver-1.0.1 and selenium-server-1.0.3 folders.  Since Selenium RC requires Java to run, <a href="http://www.java.com/en/download/installed.jsp">make sure you have Java installed</a>. Start Selenium RC with the following command (I created a desktop shortcut that looks like this):</p>
<p>&#8220;C:\Program Files (x86)\Java\jre6\bin\java.exe&#8221; -jar C:\Selenium\selenium-remote-control-1.0.3\selenium-server-1.0.3\selenium-server.jar</p>
<p>With that taken care of, I generated the code for the automated tests using Selenium IDE with Firefox. After recording a simple test, save it as a cs-file:</p>
<p>Archive -&gt; Export test case as… -&gt; C# &#8211; Selenium RC</p>
<p>If you open the test case cs-file you will notice that the code generated is actually a NUnit test class. There are NUnit attributes like TextFixture, SetUp, TearDown and Test. If you use NUnit, you can now run this test with NUnit.</p>
<p>If not, and you want to use Visual Studios built in unit test support, create a new Visual C# Test project in Visual Studio and include your Selenium cs-file. You have to change the class in the following way:</p>
<p>•	TextFixture -&gt; TestClass<br />
•	SetUp -&gt; ClassInitialize<br />
•	TearDown -&gt; ClassCleanup<br />
•	Test -&gt; TestMethod</p>
<p>You might also want to change namespace of the class to match you project name. Add a reference to ThoughtWorks.Selenium.Core.dll that is located in the selenium-dotnet-client-driver-1.0.1 folder. Provided that the Selenium RC server is still running, you should now be able to run your coded automated test by right-clicking the file in Visual Studio and choose Run Unit Tests.</p>
<p>You can now start to manipulate the automated tests by adding your own code. This setup is very powerful if you want to add automated tests to your build server. There is, however, no problem creating for example a console application to run the tests instead of running them as unit tests. Just make sure you do the setup, testing and teardown in correct order.</p>
<p>Coded automated test with Selenium RC is an alternative to using the new <a href="http://msdn.microsoft.com/en-us/library/dd286681.aspx">Coded UI</a> feature in Visual Studio.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=127&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/07/26/selenium-rc-and-net-c-how-to-get-started/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>How to commit website suicide from an SEO point of view</title>
		<link>http://dubbelfnutt.wordpress.com/2010/07/08/how-to-commit-website-suicide-from-an-seo-point-of-view/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/07/08/how-to-commit-website-suicide-from-an-seo-point-of-view/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 10:50:57 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[www.mil.se]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=121</guid>
		<description><![CDATA[How the Swedish military committed website suicide from an SEO point of view and what I would have done to avoid it.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=121&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago, the Swedish military (Försvarsmakten) decided that their website needed a facelift. After taking a long, hard look at the old one, they decided that they would start from scratch with the new one. And I really mean from scratch. What they ended up doing was, in my opinion, a website SEO-suicide. These are some of the mistakes they made, and what I feel they should have done instead.</p>
<ol>
<li>Relaunching an existing website on a completely new domain.
<p>Why change the main domain of your website, if your company hasn’t changed name? Don’t! An important factor in SEO is how old your website is and how trusted it is. This is of course based on the domain name.</p>
<p><a href="http://www.highrankings.com/faq-domain-change">Read more about changing domain name.</a>
</li>
<li>Changing the URL-structure of your website.
<p>This will effectively break all incoming links, and memorized addresses that people use will not work. At least if you don’t redirect all requests to the old structure to the new structure.</p>
<p><a href="http://www.seo.com/blog/on-page-optimization/checklist-changing-url-structure/">Read more about changing the URL structure of your website.</a>
</li>
<li>Not bothering with redirects from the old website structure to the new one.
<p>For me, this is just unimaginable. How could you not do this? They had top search engine listings on thousands of topics. When searching for something even remotely related to the Swedish military, you always found their website among the top search results. Just after their relaunch, the top results when googling “Swedish military” pointed to various forums, www.soldf.com among others. Soldf.com is a Swedish forum for military nerds, where they can compete in fantasy facts about how far bullets can travel. Not the best promotion for the real Swedish military. Their website was nowhere to be found for quite a while.</p>
<p>What they should have done is of course set up 301-redirects for all old URLs to corresponding pages in the new website. <a href="http://www.searchengineoptimizationjournal.com/2010/07/07/seo-301-redirect/">Read more about 301-redirects</a>.</p>
<p>The only redirects used seemed to be from the general start page and the start pages in some subcategories of the old website to the general start page of the new website. Not enough!
</li>
<li>Removing all content.
<p>That’s right. Why not? You’re changing the entire structure and layout of the website anyway. Thousands of pages with articles and facts about the Swedish military, right down the drain.</p>
<p>Removing all content effectively removes the option to have redirects from old to new website structure even if you wanted to.
</li>
</ol>
<p>The conclusion is that the Swedish military simply removed their entire website, a highly trusted, old website containing a high amount of reliable content, and started a new, completely separate website.</p>
<p>As a developer with high interest in SEO-related topics, I sincerely hope they had really good reasons to treat their website, virtual visitors, coworkers and all the search engines this way, IF they actually knew the consequences of their actions.</p>
<p>By the way, I think the <a href="http://www.mil.se">Swedish military’s new website</a> looks much better than the old one.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=121&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/07/08/how-to-commit-website-suicide-from-an-seo-point-of-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>IIS log in ASP.NET Development Server</title>
		<link>http://dubbelfnutt.wordpress.com/2010/04/06/iis-log-in-asp-net-development-server/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/04/06/iis-log-in-asp-net-development-server/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 09:43:36 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[Application_BeginRequest]]></category>
		<category><![CDATA[ASP.NET Development Server]]></category>
		<category><![CDATA[Cassini]]></category>
		<category><![CDATA[Global.asax]]></category>
		<category><![CDATA[IIS log]]></category>
		<category><![CDATA[System.Diagnostics.Debug]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=108</guid>
		<description><![CDATA[I explain how to simulate a IIS log in VS WebDev Server (Cassini) by using System.Diagnostics.Debug output in Application_BeginRequest in Global.asax.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=108&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my earlier post <a href="http://dubbelfnutt.wordpress.com/2010/04/01/click-tracking-with-ajax-javascript-externaloutbound-links/">Click tracking with AJAX, Javascript – external/outbound links</a> I explained how to make a log request to the web server when clicking a link. I use Visual Studio (VS) for web development, but the web development server in VS (also called VS WebDev Server or Cassini) doesn&#8217;t support logging in the same manner as the regular IIS web server.</p>
<p>For testing purposes, I solved this by adding some code to the <a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplication.beginrequest(VS.71).aspx">Application_BeginRequest</a> method in <a href="http://aspalliance.com/1114_Understanding_the_Globalasax_file.all">Global.asax</a>. I was only interested in seeing if the request for my static log.htm file was actually received. This piece of code simply writes some info to the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debug.aspx">System.Diagnostics.Debug</a> output when log.htm is requested.</p>
<blockquote><p>
protected void Application_BeginRequest(object sender, EventArgs e) {<br />
if(Request.Path != &quot;/log.htm&quot;) return; </p>
<p>string link = Request.QueryString[&quot;url&quot;];<br />
string timestamp = Request.QueryString[&quot;timestamp&quot;];<br />
string referer = Request.QueryString[&quot;referer&quot;];<br />
System.Diagnostics.Debug.WriteLine(&quot;Request received: &quot; + link + &quot; &quot; + referer + &quot; &quot; + timestamp);<br />
}
</p></blockquote>
<p>Now when I debug <a href="http://dubbelfnutt.wordpress.com/2010/04/01/click-tracking-with-ajax-javascript-externaloutbound-links/">my earlier example</a> with Visual Studio I get a row in the Output window looking like this:</p>
<p>Request recieved: http://www.netlight.se http://localhost:60877/ExternalLinks.htm 1270545819906</p>
<p>If you want to log to a file, exactly like IIS does, that should be no problem. Just change the output code to write to a file instead.</p>
<p>Let me know if you have something useful to add or you feel that I am wrong in any way.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=108&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/04/06/iis-log-in-asp-net-development-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>Click tracking with AJAX, Javascript &#8211; external/outbound links</title>
		<link>http://dubbelfnutt.wordpress.com/2010/04/01/click-tracking-with-ajax-javascript-externaloutbound-links/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/04/01/click-tracking-with-ajax-javascript-externaloutbound-links/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 11:47:13 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[click tracking]]></category>
		<category><![CDATA[external links]]></category>
		<category><![CDATA[Mootools]]></category>
		<category><![CDATA[outbound links]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=86</guid>
		<description><![CDATA[How to track clicks on links with AJAX, Javascript and a Javascript framework (Mootools). Example adds onclick event to outbound links marked rel="external" and logs when users click.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=86&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want to log when the user clicks an outbound link, just like Google does. Here&#8217;s a solution to do this. It adds onclick events to outbound links marked rel=&#8221;external&#8221; and makes a log request when users click the link.</p>
<blockquote><p>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Tracking clicks on outbound links&lt;/title&gt;<br />
&lt;script type=&quot;text/javascript&quot; src=&quot;mootools-1.2.4-core-nc.js&quot;&gt;&lt;/script&gt;<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
/*<br />
Change to suitable way of finding all external links.<br />
$$ can be timeconsuming.<br />
*/<br />
function AddLogFunctionality() {<br />
var links = $$(&#8216;a[rel=external]&#8216;),<br />
referer = document.location;<br />
for (var i = 0, l = links.length; i &lt; l; i++) {<br />
var link = links[i];<br />
link.addEvent(&#8216;click&#8217;, function(e) {<br />
e.stop();<br />
TrackClick(this, e, referer);<br />
});<br />
}<br />
} </p>
<p>/*<br />
This should point to your log page where you handle the information.<br />
The log page should return an empty HTML page (HTTP status = 200).<br />
*/<br />
var _logUrl = &quot;/Log.aspx?&quot;,<br />
_timestampParam = &quot;&amp;timestamp=&quot;,<br />
_urlParam = &quot;&amp;url=&quot;,<br />
_refererParam = &quot;&amp;referer=&quot;; </p>
<p>function TrackClick(link, event, referer) {<br />
var linkurl = link.href;<br />
/*<br />
Here&#8217;s where Mootools comes in handy, making the AJAX request.<br />
onSuccess triggers when response (HTTP status = 200) is received.<br />
*/<br />
var htmlRequest = new Request.HTML({<br />
url: _logUrl + _urlParam + linkurl + _refererParam + referer + _timestampParam + (new Date()).getTime(),<br />
onSuccess: function() {<br />
window.location = linkurl;<br />
}<br />
}).get(); } &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body onload=&quot;AddLogFunctionality()&quot;&gt;<br />
Here&#8217;s an outbound link: &lt;a href=&quot;http://www.netlight.se&quot; rel=&quot;external&quot;&gt;Netlight Consulting AB&lt;/a&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt; </p></blockquote>
<p>I used <a href="http://mootools.net">Mootools</a>, but you can also use <a href="http://jquery.com/">jQuery</a> just as well.</p>
<p>I tried this approach first:</p>
<blockquote><p>
&lt;a href=&quot;somepage.htm&quot; onclick=&quot;(new Image()).src = &#8216;log.aspx?url=somepage.htm&amp;timestamp=&#8217; + (new Date()).getTime()&quot;&gt;Some page&lt;/a&gt;
</p></blockquote>
<p>But this doesn&#8217;t work because the request to the log page is cut short when the request to somepage.htm starts and the server never receives any log request.</p>
<p>Google has a whole <a href="http://code.google.com/intl/sv-SE/apis/analytics/docs/">API for tracking</a> that provides data through <a href="http://www.google.com/analytics/">Google Analytics</a>, if you use that. I haven&#8217;t tried this yet, but to use it for tracking clicks on outbound links seems pretty easy.</p>
<p>Excuse the bad format of the code above. WordPress and I are not the best of friends&#8230; yet. Also, let me know if you feel this post is wrong in any way or you have something useful to add.</p>
<p><strong>EDIT:</strong><br />
There&#8217;s a bug in Mootools that appears if you do window.open() in onSuccess event on Request.HTML in Google Chrome. You will get a &#8220;ghost&#8221; frame in Chrome that you can&#8217;t see. I discovered it because the page I opened with window.open had a video clip on it that played some music.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=86&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/04/01/click-tracking-with-ajax-javascript-externaloutbound-links/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
		<item>
		<title>SEO &#8211; keywords placement</title>
		<link>http://dubbelfnutt.wordpress.com/2010/03/18/seo-keywords-placement/</link>
		<comments>http://dubbelfnutt.wordpress.com/2010/03/18/seo-keywords-placement/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 13:09:10 +0000</pubDate>
		<dc:creator>dubbelfnutt</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[keywords]]></category>
		<category><![CDATA[placement]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://dubbelfnutt.wordpress.com/?p=78</guid>
		<description><![CDATA[Where to place keywords on your website, from an SEO point of view.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=78&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a short checklist off the top of my head about where to place the keywords on your website. I won&#8217;t go into details about how to choose keywords here, maybe in a later post.</p>
<ol>
<li>URL. The further to the left, the better. Domain and subdomain names should really be something you wish your website to be associated with. Also, be careful if you are thinking about changing the URL structure of your website if it is old and trusted. You could render large portions of the search engines indexes that already points to your website useless.</li>
<li>Title attribute. The further to the left, the better. The title should reflect what the page is about, otherwise you might get penalized.</li>
<li>Headers. The H1 tag is most valuable, then H2, H3 and so on. H1 must only exist once on each page, otherwise you might get penalized.</li>
<li>Links (anchors). Make sure the links to each page reflects what the page is about. Always set the alt attribute. This apply to both inbound and outbound links.</li>
<li>Metadata. Don&#8217;t spam metadata with keywords, but define what the page is about.</li>
<li>Bread text. The earlier in the page and the more frequent (to a certain degree) the better. Don&#8217;t spam the text with keywords.</li>
<li>Images. The alt attribute.</li>
</ol>
<p>Let me know if you feel that I am wrong or you have something you want to add.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dubbelfnutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dubbelfnutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dubbelfnutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dubbelfnutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dubbelfnutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dubbelfnutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dubbelfnutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dubbelfnutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dubbelfnutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dubbelfnutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dubbelfnutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dubbelfnutt.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dubbelfnutt.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dubbelfnutt.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dubbelfnutt.wordpress.com&amp;blog=7112070&amp;post=78&amp;subd=dubbelfnutt&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dubbelfnutt.wordpress.com/2010/03/18/seo-keywords-placement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b0b972c415ad8c21b86a1c2310e4e0a4?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dubbelfnutt</media:title>
		</media:content>
	</item>
	</channel>
</rss>
