<?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>Test Automation Blog &#187; UI test automation</title>
	<atom:link href="http://testautomationblog.com/tag/ui-test-automation/feed/" rel="self" type="application/rss+xml" />
	<link>http://testautomationblog.com</link>
	<description>On software test automation and quality assurance</description>
	<lastBuildDate>Sun, 16 May 2010 09:33:02 +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>Five Reasons Why I Like Selenium</title>
		<link>http://testautomationblog.com/2009/12/25/five-reasons-i-like-selenium/</link>
		<comments>http://testautomationblog.com/2009/12/25/five-reasons-i-like-selenium/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 16:29:02 +0000</pubDate>
		<dc:creator>TAB</dc:creator>
				<category><![CDATA[Test Tool Reviews]]></category>
		<category><![CDATA[Rational Functional Tester]]></category>
		<category><![CDATA[Selenium]]></category>
		<category><![CDATA[test tools]]></category>
		<category><![CDATA[UI test automation]]></category>
		<category><![CDATA[web automation]]></category>

		<guid isPermaLink="false">http://testautomationblog.com/?p=167</guid>
		<description><![CDATA[

Several months ago I started working on a new test automation project for a web site and one of the first things to do was to evaluate and choose a tool for the task. The two main contenders were Selenium and IBM Rational Functional Tester. I chose Selenium and since then never got to regret [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } --></p>
<p style="margin-bottom: 0in; text-align: center;"><img class="aligncenter size-full wp-image-168" title="Image (c) George Rex" src="http://testautomationblog.com/wp-content/uploads/2009/12/selenium-cam.jpg" alt="" width="320" height="213" /></p>
<p style="margin-bottom: 0in;">Several months ago I started working on a new test automation project for a web site and one of the first things to do was to evaluate and choose a tool for the task. The two main contenders were <a href="http://seleniumhq.org/" target="_blank">Selenium</a> and <a href="http://www-01.ibm.com/software/awdtools/tester/functional/" target="_blank">IBM Rational Functional Tester</a>. I chose Selenium and since then never got to regret this choice. Here are some of the main reasons I lke this opensource tool much better than the expensive commerial alternatives for web automation:</p>
<h5 style="margin-bottom: 0in;">Selenium acknowledges the fact that to create useful tests you will have to code them</h5>
<p style="margin-bottom: 0in;">Yes, it gives you a tool that can record sequences of user interactions, but as a whole Selenium is not built with the assumption that this will be the main approach you will use to create your tests. The <a href="http://seleniumhq.org/projects/ide/" target="_blank">recording tool</a> (which is a very easy to install Firefox plugin) is useful as a learning aid and maybe for very simple tests. But what I like most about it is that it can covert your recorded sequence to code in any of the supported scripting languages.   And this brings me to the second point:</p>
<h5 style="margin-bottom: 0in;">You get to choose the scripting language</h5>
<p style="margin-bottom: 0in;">Most commercial automation tools force you to use some Visual Basic dialect  as a scripting language. If you are lucky you get something relatively functional like VBA (with TestPartner) or even VB.NET (with Rational Functional Tester). Otherwise you might be forced to code your tests in VBScript, which is really, really painful (the main reason why I don't like QuickTest Professional). Rational Functional Tester also lets you use Java, which makes it my favorite among the commercial tools.</p>
<p style="margin-bottom: 0in;">Selenium is language-agnostic. You can use almost any programming language you want. C# and Java are popular  and PHP is also an option if you are automating a PHP web app and want to stick to the same language for testing.  <a href="http://mislav.uniqpath.com/poignant-guide/" target="_blank">Ruby</a> is a great language that makes coding fun and the Selenium library for Ruby provides some domain-specific idioms for testing, similar to what Rails does for web development. If you are a Perl, Python or Groovy fan you can use them too. As an additional bonus you will be able to use any development environment you are comfortable with to write your scripts – be it Eclipse, Microsoft Visual Studio or even Vi or Emacs if you want to.</p>
<h5 style="margin-bottom: 0in;">Selenium has a powerful approach for locating UI objects</h5>
<p style="margin-bottom: 0in;">Most automation tools are surprisingly limited in the way they identify the UI objects to interact with. They let you locate a control by some unique property (like id) or by a collection of properties which together identify it uniquely on the web page. In my experience this approach is sufficient in only about half of the real-world cases.</p>
<p style="margin-bottom: 0in;">Imagine a web page containing 3 identical OK buttons. The buttons are exactly the same and have no id's  or anything in their properties to distinguish them. Lets say that the first button is located in a form with id 'signup', the second is inside 'order' and the third is inside 'invoice'.  Most automation tools do not let you easily identify a UI object in relation to other objects in the page, i.e. you can not say <em>I want to click the button with caption 'OK', which is located inside the 'signup' form</em>. Normally the most you get is <em>I want to click the second button with caption 'OK' on the page. </em><span style="font-style: normal;">This will work, but only until you get a new version of your application with added additional OK button above the one you are interested in. The XPath expressions in Selenium can locate objects in the DOM document hierarchy (“//form[@id='signup']//input[@type='button' and @value='OK']”) and are very powerful – for instance you can specify that you want to click the checkbox, which is located inside a table row next to a cell with some specific text in it.</span></p>
<h5 style="margin-bottom: 0in;">Your tests will run on any browser without changes (well, almost)</h5>
<p style="margin-bottom: 0in;">While you should not expect that automated tests will catch most browser-dependent bugs (like broken layout), the option to run your  tests on all browsers that you support is definitely useful. As with programming languages, Selenium offers you a wide choice of browers to run your tests on – not only specific versions of IE and maybe Firefox (the choice you are likely to get from commercial test automation tools), but also Safari, Chrome and Opera. What is more important – about 95% of your tests will run without any changes on all supported browsers. I don't know other automation tool that does this.</p>
<h5 style="margin-bottom: 0in;">It is surprisingly stable and robust for a 1.0 version</h5>
<p style="margin-bottom: 0in;">My experience with test automation is that if you want to run lots of long tests, you have to expect that something will go wrong at some point – random crashes are not that uncommon in this business. Selenium is at least as stable as anything else I have tried and we routinely run hour-long tests without any problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://testautomationblog.com/2009/12/25/five-reasons-i-like-selenium/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Record/Playback Does Not Work&#8230;</title>
		<link>http://testautomationblog.com/2009/03/16/record-playback-does-not-work/</link>
		<comments>http://testautomationblog.com/2009/03/16/record-playback-does-not-work/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 21:59:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[automation problems]]></category>
		<category><![CDATA[automation tools]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[record and playback]]></category>
		<category><![CDATA[UI test automation]]></category>

		<guid isPermaLink="false">http://testautomationblog.com/?p=3</guid>
		<description><![CDATA[If you do not have any hands-on experience with test automation, you might miss a very important fact about the whole thing - it is not only about creating the  scripts. If you plan to do any serious automation, do not base the choice of your tool on how well it handles recording and playback. In my opinion writing test scripts using the scripting language (and doing it right) is the only way to make UI automation really work. ]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><em>Record/Playback does not work, but we all know this, don't we?</em></p>
<p><em><br />
</em></p>
<p><em><img class="aligncenter size-full wp-image-10" title="877158_old_tape" src="http://testautomationblog.com/wp-content/uploads/2009/03/877158_old_tape.jpg" alt="877158_old_tape" width="300" height="199" /></em></p>
<p>If you have ever had anything to do with UI test automation, you should know about recording.  It is an ability that most tools (commercial or open source) have - you start the recording session in the tool and then just happily click through the test scenario on the application you are testing.  Meanwhile the tool sits silently and records your actions, getting ready to replay them automatically when you want to. The ability to record the UI interactions is a marketing highlight for most automation tools. There are even some tools, where recording is the only way you can create test scripts.</p>
<p>On the surface it can really look like the best way to automate - you will be testing manually anyway,  so why don't just record your tests to replay them at a later stage? Unfortunately the view that test automation is something as simple as pressing the record button has spread widely, mostly fueled by the <a href="http://www.google.com/search?q=test+automation+without+programming" target="_blank">hype</a> of the tool vendors.</p>
<p>If you do not have any hands-on experience with test automation, you might miss a very important fact about the whole thing - it is not only about creating the  scripts.  In fact the actual script creation rarely takes more than 20-30% of the time you invest in automation. Here is a rough outline of all the things you have to do:</p>
<ul>
<li><strong>Prepare the test environment</strong><br />
With automation you want to have a very consistent environment, with known data and configuration, where you execute your tests. Sometimes this is not possible  - maybe  you have to test in a live system, or you don't control every part of the system landscape.  In such cases you can succeed only if you create smart automated tests that can anticipate and cope with all the expected changes in the environment. I will write more about this topic in the future, but for now let's just say that recording is not smart at all.</li>
<li><strong>Create the test scripts<br />
</strong> This is the actual thing that recording addresses. It might seem that it is a very efficient way of creating test scripts, however in reality it is not. You will make errors while recording (like misclicks or mistypings). Correcting those errors in recorded scripts is most often difficult or even impossible.  Also if you limit yourself to just repeating recorded sequences, you will not benefit from all the good things that automation can offer compared with manual testing (like data-driven tests for example).</li>
<li><strong>Execute the scripts</strong><br />
Or maybe I should say try to execute the scripts. My experience shows that unless you are testing something that has a very simple UI, recording tools often fail to create working scripts out of the box, even if you have managed to ensure absolutely consistent environment for the test execution. Recording lacks the intelligence to understand what you are doing and what your actual intentions are in a complex UI.</li>
<li><strong>Analyze the results</strong><br />
In case you are executing recorded scripts, you will be hoping desperately that they pass successfully. In case something goes wrong (which will be most of the time), you will have extremely hard time trying to understand if it was a bug in the product, an issue with the test script or maybe a change in the application UI.<br />
The time spent in analysis of test results is probably the greatest time-waster in test automation and you can optimize this only by having proper logging on a higher semantic level than UI interactions. Again this is something that I intend to write about.</li>
<li><strong>Update your scripts</strong><br />
Software changes and you will either have to adapt your tests or throw them away. With recording it is mostly about throwing away. It is true that most of the tools now provide some ways to cope with simple changes in the UI, but those are still very limited. For example if a caption of a button changes from 'New' to 'New...',  in most cases you will be able to adjust your scripts. With the good tools you will have to add the '...'  only in one place, no matter how many times you click the button in your test.  However,  imagine that this button is replaced by a context menu.  Most  tools will let you somehow change this in their recorded scripts, but you will have to do this change every single place where the button was clicked in your scenario. Most probably you will just want to re-record it from scratch.</li>
</ul>
<p>If you plan to do any serious automation, do not base the choice of your tool on how well it handles record and playback. In my opinion writing tests using the scripting language (and doing it right) is the only way to make UI automation really work.<br />
I find recording only useful when I am testing with a new UI technology or a new automation tool and I want to quickly find out how it recognizes  a particular UI control.  In such cases recording a few mouse clicks and then looking at the generated script can be useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://testautomationblog.com/2009/03/16/record-playback-does-not-work/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
