Mr Peanut at Austin Workshop on Test Automation

I spent the last few days in Austin, Texas, USA at the Austin Workshop on Test Automation. It was loads of fun, it seems that Austin is full of heaps of Gung Ho people which is really refreshing.

One evening for drinks, MarekJ bought some Mr Peanut mixed nuts. It was a huge tin: 1.58kg, which would be used to sell house paint in Australia.

I was fascinated by this amazing object, which contained the somewhat ironic claim on its label: “less than 50% peanuts”, so I took a few photos of it. Today I uploaded all my AWTA (and general Austin) photos to PicasaWeb and ran the facial recognition feature.

Guess who came up?

Mr Peanut @ AWTA
Mr Peanut @ AWTA

Yes: Mr Peanut. Hilarious.

Just last night at dinner I was complaining that PicasaWeb couldn’t recogize my wife’s cat.

I’ve tagged Mr Peanut now and propose an ongoing joke to have Mr Peanut photos taken and tagged at all future open source testing conferences.

I’m currently writing this in transit in LAX. I still can’t believe how big that Boeing 747-400 sitting right there is.

Boeing 474-400 at LAX
Boeing 474-400 at LAX

Easily define Watir tests in excel, OO, wikis and Google docs using Roo

I spent this evening playing with Roo, the ruby library for reading data from spreadsheets and I am very impressed. In a very small amount of time I was able to define tests in four different forms/places and could execute my tests from each of these:

  • An Excel file (.xls): stored locally
  • An OpenOffice (.ods): stored locally
  • An Excel file (.xls) stored in a Confluence wiki page with Confluence Office Connector; and
  • A Google Docs spreadsheet.

The great thing about Roo is that you don’t actually need Excel; Roo simply reads the file, unlike the ruby Excel COM WIN32 API I have used previously.

The spreadsheet (embedded in Confluence) looks like this:

excel-in-confluence

The cool thing about embedding it in Confluence is that you can click the title of the spreadsheet to edit it (in OpenOffice in my case).

I made some minor changes to my existing code that executed my depot tests from a wiki page, and it was as easy as that. A data driven Watir solution with four possible ways to define test cases. Cool.

You can find all the code needed below.


require 'watir'
require 'rubygems'
require 'roo'
require './Customer.rb'
require './Common.rb'

case ARGV[0]
when "excel"
	ss = Excel.new("watirmelon.xls")
when "wiki"
	ss = Excel.new("http://localhost:8080/download/attachments/2097153/watirmelon.xls")
when "gdocs"
	ss = Google.new("http://spreadsheets.google.com/ccc?key=pEcLrW3b2djraE8JF_2fJWA")
else
	ss = Openoffice.new("watirmelon.ods")
end

ss.default_sheet = ss.sheets.first
ss.first_row.upto(ss.last_row) do |line|
	if ss.cell(line,1).strip != "Function" then #We have an executable test
		begin
			module_name = ss.cell(line,1).strip
			method_name = ss.cell(line,2).downcase.strip.sub(' ','_') # automatically determine function name based upon method name.
			comments = ss.cell(line,3).strip
			expected_outcome = ss.cell(line,4).strip
			expected_error = ss.cell(line,5).strip
			required_module = Kernel.const_get(module_name)
			required_method = required_module.method(method_name)
			arity = required_method.arity() # this is how many arguments the method requires, it is negative if a 'catch all' is supplied.
			arity = ((arity * -1) - 1) if arity < 0
			parameters = []
			1.upto(arity) do |p|
				parameters.push(ss.cell(line,p+5))
			end
			actual_outcome, actual_output = required_method.call(*parameters)
			# determine the result.
			if (expected_outcome = 'Success') and actual_outcome then
			    result = "PASS"
			elsif (expected_outcome = 'Error') and (not actual_outcome) and (expected_error = actual_output) then
			    result = "PASS"
			else
			    result = "FAIL"
			end
			puts "\nRunning Test: #{method_name} for #{module_name}."
			puts "Expected Outcome: #{expected_outcome}."
			puts "Expected Error: #{expected_error}."
			puts "Actual Outcome: #{actual_outcome}."
			puts "Actual Output: #{actual_output}."
			puts "RESULT: #{result}"
		rescue
			puts "An error occurred: #{$!}"
		end
	end
end

See the full test code below the break.

Continue reading “Easily define Watir tests in excel, OO, wikis and Google docs using Roo”

Websites don’t need holidays

I am really dissapointed in the Australian Tax Office for taking down their entire web site for eleven days over Christmas/New Years 2008-2009. The website contains important reference information that should be accessible anytime. How can any organisation justify such a lengthy period of down time, especially for a web site with mostly static content for reference?

tax-office-it-shutdown

Twitter is over capacity

I like friendly error messages; I don’t think you can get much cuter than Twitter’s over capacity error message:

Twitter error message
Twitter error message

I just love how the whale is smiling. It makes it such a better error message. I don’t think many companies would be game to use a whale on their capacity error page (if they even had one) but in this case it just works.

Austin Workshop on Test Automation (AWTA) 2009

Watircraft are organising the Austin Workshop on Test Automation to be held on 16-18 January 2009 in Austin, Texas.

I have been approved to attend. It means three long flights from Australia (about 25 hours each way) but I am really looking forward to attending and meeting different people who are involved in Watir.

I haven’t been to America before either, so it should be really good.

Watir podcast eight

Episode eight of the Watir Podcast was released today in which Željko Filipin interviews me about my experience in using Watir, and also about my newly announced role as the Watir Wiki Master.

Check it out if you’re interested: http://watirpodcast.com/alister-scott/