<?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>Gojko Adzic &#187; UI</title>
	<atom:link href="http://gojko.net/tag/ui/feed/" rel="self" type="application/rss+xml" />
	<link>http://gojko.net</link>
	<description>Building software that matters</description>
	<lastBuildDate>Fri, 12 Mar 2010 07:59:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Putting Selenium in the right place</title>
		<link>http://gojko.net/2009/10/06/putting-selenium-in-the-right-place/</link>
		<comments>http://gojko.net/2009/10/06/putting-selenium-in-the-right-place/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 08:15:18 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[citcon]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=1253</guid>
		<description><![CDATA[Although Selenium is an essential trace element, it is toxic if taken in excess. That is what Wikipedia has to say on the chemical element Selenium, but pretty much sums up my feelings about the web testing tool of the same name as well. I like very much how easy it is to implement web [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/organic_selenium.jpg" style="width:200px" align="left" />Although Selenium is an essential trace element, it is toxic if taken in excess. That is what Wikipedia has to say on the chemical element Selenium, but pretty much sums up my feelings about the web testing tool of the same name as well. I like very much how easy it is to implement web tests with Selenium, but I&#8217;ve seen so many teams shoot themselves in the foot by misusing it and wasting a ton of time on writing and executing tests that simply got thrown away on the end. The <a href="http://code.google.com/p/webdriver/wiki/PageObjects">Page Object</a> pattern, popularised by Simon Stewart with WebDriver, seems to be the universally accepted best practice to manage UI tests efficiently and the preferred way to implement Selenium tests. However, at the recent <a href="/tag/citcon">CITCON Europe</a> conference in Paris, <a href="http://am.testingreflections.com">Antony Marcano</a> spoke against this and offered an alternative.<span id="more-1253"></span></p>
<p>One of the biggest issues with UI tests described at the task level (such as click there, type this etc) is that they <a href="http://gojko.net/2007/09/25/effective-user-interface-testing/">are very brittle and hard to understand</a>. Too many details in technical steps make it hard to see the big picture, so tests work nicely as a regression check but once something fails it is hard to figure out what exactly went wrong. They are also bound to a particular UI design, so when the design changes, lots of tests break. Selenium works on the technical task level and tests written for Selenium frequently fall into this black whole. Once the design is changed, you might as well do everything again from scratch. </p>
<p>Instead of writing tests at the technical task level, the Page Object pattern suggests creating one more level of indirection and describing business functionality of pages with objects (eg search for customers, submit registration form) and then implementing individual methods of these objects with Selenium. Tests are then written with the page object methods, which make them much more understandable and easier to maintain. Once the UI changes, we can reimplement only the relevant methods of Page Objects making the effects of changes relatively contained. Tests themselves don&#8217;t need to change. Similar ideas are implemented by <a href="http://texttest.carmen.se/index.php?page=concepts&#038;n=xusecase">xUseCase recorders</a> and Domain-Specific Testing Languages in Selenium (see <a href="http://www.solutionsiq.com/agile2008/agile-2008-domain.php">Mickey Phoenix&#8217;s Agile 2008 presentation</a>).</p>
<p>Marcano said that page objects focus on the wrong thing. Taking ideas from interaction design, he suggested that it is natural to think about functionality on three levels &mdash; goals, activities and tasks:</p>
<ol>
<li>Goal: Buy a book</li>
<li>Activities: Add the following items to the cart,&#8230;</li>
<li>Tasks: click search, type in book name, click book image, click Add to cart&#8230;</li>
</ol>
<p><br clear="all" /><br />
When thinking about web site functionality, people don&#8217;t think about pages but about activities that span multiple pages. Focusing on goal oriented cross-page activities instead of page oriented functionality makes tests more natural, easier to understand and maintain. Instead of Page Objects, Marcano suggested implementing activities with Selenium and then composing tests from activities. One more significant benefit of this approach is that activities aren&#8217;t baked into the user interface, unlike objects representing web pages, so the same test definitions can be kept for testing below the UI with different task implementations.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2009/10/06/putting-selenium-in-the-right-place/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to improve testability of web applications</title>
		<link>http://gojko.net/2009/02/03/how-to-improve-testability-of-web-applications/</link>
		<comments>http://gojko.net/2009/02/03/how-to-improve-testability-of-web-applications/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 13:33:04 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[openspacecode]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[unit testing]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=664</guid>
		<description><![CDATA[Last week I participated in the first Openspace Coding Days in London. The event was organised as a series of ad-hoc coding workshops, and I really enjoyed it.  I participated in a very interesting workshop on improving testability of web UIs, that later focused particularly on Microsoft&#8217;s new ASP.NET MVC framework. Here are a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/images/openspacecode.jpg" align="left" style="width:300px; border:1px solid black; margin:5px 5px 5px 5px" />Last week I participated in the first <a href="http://openspacecode.com/">Openspace Coding Days</a> in London. The event was organised as a series of ad-hoc coding workshops, and I really enjoyed it.  I participated in a very interesting workshop on improving testability of web UIs, that later focused particularly on Microsoft&#8217;s new ASP.NET MVC framework. Here are a couple of conclusions we came to:<span id="more-664"></span><br />
<br clear="all" /></p>
<ul>
<li>MVC approach in general helps a lot to make web UIs testable as it allows us to test lots of things below the surface of the UI efficiently, including the controller workflow, and just roll back transactions to make tests repeatable</li>
<li>Comperensive testing above the UI surface (eg through web automation tools) often doesn&#8217;t pay off as scripts take too much time to execute and maintain.</li>
<li>Automation of stuff below the surface leaves us with more time to do exploratory testing, but some basic automated tests still make sense to do through the web ui as well (eg <a href="http://gojko.net/2007/09/25/effective-user-interface-testing/">face saving tests</a>)</li>
<li>Rather than testing the formatting through the UI, a better approach is to move complex formatting away from view templates into helper classes which can be unit tested. This also reduce the stuff you need to test through the Web surface.</li>
</ul>
<h2>ASP.NET MVC specific ideas</h2>
<ul>
<li>The default (web forms) view engine allows you to put arbitrary code in the view, but view rendering cannot be easily unit tested, so this requires discipline and ensuring that view pages contain only display and formatting code. Going back to the one of already mentioned ideas, complex formatting should be moved to helper classes and not be in the view page as well.</li>
<li>ASP.NET MVC doesn&#8217;t really provide any special support for unit testing out of the box. There is no equivalent to Monorail&#8217;s test HTTP contexts. You can still mock out HTTP objects yourself. However, controller methods that don&#8217;t depend on HTTP contexts or sessions can be easily unit tested as normal classes.</li>
<li>Using helpers to generate forms makes views more resilient to change as routes are automatically generated based on class properties. So when you refactor controller method names, form targets and properties get updated automatically.</li>
<li>Similar approach in the controllers is to use the ExpressionHelper from the optional extension package Micrososft.Web.MVC, which enables us to get calculate routes with a lambda expression, generating the URL for a particular action. Using this rather than hard-coding strings makes controllers more resilient to change, as lambda expressions are strongly typed and refactoring friendly.</li>
<li>Although IView has the render method with a Writer argument, because the default WebForms view engine is using HttpContext.Current it ignores the writer and cannot be mocked out. Other view engines do make use of the TextWriter so the view output could be captured for testing purposes from a unit test.</li>
<li>The <a href="http://mvccontrib.org">MVC contrib</a> package has some more additional tools to test routes from unit test tools.</li>
</ul>
<p>We did manage to put together a very simple web application that demonstrates some of these techniques during the workshop, and you can download the source code for that from the <a href="http://code.google.com/p/openspacecode">Open space code</a> subversion repository.</p>
<p>I really enjoyed participating in the Openspace Code workshops and I&#8217;m really looking forward to the next one. Apparently, they are going to be organised every two months. Here are some links to other write-ups:</p>
<ul>
<li><a href="http://alandean.blogspot.com/2009/02/wrapping-up-first-open-space-coding-day.html">Alan Dean</a></li>
<li><a href="http://cantgrokwontgrok.blogspot.com/2009/01/open-space-coding-day-31st-jan-2009.html">Rob Cooper</a></li>
<li><a href="http://kareenascode.blogspot.com/2009/02/surface-at-open-space-code-day.html">Chris O&#8217;Dell</a></li>
<li><a href="http://blogs.conchango.com/jamiethomson/archive/2009/02/01/open-space-coding-using-the-ssds-rest-library.aspx">Jamie Thomson</a></li>
</ul>
<p>Photo by <a href="http://www.flickr.com/photos/alan-dean/sets/72157613146486709/">Alan Dean</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2009/02/03/how-to-improve-testability-of-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video from the Selenium talk</title>
		<link>http://gojko.net/2008/09/03/video-from-the-selenium-talk/</link>
		<comments>http://gojko.net/2008/09/03/video-from-the-selenium-talk/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 19:22:15 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[presentations]]></category>
		<category><![CDATA[acceptance testing]]></category>
		<category><![CDATA[cubictest]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[skills matter]]></category>
		<category><![CDATA[stiq]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=330</guid>
		<description><![CDATA[ Here is the video from the Testing Web Applications with Selenium and Selenium Remote Control talk that Milan Bogdanovic, Ivan Sanchez and I organised last week at Skills Matter. The first part of the talk introduces Selenium and some related tools that allow us to use Selenium easier. In the second part, Milan demonstrates [...]]]></description>
			<content:encoded><![CDATA[<p><embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=2555750123066853800&#038;hl=en&#038;fs=true" style="float:right; width:400px;height:326px;margin:5px 5px 5px 5px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"></embed> Here is the video from the <a href="http://skillsmatter.com/podcast/open-source-dot-net/testing-web-applications-with-selenium-selenium-remote-control" target="_blank">Testing Web Applications with Selenium and Selenium Remote Control</a> talk that Milan Bogdanovic, Ivan Sanchez and I organised last week at Skills Matter. The first part of the talk introduces Selenium and some related tools that allow us to use Selenium easier. In the second part, Milan demonstrates Selenium IDE and talks about Selenese language. In the third part, Ivan talks about Remote Control, how to make tests easier to manage and introduced the Page Object pattern. <a href="http://gojko.net/2008/08/28/links-and-slides-from-testing-web-applications-with-selenium/"> Download links and slides from the talk.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2008/09/03/video-from-the-selenium-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Links and slides from &#8220;Testing Web Applications with Selenium&#8221;</title>
		<link>http://gojko.net/2008/08/28/links-and-slides-from-testing-web-applications-with-selenium/</link>
		<comments>http://gojko.net/2008/08/28/links-and-slides-from-testing-web-applications-with-selenium/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 22:34:53 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[presentations]]></category>
		<category><![CDATA[acceptance tests]]></category>
		<category><![CDATA[cubictest]]></category>
		<category><![CDATA[fitnesse]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=317</guid>
		<description><![CDATA[Here are the links and slides from my talk today at Skills Matter on testing web applications with Selenium.
Download Powerpoint slides from here.

Selenium-core: selenium-core.openqa.org/
Selenium-Remote Control: selenium-rc.openqa.org/
Selenium-IDE: selenium-ide.openqa.org/
Selenium-Grid: selenium-grid.openqa.org/
Domain-specific testing languages presentation from Agile 2008 by Mickey Phoenix from Solutions IQ: www.solutionsiq.com/agile2008/agile-2008-domain.php
StoryTestIQ: storytestiq.solutionsiq.com
Cubic Test: www.cubictest.com
WebTest Fixtures: fitnesse.info/webtest

Ivan Sanchez will put his slides online at www.isanchez.net.
]]></description>
			<content:encoded><![CDATA[<p><img src="/images/sel.png" style="padding:10px 10px 10px 10px" align="left" />Here are the links and slides from my talk today at Skills Matter on testing web applications with Selenium.</p>
<p>Download Powerpoint slides from <a href="/resources/selenium-20080828.ppt">here</a>.</p>
<ul>
<li>Selenium-core: <a target="_blank" href="http://selenium-core.openqa.org/">selenium-core.openqa.org/</a></li>
<li>Selenium-Remote Control: <a target="_blank" href="http://selenium-rc.openqa.org/">selenium-rc.openqa.org/</a></li>
<li>Selenium-IDE: <a target="_blank" href="http://selenium-ide.openqa.org/">selenium-ide.openqa.org/</a></li>
<li>Selenium-Grid: <a target="_blank" href="http://selenium-grid.openqa.org/">selenium-grid.openqa.org/</a></li>
<li>Domain-specific testing languages presentation from Agile 2008 by Mickey Phoenix from Solutions IQ: <a target="_blank" href="http://www.solutionsiq.com/agile2008/agile-2008-domain.php">www.solutionsiq.com/agile2008/agile-2008-domain.php</a></li>
<li>StoryTestIQ: <a target="_blank" href="http://storytestiq.solutionsiq.com">storytestiq.solutionsiq.com</a></li>
<li>Cubic Test: <a href="http://www.cubictest.com">www.cubictest.com</a></li>
<li>WebTest Fixtures: <a href="http://fitnesse.info/webtest">fitnesse.info/webtest</a></li>
</ul>
<p>Ivan Sanchez will put his slides online at <a href="http://www.isanchez.net">www.isanchez.net</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2008/08/28/links-and-slides-from-testing-web-applications-with-selenium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing web applications with Selenium: next thursday @ London</title>
		<link>http://gojko.net/2008/08/21/testing-web-applications-with-selenium-next-thursday-london/</link>
		<comments>http://gojko.net/2008/08/21/testing-web-applications-with-selenium-next-thursday-london/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 19:21:39 +0000</pubDate>
		<dc:creator>gojko</dc:creator>
				<category><![CDATA[news]]></category>
		<category><![CDATA[presentations]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://gojko.net/?p=292</guid>
		<description><![CDATA[I&#8217;m doing a talk on testing web applications with Selenium next Thursday
at Skills Matter offices in London with Ivan Sanchez and Milan
Bogdanovic. We&#8217;ll cover the basics of Selenium, best practices and
pitfalls, using selenium IDE and remote control. The event is free, but
up-front registration is required so that we can plan for capacity. For
more information and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m doing a talk on testing web applications with Selenium next Thursday<br />
at Skills Matter offices in London with Ivan Sanchez and Milan<br />
Bogdanovic. We&#8217;ll cover the basics of Selenium, best practices and<br />
pitfalls, using selenium IDE and remote control. The event is free, but<br />
up-front registration is required so that we can plan for capacity. For<br />
more information and to register, <a href="http://skillsmatter.com/event/open-source-dot-net/testing-web-applications-with-selenium-selenium-remote-control">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gojko.net/2008/08/21/testing-web-applications-with-selenium-next-thursday-london/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
