<?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>testjutsu</title>
	<atom:link href="http://www.testjutsu.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.testjutsu.com</link>
	<description></description>
	<lastBuildDate>Thu, 15 Jul 2010 23:07:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>What I learned from my puzzle exercise</title>
		<link>http://www.testjutsu.com/what-i-learned-from-my-puzzle-exercise</link>
		<comments>http://www.testjutsu.com/what-i-learned-from-my-puzzle-exercise#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:44:50 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[cryptography]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=254</guid>
		<description><![CDATA[I&#8217;d like to say thank you to everyone who participated in this little puzzle exercise and most especially to everyone who provided feedback. I hope you had fun with it. Well done again to Rushmila Islam who was the first to work out the  puzzle.
I have posted .the solution at the bottom of this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to say thank you to everyone who participated in <a title="One for the puzzle nerds" href="http://www.testjutsu.com/one-for-the-puzzle-nerds">this little puzzle exercise</a> and most especially to everyone who provided feedback. I hope you had fun with it. Well done again to Rushmila Islam who was the first to work out the  puzzle.</p>
<p>I have posted .the solution at the bottom of this post. YOU HAVE BEEN WARNED.</p>
<p>I learned a lot more than I thought I was going to. Firstly and probably the most obviously, I learned a lot about cryptography that I didn&#8217;t previously know. Thanks to James Bach for the collection of links.<br />
<a title="Braingle" href="http://www.braingle.com/brainteasers/codes/index.php">Braingle</a> was probably the best of the bunch. Thanks also for the link to <a title="Sebi's puzzle" href="http://www.testalways.com/2010/07/05/find-bugs-and-patterns/">Sebi&#8217;s puzzle</a>.</p>
<p>I found <cite></cite><a onclick="javascript:pageTracker._trackPageview('/outbound/commentauthor/plasser.net');" rel="external nofollow" href="http://plasser.net/">Jürgen Plasser</a>&#8217;s <a href="http://www.testjutsu.com/one-for-the-puzzle-nerds/comment-page-1#comment-404">answer </a>fascinating. I hadn&#8217;t encountered measuring entropy of text as a way to inform possible encryption techniques. It&#8217;s something I&#8217;d like to look into further.</p>
<p>It was interesting to see how close people got with their responses. Many people had several correct pieces of the puzzle, but not quite enough to solve it completely.</p>
<p>I think most people gave me way too much credit for the amount of crypto knowledge I&#8217;d have had as a high-school student. I didn&#8217;t have access to teh intarwebs back then, and time that I could have spent in the library was more likely to be spent playing role-playing games or painting miniatures or similar valuable life skills.</p>
<p>One of the things that this puzzle made abundantly clear to me was the value of information before and after it becomes known. Without the key information, it was a real puzzle. Far more so than I had originally anticipated. Having all the information at hand, the puzzle seems obvious and simple in hindsight.</p>
<p>It drove home for me just how difficult it is to convey the value of a tester to those who don&#8217;t understand what good testers do. Even the distinction that testers are a source of information (so is a book. so what?) doesn&#8217;t necessarily convey the effort that is involved at producing this information.</p>
<p>Some people went to a great deal of effort; tried some very cool things. That was the most gratifying thing for me. The answer was ultimately irrelevant. I got to see how you guys think. As testers, we are often showing others the fruits of our effort, but not the beauty of the effort itself. Having been able to do that here, at least in part, I think is pretty cool. Thank you again to everyone who shared.</p>
<p>SPOILER ALERT &#8211; Explanation of the cipher follows.</p>
<p>The message was encoded with direct character substitution with a few added extras. The message reads top-down, right to left. The first two characters provide the character offset &#8211; character 1 &#8211; character 2 = offset.</p>
<p>The spaces themselves mean nothing, but exist primarily for obfuscation though I did put them in diagonally in the first puzzle to give a clue to the direction of the word flow. Spaces in the actual message are represented by vowels, so in this sense, vowels do double duty in that they can represent their offset character or a space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/what-i-learned-from-my-puzzle-exercise/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Data driven Selenium in JUnit via @Parameters</title>
		<link>http://www.testjutsu.com/data-driven-selenium-in-junit-via-parameters</link>
		<comments>http://www.testjutsu.com/data-driven-selenium-in-junit-via-parameters#comments</comments>
		<pubDate>Thu, 08 Jul 2010 14:38:19 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[test automation]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=256</guid>
		<description><![CDATA[I played around a bit with iteration using JUnit today. I have some generic tests that behave differently depending on the values fed to them. I don&#8217;t want to have iteration code living alongside each test (maintenance nightmare), so I wanted to use JUnit&#8217;s @Parameters tag to pull in my test data via a Preferences [...]]]></description>
			<content:encoded><![CDATA[<p>I played around a bit with iteration using JUnit today. I have some generic tests that behave differently depending on the values fed to them. I don&#8217;t want to have iteration code living alongside each test (maintenance nightmare), so I wanted to use JUnit&#8217;s @Parameters tag to pull in my test data via a Preferences file and do the iteration for me.</p>
<p>It took me longer than I expected to get right, mostly because static methods annoy me and trip me up a bit. (Your parameters method must be static in order for it to work).</p>
<p>However, get it working I did. On the off chance that it saves someone else some time, here&#8217;s how it works:</p>
<p><code></p>
<pre>
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Properties;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class paramTest
{
	final static String dataFile = "/dataDriver.txt";
	private String words;

	public paramTest(String words)
	{
		this.words = words;
	}

	@Test
	public void verifyThing() throws Exception
	{
		System.out.println("key: " + words);
	}

	@Parameters
	public static Collection<Object[]> data()
	{
		Collection<Object[]> returnList = new ArrayList<Object []>();
		InputStream dataStream = paramTest.class.getResourceAsStream(paramTest.dataFile);
		Properties dataProperties = new Properties();
		try{
			dataProperties.load(dataStream);
		} catch(Exception e)
		{ System.out.println(e);}

		Enumeration<?> e = dataProperties.propertyNames();
		while (e.hasMoreElements())
		{
			returnList.add(new Object[]{dataProperties.getProperty((String) e.nextElement())});
		}
		return returnList;
	}
}
</pre>
<p></code></p>
<p>Interestingly enough, the data comes back in the reverse order that it exists in the preferences file. Something to keep in mind if you want your tests to run in a certain order.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/data-driven-selenium-in-junit-via-parameters/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Selenium setup so far</title>
		<link>http://www.testjutsu.com/my-selenium-setup-so-far</link>
		<comments>http://www.testjutsu.com/my-selenium-setup-so-far#comments</comments>
		<pubDate>Wed, 07 Jul 2010 11:04:14 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[automation framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[test automation]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=245</guid>
		<description><![CDATA[I&#8217;m having a lot of fun with this Selenium gig (shh, don&#8217;t tell anyone). There have been a few yaks shaved and I&#8217;ve seen the inside of some rabbit holes, but there seems to be a lot of good material online to guide you.
At this point, I&#8217;m running my tests directly from eclipse, though we&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m having a lot of fun with this Selenium gig (shh, don&#8217;t tell anyone). There have been a few yaks shaved and I&#8217;ve seen the inside of some rabbit holes, but there seems to be a lot of good material online to guide you.</p>
<p>At this point, I&#8217;m running my tests directly from eclipse, though we&#8217;ll be looking to kick them off with Ant in the near future. I&#8217;ll jump off that bridge when I get to it.</p>
<p><strong>LoggingSelenium</strong><br />
I&#8217;ve set up <a title="LoggingSelenium" href="http://loggingselenium.sourceforge.net/index.html">loggingSelenium</a> to log test execution. I&#8217;m not sure what its current development / support status is over at SourceForge. The documentation it comes with is not real flash, but there&#8217;s a decent example <a title="LoggingSelenium example" href="http://www.jroller.com/selenium/resource/NewTest.java">here </a>(via <a title="Selenium tutorial" href="http://www.jroller.com/selenium/entry/selenium_overview_tutorial">here</a>). I have made a couple of custom modifications to the source of loggingSelenium as there are a few gripes that I have with it.<br />
Some of the pluses are:</p>
<ul>
<li> it will automatically grab screenshots for you when your scripts bork.</li>
<li> it color-codes your asserts and failures</li>
<li> it can wrap JUnit asserts and log them alongside your selenium commands.</li>
</ul>
<p>Some of the not-so-good things are</p>
<ul>
<li> it requires a hardcoded path for writing output</li>
<li> it looks like it&#8217;s geared to non-windows systems, given that out of the box, the screenshot links in html output don&#8217;t work.</li>
<li> the color of failed selenium asserts is different to JUnit asserts, the former being an easy-to-miss beige color.</li>
</ul>
<p>The mods I made were quick and dirty hacks, one to fix the screenshot link and the other to make the beige color more noticeable. If I find myself with a spare second I want to get rid of the need to use a hardcoded path, or at least make it more nicely configurable. I also want to add a color selector so you can customise your output.</p>
<p><strong>Autodocumentation</strong><br />
I&#8217;ve set up <a title="doxygen" href="http://www.stack.nl/~dimitri/doxygen/">doxygen </a>to generate documentation from code comments. I&#8217;ve not hooked it up to anything yet, but either an SVN pre-commit hook or getting ant to kick it off shouldn&#8217;t be a problem.</p>
<p><strong>Test Structure</strong><br />
JUnit 4 does not require you to extend tests from a test class, which is quite nice, actually. Instead, I have written a parent class for my tests to extend from. The parent holds all of the setup and most of the methods that drive the tests themselves.</p>
<p>Currently I&#8217;m writing one test per class. The class contains a single method containing calls to methods in the parent and nothing else, so it ends up looking like a set of test case steps. The parent has the potential to get quite big, so as test case numbers grow, it&#8217;s likely that I&#8217;ll add further abstract classes between the current parent and the tests to group them more reasonably.</p>
<p>I&#8217;m importing data via Properties as a resource stream. I have data that is used to drive the tests and data that is variable, but predictably constrained. For instance, I use a vehicle class number as a driver. The class number refers to a class of vehicle whose data is stored against that number. Depending on the number selected, different vehicle data is populated during setup.</p>
<p>On the subject of Properties &#8211; If you&#8217;re developing in a language that uses double-byte characters (such as Japanese), if you are generating your Properties files as flat files, you&#8217;ll need to run native2ascii on them to convert your double-byte code to unicode. Otherwise, they will not be properly interpreted and things will fall over.</p>
<p>I have just started playing around with the @Parameterised tag and @RunWith(Parameterized.class) to get iteration working with data variation. I haven&#8217;t decided quite how I&#8217;ll run with that yet. I could do this at a suite level and control iterations of tests by feeding data to them, or I can have each test take care of its own iteration by setting up parameterisation within the tests&#8217; parent class.</p>
<p><strong>Browser setup</strong><br />
I&#8217;m doing mobile emulator testing at the moment, so I&#8217;ve <a title="Set up a firefox profile for SeleniumRC" href="http://girliemangalo.wordpress.com/2009/02/05/creating-firefox-profile-for-your-selenium-rc-tests/">set up a firefox profile</a> specifically for it. I&#8217;m using the user.js file to alter the plugin config so that the browser starts up with the plugin activated and a particular device switched on.</p>
<p>When starting seleniumRC, I specify this browser profile specifically so it is automatically used when firing up the browser. I was hoping to be able to change device type on the fly by <a title="Fun with Firefox Chrome URLs" href="http://cow.neondragon.net/index.php/415-Fun-With-Firefox-Chrome-Urls">mucking around with chrome urls</a>, but I&#8217;ve not found an elegant way to do this yet. Instead, I am swapping the user.js file out whenever I need to change. Essentially, you can load up the user.js file with calls to your plugins to switch them on/off and configure them based on what configuration the plugin makes available.</p>
<p>It&#8217;ll end up looking something like</p>
<p style="padding-left: 30px;">user_pref(&#8221;&lt;plugin.configItem1&#8243;, &#8220;value1&#8243;);<br />
user_pref(&#8221;&lt;plugin.configItem2&#8243;, &#8220;value2&#8243;);</p>
<p>You can hunt down config items by typing about:config into your browser. Any config item that is not set will be invisible however, so I ended up <a title="Building a FF extension (and looking through someone else's)" href="http://www.codeproject.com/KB/applications/basicintrofirefoxaddon.aspx">looking through the plugin&#8217;s jar file</a> to see what else I could see.</p>
<p>So at this point, I have a loose collection of parts that are not quite all tied together but it&#8217;s getting there.<br />
Other things I&#8217;m contemplating in the not too distant future is a web front-end so non-technical testers can select test suites and kick them off at will.</p>
<p>While I haven&#8217;t gone into code-level specifics, the links should provide a fair amount of detail. Let me know if there&#8217;s something I&#8217;ve not explained so well. If you have comments or questions re any of this, I&#8217;d love to hear it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/my-selenium-setup-so-far/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One for the puzzle nerds</title>
		<link>http://www.testjutsu.com/one-for-the-puzzle-nerds</link>
		<comments>http://www.testjutsu.com/one-for-the-puzzle-nerds#comments</comments>
		<pubDate>Wed, 23 Jun 2010 10:20:29 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Software Testing]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=217</guid>
		<description><![CDATA[In the spirit of recent puzzles/challenges, I thought I might throw in one of my own. In high school, my class was given an exercise to come up with a coded message that the rest of the class would have to work out the cipher to.
I didn&#8217;t take it that seriously at the time and [...]]]></description>
			<content:encoded><![CDATA[<p>In the spirit of recent <a title="Selena Delesie - the tombstone puzzle" href="http://selenadelesie.com/2010/06/20/the-tombstone-puzzle/">puzzles</a>/<a title="Lanette Creamer - Beam Me Up Challenge" href="http://blog.testyredhead.com/2010/05/18/beam-me-uphypothetical-question.aspx">challenges</a>, I thought I might throw in one of my own. In high school, my class was given an exercise to come up with a coded message that the rest of the class would have to work out the cipher to.</p>
<p>I didn&#8217;t take it that seriously at the time and put in some sort of lame effort at home that afforded me the most time in front of the Commodore-64 instead. Most other kids did the same. Clearly the teacher had been hoping that someone in the class was a secret genius and would put together something brilliant. His disappointment when this did not occur was palpable.</p>
<p>I got thinking afterward that it was a wasted opportunity. I quite like puzzles, I like being creative, but I&#8217;d never put the two together. I spent a little bit of time coming up with something that might have been worthy of the assignment. I never did anything with it, or showed it to anyone, but I was reasonably sure that no one in that class at least would be able to figure it out. I should have put my money where my mouth was then. I might have been able to turn a profit betting people they couldn&#8217;t solve it in a given time limit. Ah well, hindsight is 20/20 as they say.</p>
<p>Instead, I present my code and the message it contains and invite you to work out the key. <strong>If you do figure it out, please don&#8217;t post the solution</strong>, but  I&#8217;d be really interested to hear about how you went about attacking the  problem, so by all means leave a comment.</p>
<p style="padding-left: 30px;">The message: the quick brown fox jumps over the lazy dog</p>
<p><strong>IMPORTANT EDIT:</strong> In a moment of paranoia I double-checked my key and noted that there is a small change to the decoded message. In the coded text, <strong>&#8216;jumps&#8217;</strong> is actually <strong>&#8216;jumped&#8217;</strong>. To those of you who have started, I apologise profusely. This means that there is an extra letter to the message than you thought you were dealing with, and rather than an &#8217;s&#8217;, you have a &#8216;d&#8217; and an &#8216;e&#8217;.</p>
<p>The revised decoded message is:</p>
<p style="padding-left: 30px;">The message: the quick brown fox jumped over the lazy dog</p>
<p style="padding-left: 30px;">The coded message:<span style="font-family: courier;"><br />
n g o c w u o y j &nbsp;  r<br />
&nbsp; f l l l q m v &nbsp; e k<br />
&nbsp; o i y k b v &nbsp;  r x a<br />
&nbsp; k s e a t &nbsp;  d i b o<br />
&nbsp; v h a v &nbsp;  e u i p l</span></p>
<p><strong>edit:</strong> James Bach has rightly pointed out that I could have worded my challenge a little more clearly. </p>
<p style="padding-left: 30px;">There are an infinite number of keys that can associate your output with your input. For instance, the key might be simply to look at the first letter in the top left, and &#8220;n&#8221; means &#8220;quick brown fox&#8230;&#8221;</p>
<p>My intention is that people would attack this problem as though they did not know what the message was in an attempt to resolve the letters presented into the answer provided. I had a particular key in mind when I put it together, so the letters do resolve into the message given.</p>
<p>Enjoy.</p>
<p><strong>Update</strong><br />
Okay, so a few people have asked for hints.<br />
Here&#8217;s the deal &#8211; I&#8217;ll post a few hints, but I&#8217;m curious to know what you&#8217;ve tried and what you thought. I&#8217;ve posted one hint below. I will post more, but I&#8217;d like to know &#8211; How did you approach the problem? What strategies did you employ? What effect did the hint(s) have?</p>
<p>Hint 1</p>
<table bgcolor="black">
<tr>
<td>
<font color="black">There are red herrings</font></span>
</td>
</tr>
</table>
<p>Hint 2</p>
<table bgcolor="black">
<tr>
<td>
<font color="black">There is a hint in the layout</font></span>
</td>
</tr>
</table>
<p>Hint 3</p>
<table bgcolor="black">
<tr>
<td>
<font color="black">Some letters are overloaded (have more than 1 meaning)</font></span>
</td>
</tr>
</table>
<p>Congratulations to Rushmila Islam, who has at least worked out the message component, if not the complete cipher (which is trivial once the message is in-hand). Here&#8217;s another pangram (one with all the letters this time).</p>
<p style="padding-left: 30px;">The coded message:<span style="font-family: courier;"><br />
k e i f v a l p q u w<br />
&nbsp;  b m a g n z i e c e<br />
<br />
&nbsp;  m g d r w o o t a h<br />
&nbsp;  y j a w u x a g e s<br />
</span><br />
I kinda wish I&#8217;d put this one up first now. It looks trickier <img src='http://www.testjutsu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Rushmila (or anyone else) &#8211; care to post the decoded message?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/one-for-the-puzzle-nerds/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Adieu to QTP. Now for a closer look at Selenium</title>
		<link>http://www.testjutsu.com/adieu-to-qtp-now-for-a-closer-look-at-selenium</link>
		<comments>http://www.testjutsu.com/adieu-to-qtp-now-for-a-closer-look-at-selenium#comments</comments>
		<pubDate>Mon, 21 Jun 2010 15:40:06 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[adam goucher]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[automation framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[selenium]]></category>
		<category><![CDATA[Software Testing]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=214</guid>
		<description><![CDATA[To borrow from Groucho Marx &#8211; QTP, I&#8217;ve had a wonderful time, but  this wasn&#8217;t it.
So thankfully I&#8217;ve been able to step away from QTP for the moment. Given that QTP doesn&#8217;t recognise Firefox so well after v3.6, and since we use a firefox plugin for most of our mobile testing (FireMobileSimulator), yours truly gets [...]]]></description>
			<content:encoded><![CDATA[<p>To borrow from Groucho Marx &#8211; QTP, I&#8217;ve had a wonderful time, but  this wasn&#8217;t it.</p>
<p>So thankfully I&#8217;ve been able to step away from QTP for the moment. Given that QTP doesn&#8217;t recognise Firefox so well after v3.6, and since we use a firefox plugin for most of our mobile testing (FireMobileSimulator), yours truly gets to switch to Selenium instead. I&#8217;m thankful for having had the opportunity to work on QTP, mostly so I have a better understanding of its limitations and shortcomings. I can argue more coherently against what seems to be in most cases, a ridiculous waste of money.</p>
<p>I view QTP a bit like one of those unfortunate bears in a <a title="WSPA - Bear farming" href="http://www.wspa.org.uk/wspaswork/bears/bearfarming/default.aspx">Chinese bile farm</a>. You can see how at birth it had the potential to be something majestic and powerful, but instead it languishes in a cage, irreparably twisted and deformed by years of abuse by the ignorant.</p>
<p>In comparison, Selenium while not without challenges of its own, has been by and large a real joy to use. For starters, having any number of fully fledged languages to work in is almost unbelievable after having toiled in VBScript land for far too long. In fact, the first problem I faced was which language do I go with?</p>
<p>I ended up choosing Java and JUnit, mostly because it&#8217;s what the current dev team codes with, and I simply cannot be arsed copping the flak I would get from management for introducing another language into the picture (as wonderful as jruby and jython are, I&#8217;m sure).</p>
<p>I didn&#8217;t realise quite how much thinking in VBS had stunted my thinking in other languages. I do a bit of coding in my spare time, but as far as automation coding goes, it took me a good few days to get comfortable again remembering the power that a real language gives you. I was all set to start importing test data from excel when a timely tweet (and <a title="Adam Goucher - advice for using selenium in Java" href="http://element34.ca/blog/if-you-really-must-write-your-selenium-framework-in-java">subsequent blog post</a>) from Adam Goucher reminded me that Java has these nifty things called Properties that you can import. (This is why tools like twitter should be allowed in the workplace btw &#8211; okay my RSS reader would have picked it up, but not before I&#8217;d wasted a lot of time).</p>
<p>It&#8217;s been a bit over 3 years since I last looked at Selenium. It doesn&#8217;t &#8216;feel&#8217; all that different, but it does seem a lot easier to work with than I remember it being. Within a couple of days I&#8217;d whipped together a script to cut down some checks that took 4 hours manually to a little under 2 minutes. W00t.</p>
<p>I added loggingSelenium to my test setup and now have some pretty colours that light up for people who are impressed by that sort of thing. I&#8217;m now in the process of putting together a few more tests and a framework that will support them and their inevitable expansion.</p>
<p>There are a bunch of setup how-to&#8217;s out there, so I won&#8217;t be doing that, but I will drag together some of the more useful links that I&#8217;ve found. Stay tuned <img src='http://www.testjutsu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/adieu-to-qtp-now-for-a-closer-look-at-selenium/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adventures in GUI Automation &#8211; Basic Hierarchy</title>
		<link>http://www.testjutsu.com/adventures-in-gui-automation-basic-hierarchy</link>
		<comments>http://www.testjutsu.com/adventures-in-gui-automation-basic-hierarchy#comments</comments>
		<pubDate>Thu, 06 May 2010 10:24:07 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[automation framework]]></category>
		<category><![CDATA[gui automation]]></category>
		<category><![CDATA[gui testing]]></category>
		<category><![CDATA[logical functional model]]></category>
		<category><![CDATA[michael hunter]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[test automation]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=209</guid>
		<description><![CDATA[On the suspicion that my last post amounted to a bunch of word salad for a few, let me see if I can add some clarity by describing the basic hierarchy I&#8217;m using for my framework.
At the top level, I have a suite control script that looks like this:
doSetup   &#8216;Calls to set up data and [...]]]></description>
			<content:encoded><![CDATA[<p>On the suspicion that my last post amounted to a bunch of word salad for a few, let me see if I can add some clarity by describing the basic hierarchy I&#8217;m using for my framework.</p>
<p>At the top level, I have a suite control script that looks like this:</p>
<p style="padding-left: 30px;">doSetup   &#8216;Calls to set up data and environmental variables and such like</p>
<p style="padding-left: 30px;">Call Script1<br />
Call Script2<br />
&#8230;<br />
Call Script n</p>
<p>Each script that is called is some sort of major transaction that an end-user would recognise.</p>
<p>If you missed the update I made to my last post, I&#8217;ve moved a number of function libraries to classes to lessen the amount of coupling required between the ValidationManager and the scripts. There is a small overhead involved in that the relevant class has to be instantiated at the start of the script. For debugging purposes, I have also added a commented-out debug section that calls the setup function that the suite control script does. Each script looks a bit like this:</p>
<p style="padding-left: 30px;">&#8216;#begin debug<br />
&#8216;doSetup    &#8216;uncomment this if debugging this script<br />
&#8216;#end debug</p>
<p style="padding-left: 30px;">Transaction = loadTransaction    &#8216;This is the instantiation of the class that holds the Transaction&#8217;s functions</p>
<p style="padding-left: 30px;">Transaction.function1<br />
Transaction.function2<br />
SharedFunction<br />
Transaction.function3<br />
&#8230;<br />
Transaction.function n</p>
<p>For functions that are shared across multiple transactions, I have left them as a standard function library. On the plus side, the Transaction namespace aids clarity and lets you know where your functions live. On the downside, you can no longer access them by using the right-click-&gt;go to function definition option. No biggie imho.</p>
<p>The transaction classes aren&#8217;t that much different from your standard function library other than the fact that they&#8217;re wrapped in a class definition and there&#8217;s a bit of setup stuff at the start.</p>
<p style="padding-left: 30px;">Class Transaction</p>
<p style="padding-left: 30px;">Dim VerificationManager</p>
<p style="padding-left: 30px;">Private Sub Class_Initialize()<br />
VerificationManager = loadVerificationManager   &#8216;Here&#8217;s where the verification manager is instantiated<br />
EndSub</p>
<p style="padding-left: 30px;">Public Sub Function1<br />
do.something<br />
VerificationManager.CalculateExpectedState(&#8221;someAction&#8221;)<br />
do.someAction<br />
VerificationManager.Verify(&#8221;someAction&#8221;)<br />
do.somethingElse</p>
<p style="padding-left: 30px;">End Sub</p>
<p style="padding-left: 30px;">&#8230;</p>
<p style="padding-left: 30px;">End Class</p>
<p>I&#8217;ve still not gotten the all-clear to post the verification manager code, but as mentioned previously, it is a class also. There are 4 methods; 1 for setup and 3 relating to verification.</p>
<p>CalculateExpectedState calls a file called &#8220;someAction&#8221;. someAction calls a setup routine that creates a new dataSheet, also called someAction and populates it with expected data.<br />
Back in the class method, the action takes place, at which point we return to the verification manager when Verify is called.</p>
<p>Verify calls the someAction file which calls a second routine that gathers data from the app and does any calculations required and stores the results in the someAction dataSheet. Verify then calls a diff function that compares the expected and actual results and reports. Finally, verify calls UpdateMasterData, which compares the actual data with the master data sheet and replaces anything that was changed.</p>
<p>At this point, there is a new data sheet created for each different call to the verification manager. This has the potential to get out of hand as the number of verification points increases. I&#8217;m thinking of using a single sheet and dumping the results to a file at the end of each verification. I&#8217;ll see what else occurs to me as I go.</p>
<p>I promised to talk a bit about what I&#8217;m doing with data. I still need to cover that. I&#8217;ve been having fun trying to define heuristics to govern where the data should drive the scripts and where I should handle variance programatically. I think I have something that works. We shall see.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/adventures-in-gui-automation-basic-hierarchy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in GUI Automation &#8211; Verification Layer</title>
		<link>http://www.testjutsu.com/adventures-in-gui-automation-verification-layer</link>
		<comments>http://www.testjutsu.com/adventures-in-gui-automation-verification-layer#comments</comments>
		<pubDate>Wed, 28 Apr 2010 09:14:44 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[automation framework]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[gui automation]]></category>
		<category><![CDATA[gui testing]]></category>
		<category><![CDATA[logical functional model]]></category>
		<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=204</guid>
		<description><![CDATA[One of the things I really like about the Logical Functional Model is the concept of removing verification code from the execution code. Another is updating verification data on the fly to reduce the likelihood of false positives.
These concepts are especially appealing since QTP&#8217;s in-built verification method is not worth using. Verification points are script-specific. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things I really like about the Logical Functional Model is the concept of removing verification code from the execution code. Another is updating verification data on the fly to reduce the likelihood of false positives.</p>
<p>These concepts are especially appealing since QTP&#8217;s in-built verification method is not worth using. Verification points are script-specific. You can&#8217;t update and re-use them multiple times within a script or share them across multiple scripts. Maintenance nightmare.</p>
<p>Instead, what I have done is to write a custom verification layer. Here&#8217;s how it works. At the start of my control script, I instantiate the VerificationManager, which is a class I have written to take care of verification code.</p>
<p>If a function that I am executing needs to do any verification, <span style="text-decoration: line-through;">I pass the class to it by reference </span>UPDATE: I&#8217;ve switched how I call this now. I&#8217;ve turned function libraries into classes. Each class instantiates the VerificationManager as part of its own setup and the functions can then call the VerificationManager without having to handle it as a parameter. There are several reasons for this &#8211; I&#8217;ll go into these in an upcoming post.</p>
<p>Within the function (now class method), there are 2 calls to the VerificationManager, one to set up the expected data and another to retrieve the actual data.</p>
<p>Where you call these depends on what setup you need to do beforehand. If you&#8217;re getting expected values from the application under test, you&#8217;ll want to do so before you execute the code you want to verify. If you&#8217;re grabbing your expected data from the data table, then you can do it just before you call the code to retrieve the actual data.</p>
<p>That probably looks like word salad on first read through. If you haven&#8217;t already, I strongly suggest you take a look at the verification chapter in Michael Hunter&#8217;s description of the LFM. It took me a couple of read-throughs to really get it, but once I did, I was impressed.</p>
<p>How does the VerificationManager work?<br />
It&#8217;s as generic as I can make it. It has 4 methods.</p>
<ul>
<li>CalculateExpectedState(someAction)</li>
<li>Verify(someAction)</li>
<li>Diff</li>
<li>UpdateMasterData</li>
</ul>
<p>CalculateExpectedData and Verify both make calls to files called StateGenerators. It is the role of the StateGenerators to hold the logic and fetch the data required to do the verification. In simple terms, they are function libraries that are loaded at runtime by the VerificationManager.</p>
<p>You&#8217;ll notice that the parameter for each of these methods is the same. They call the same StateGenerator and this parameter tells them what name to look for. The VerificationManager loads the StateGenerator specified and executes one of two functions &#8211; either a &#8217;setExpectedState&#8217; or &#8216;getActualState&#8217; function.</p>
<p>Each call to the verification manager will use a different name. There will be one StateGenerator for each call. The StateGenerators all have 2 functions, all of them identically named. What they contain differs based on what they need to verify. There might be a series of calls to the global data table to grab data that needs to be checked, or there could be logic to calculate an expected value from a set of other values.</p>
<p>The setExpectedState function creates a new data sheet to hold expected data. If any of this data comes from the GlobalDataTable, then the new data sheet has an identically named column. Likewise if there are any new columns that need to be added to the Global data table for future reference, then this happens here too.</p>
<p>Once the code to be verified has executed, the call to Verify happens. Verify grabs expected values from the application under test and adds them to the second line of the expected data column. It then calls Diff, which (as the name suggests), compares each value of row 1 with the values in row 2.</p>
<p>The diff method logs both successful comparisons and failures by making a call to the standard QTP reporter. Right now, I&#8217;m going for simplicity; there&#8217;s a lot more you could do with this if you wanted. You could add weights to each verification item and log a severity message based on the weight of the failed item. You could call a custom reporter (which is a good idea, given that any time you tell QTP of a failure, it treats the entire script as failed). You get the idea.</p>
<p>Lastly, the Diff method calls UpdateMasterData. This routine simply loops over any difference and checks the global data table for columns of the same name. If they exist, the global data table is updated with the new value, so that if any comparison is made against it later in the script, it will be made against what we see in the system during this run.</p>
<p>I&#8217;ve asked my current employer for permission to post the code, as it&#8217;s completely abstract and contains no proprietary data. No word on whether they&#8217;ll go for that yet, but if so, I&#8217;ll update that here. Hopefully there&#8217;s enough here already to be useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/adventures-in-gui-automation-verification-layer/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adventures in GUI Automation &#8211; getting my bearings</title>
		<link>http://www.testjutsu.com/adventures-in-gui-automation-getting-my-bearings</link>
		<comments>http://www.testjutsu.com/adventures-in-gui-automation-getting-my-bearings#comments</comments>
		<pubDate>Wed, 17 Mar 2010 10:05:49 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[gui automation]]></category>
		<category><![CDATA[gui testing]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[test automation]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=197</guid>
		<description><![CDATA[So I mentioned some of the inherent issues that I dislike about QTP 10. One of those appears to be that reusable actions intermittently fail. An action in QTP is a tool-defined item that collects a number of GUI manipulations (or function calls) into a named action. It sounds handy. It probably would be if [...]]]></description>
			<content:encoded><![CDATA[<p>So I mentioned some of the inherent issues that I dislike about QTP 10. One of those appears to be that reusable actions intermittently fail. An action in QTP is a tool-defined item that collects a number of GUI manipulations (or function calls) into a named action. It sounds handy. It probably would be if it worked reliably, but it doesn&#8217;t &#8211; at least not for me. The other thing is that if you have reusable actions (let&#8217;s say for instance that you keep your common ones in a single file and call them from other files), you cannot modify those actions without first closing your current test file and opening the one where the action is defined.</p>
<p>Instead, I have organised my scripts into a series of user-centric actions, which I have defined as functions in function libraries. To be clearer, each function executes a series of steps in the gui that an end-user would recognise as an action. e.g. log in, navigateToQuotationScreen and so on. This seems to work pretty well. I end up with a QTP screen that looks like a high-level checklist of how to execute a particular workflow. You do not have the editing restrictions that you do with reusable actions, as you can have as many function libs open as you like.</p>
<p>Neato. So I&#8217;ve been using the record tool to get something that works. Mostly because I dislike VBScript. I think it&#8217;s the Orcish of programming languages (Maybe not even that. Maybe it&#8217;s Kobold &lt;/nerd&gt;). The recording tool creates a bunch of objects and sticks them in the object repository. That&#8217;s fine, saves me having to do it myself. Drawbacks to this are that for dynamically created objects, you may end up with a bunch of identical objects with different names. Not too hard to figure out, given that you should be naming your objects something sensible anyway. You can weed out the dupes when you do this and update your script accordingly. I&#8217;m definately going to check out <a title="Albert Gareev's blog" href="http://automation-beyond.com/" target="_blank">Albert Gareev</a>&#8217;s suggestion of <a title="QTP - dynamically loaded object repositories" href="http://www.testjutsu.com/adventures-in-gui-automation#comment-275" target="_blank">dynamically loaded object repositories</a>. That sounds quite handy. I will say though that at the moment I&#8217;m being assisted by some not-so-technical testers who I am weaning away from the keyword view and the active screen.</p>
<p>The recording tool doesn&#8217;t always use the best code for the job. It&#8217;s the same old story &#8211; want the job done right? Gotta do it yourself. After the initial script is in place, I&#8217;ve been reading through the code and separating it into user-centric actions. At the same time, I look for:</p>
<ul>
<li> places where the code can be optimised</li>
<li> places where data should be dynamic</li>
<li> any fluff commands that QTP put in</li>
<li>potential duplicates in the OR</li>
</ul>
<p>At this point, what I&#8217;ve ended up with is having a series of user-centric &#8216;tests&#8217; &#8211; I&#8217;ll call them transactions. Each one is an action (as every QTP test has 1 action by default), but consists of a series of calls to function libraries.  Each function is named for a step that a user might consider part of the transaction. For example, if we were talking about a program that provides a quote for car maintenance, the list of function calls might look like this:</p>
<ul>
<li>enterVehicleDetails</li>
<li>selectServiceTypeAndLocation</li>
<li>selectPreferredDates</li>
<li>completeQuotation</li>
</ul>
<p>Each of these functions lives in an associated function library. These functions may in turn call helper functions (such as date/time functions to enter date ranges in the future). Each transaction hides the ugly details of what is going on under the hood and while you don&#8217;t get to use the &#8216;keyword view&#8217; anymore, you do have a clearly labeled set of steps.</p>
<p>So at this point, I have some scripts. They work. They&#8217;re not robust and they don&#8217;t do any data verification to speak of, but it is a beginning. Next up &#8211; parameterization and making use of the data table.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/adventures-in-gui-automation-getting-my-bearings/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Adventures in GUI automation</title>
		<link>http://www.testjutsu.com/adventures-in-gui-automation</link>
		<comments>http://www.testjutsu.com/adventures-in-gui-automation#comments</comments>
		<pubDate>Fri, 05 Mar 2010 09:50:39 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[automated testing]]></category>
		<category><![CDATA[gui automation]]></category>
		<category><![CDATA[gui testing]]></category>
		<category><![CDATA[QTP]]></category>
		<category><![CDATA[test automation]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=182</guid>
		<description><![CDATA[So I&#8217;ve been hacking away at QTP for the last couple of weeks (no, I didn&#8217;t make the decision to purchase it, yes I have to use it as the political consequences of not doing so are more painful).
I&#8217;m not a massive fan of QTP, mostly because I think that it&#8217;s really bloody cheeky for [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been hacking away at QTP for the last couple of weeks (no, I didn&#8217;t make the decision to purchase it, yes I have to use it as the political consequences of not doing so are more painful).</p>
<p>I&#8217;m not a massive fan of QTP, mostly because I think that it&#8217;s really bloody cheeky for a company to charge six figures for a product because of its feature richness, then charge 5 figures for training because it&#8217;s so complex that no one can use the damn thing, not to mention that all the official written how-to information is safely tucked away behind a walled off site, available for those who pay their support fees.  For the same price HP charge for basic QTP training, I could fly any world-class tester out here for a week to hang out with me and my team. I know which option I&#8217;d get more value from.</p>
<p>Luckily there are plenty of useful sites out there maintained by QTP users, which is handy because if your support fees are not paid up, you get bugger all from the source.</p>
<p>QTP 10 has some inherent bugs that annoy me and I&#8217;m still dubious about how well the shared object library will work for me in the long run, but leaving the ranting and bitching aside, I should say that it does seem to be doing what I tell it to most of the time.</p>
<p>I&#8217;m attempting to implement <a title="Michael Hunter - Automation Stack (The logical functional model)" href="http://www.thebraidytester.com/stack.html" target="_blank">Michael Hunter&#8217;s Logical Functional Model</a> (which I think is really bloody clever, btw) as best I&#8217;m able. It&#8217;s still early days yet, but we&#8217;ll get there. I do run into problems a lot, largely because if my inexperience with the tool, but perhaps some good will come of it if I share my pain with you <img src='http://www.testjutsu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m going to post bits and pieces that I discover, just in case they&#8217;re useful to others. I don&#8217;t know how well QTP will fit the LFM, but I&#8217;ll see what I can do about documenting my progress with that as well.</p>
<p>For the moment, here are a few links that I have found useful:</p>
<ul>
<li><a title="SQA Forums QTP FAQ" href="http://www.sqaforums.com/showflat.php?Cat=0&amp;Number=402552" target="_self">The SQA forums QTP FAQ</a></li>
<li><a title="Codewanker" href="http://www.codewanker.com/codearticle6.htm" target="_self">CodeWanker</a> (love the name)</li>
<li><a title="Sachin Dhall's blog" href="http://qtp.blogspot.com/" target="_self">Sachin Dhall&#8217;s QTP blog</a></li>
<li><a title="Dmitry Motevich's blog" href="http://motevich.blip.tv/" target="_blank">Dmitry Motevich&#8217;s blog</a> (vlog?) QTP How-to movies</li>
</ul>
<p>There are a few others out there, but they&#8217;re full of ISTQB ads, so I don&#8217;t really feel like linking to them. <a href="http://testertested.blogspot.com/2009/05/testing-experience-magazine-voice-of.html" target="_self">I&#8217;m sure you understand</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/adventures-in-gui-automation/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How not to start a discussion</title>
		<link>http://www.testjutsu.com/how-not-to-start-a-discussion</link>
		<comments>http://www.testjutsu.com/how-not-to-start-a-discussion#comments</comments>
		<pubDate>Wed, 27 Jan 2010 00:07:35 +0000</pubDate>
		<dc:creator>Ben Kelly</dc:creator>
				<category><![CDATA[Everything]]></category>
		<category><![CDATA[Software Testing]]></category>
		<category><![CDATA[exploratory testing]]></category>
		<category><![CDATA[misconceptions about testing]]></category>
		<category><![CDATA[poor software testing]]></category>

		<guid isPermaLink="false">http://www.testjutsu.com/?p=189</guid>
		<description><![CDATA[I gues I must be feeling punchy lately. No new content here for a little while, but I felt the need to respond to someone who linked to one of my posts. What I probably should have done was commented here and sent a pingback, but does anyone click on those anymore?
I digress.
Marcin Zręda has [...]]]></description>
			<content:encoded><![CDATA[<p>I gues I must be feeling punchy lately. No new content here for a little while, but I felt the need to respond to<a title="Fallacious article about exploratory testing" href="http://www.testandtry.com/2010/01/26/exploratory-testing-good-and-bad-sides/comment-page-1/#comment-732" target="_blank"> someone who linked to one of my posts</a>. What I probably should have done was commented here and sent a pingback, but does anyone click on those anymore?</p>
<p>I digress.<br />
<span id="commentauthor-730">Marcin Zręda has written an article that describes his conclusions from his experience with ET. The problem is, these conclusions are not presented as conclusions of his experience, they are listed as things that are good and bad about ET (with a line about them being drawn from his experience buried in the first paragraph).</span></p>
<p>I wrote a lengthy reply which I think should serve to counter most of the the errors he has made in describing ET.  Marcin has mentioned in the comments that the article was to serve as a jumping off point for discussion. In my opinion, this will likely have the desired effect, but misrepresenting experience as fact is one way to get people off on the wrong foot when having dialogue with you.</p>
<p>In this case, rather than wanting to know more about Marcin&#8217;s experiences, I wanted to correct what I saw as horribly misleading statements about ET. Now that I see he was trying to engender conversation, I am disinclined to continue.</p>
<p>&#8216;I have these experiences with ET &#8211; what do you think? How does your experence compare?&#8217; &#8211; sets a much different tone than &#8216;here are some good and bad things about ET&#8217; (followed by a list of flame bait)&#8217;. I think that as testers we have a duty to be better than that. If you want to have a discussion about testing, or even an argument about it, there are plenty of people out there to have those kinds of discussions with, but be up-front about it. Be open about it and you will likely find that you will both learn more and keep your credibility intact.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.testjutsu.com/how-not-to-start-a-discussion/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
