ci_reporter output for Watir

I’ve been using the ci_reporter gem to grab the results from my Test::Unit verifications and put them in an xml file.  Then I apply an xsl stylesheet to the xml to transform the results into html.  It’s not the prettiest report, but it beats reading xml or parsing through command line output.  My goal is to move my test framework to a rails app for better reporting and data management, but for now, I’m sticking with the ci_reporter output.  Here’s how it works:

First you need to install the ci_reporter gem and require the ci_reporter rake task in your framework class (in my case in my Test::Unit class):

require 'ci/reporter/rake/test_unit_loader'

After running your framework, ci_reporter will create ‘test/reports’ subdirectories and place the xml output of your tests in the reports folder.

Next, you’ll need to transform this xml output to html.  This is accomplished by applying an xsl stylesheet to your xml.  I’ve saved my stylesheet text as a doc file here:

https://tcfodor.files.wordpress.com/2009/04/transform-results.doc

To apply the stylesheet, add the following at line 2 of your xml output:

<?xml-stylesheet type="text/xsl" href="transform-results.xsl"?>

In my case, I just make sure the stylesheet is saved in the local directory.  If you want to save it somewhere else, you’ll need to supply a relative path.

As part of my framework, I’ve automated updating the xml output and renaming  it with a test run.  Then it saves the xml output and xsl transform to a network location to share with the rest of the team.

This assumes that IE is your browser of choice, to view the report in Firefox, add the following line to your xml output at line 3.

<xsl:if test="system-property('xsl:vendor')='Transformiix'"></xsl:if>
Advertisement

July 23, 2009 at 9:09 pm Leave a comment

Watir Podcast #23 – turning the table on Zeljko

I recently had the pleasure of recording a Watir Podcast with Watir Core Team member Zeljko Filipin.  You can find it at http://watirpodcast.com/23-zeljko-filipin/ Zeljko (aka Z*) is very involved with the Watir community and has been recording Watir podcasts for a year now.

April 14, 2009 at 9:04 pm Leave a comment

watir-console, my new best friend

I’ve made the move from irb to watir-console for troubleshooting Watir code.

Since version 1.5.2, watir-console has been part of the Watir installation.  Basically, it’s an irb session on steroids.  It’s launched through a regular console the same way irb is (c:\>watir-console), but it also includes the following:

  • a local log of your session (saved as console.log)
  • tab complete functionality
  • does require ‘watir’ automatically

Jim Knowlton has a great example of adding helper class functionality to watir-console so that any classes or methods you want can be automatically available when you launch watir-console.

http://www.agilerubytester.com/2009/02/customizing-watir-console.html

Pair watir-console with an HTML element inspector like Firebug (for Firefox) or IE Developer Toolbar, and you have a great environment for testing and troubleshooting watir tests.

April 2, 2009 at 7:06 pm Leave a comment

Our coolest project ever

A few years ago, my husband traded a 40’s-era Chrysler hubcap that he had hanging in our garage for an old Pepsi machine.  The guy he traded had an old Chrysler and had been looking high and low for the one hub cap he was missing.  Plus, he had stocked the soda machine with beer and was tired of his son’s college-age friends’ raiding it.  We felt guilty, but he considered it a fair trade.

The soda machine languished in a corner of our garage until our beer fridge died last summer.  We pulled it out of the corner, crossed our fingers and plugged it in – it fired up like new!  It needed a paint job, so John painted the body and my Mom painted the new logo.  I wired it to bypass the broken coin mechanism and voila! – we have the most excellent soda beer machine I’ve ever seen.

Props to Mom and John for the paint job!

Props to Mom and John for the paint!

March 26, 2009 at 11:17 pm Leave a comment

PMI TMI

There’s a certification that project management professionals can get from the aptly-named Project Management Institute.  It’s one of the more popular certifications, and as I understand, it’s not easy.  To be certified, you have to go to a lot of classes, work as a PM professional and keep the certification up-to-date.

The worst PMs I’ve worked with have been PMI-certified.  There.  I said it.  I said it, and here’s why…..

I don’t believe that the PMI is teaching bad techniques – I’m sure they’re very valuable.  However, these techniques should not be applied as cookie-cutters at the expense of common-sense and an awareness of the project at hand.  They shouldn’t be thrown up as hurdles for the sake of clearing them so that the PM can mark something off a checklist they got from a class.  Some people understand this and use what they learned at PMI as it makes sense.  Others don’t and try to shoehorn a project into their view of what every project should be.

I’m not saying that everyone with PMI certification should be avoided.  On the contrary, I’ve worked with great PMs who have PMI certification.  However, all of the worst PMs I’ve worked with have it and some of the very best have no certifications at all.  The best PMs understand that most of what they do is probably transparent to the rest of the group – things go smoothly because they’re clearing the road.

For me, a PMI certification in a signature line is a flag that this person could be trouble.  Often, I’m happily surprised when they turn out to be great.  It’s like any other certification – not a substitute for good experience and natural ability.

(I’ll leave software test certifications for a whole other rant.)

March 22, 2009 at 11:11 am Leave a comment

Multiline comments in Ruby.

Maybe the Google failed me, maybe I was just not being observant, but when I first started using Ruby, I could not for the life of me figure out how to make multiline comments.  I had resorted to using lots of # signs, which isn’t especially difficult, but it just felt like there had to be an easier way.

Turns out, there is an easier, although perhaps still a bit clunky, way.  To start a multiline comment put =begin before the first line of comments and =end after the last line.  Note that these commands can not be indented at all, you have to put them at the beginning of the line.

March 17, 2009 at 1:33 am 3 comments

How not to impress your boss.

A couple of years ago, I was the new QA Manager for a small start-up.  There was a mountain of work to do (a complicated app and SMTP protocol to learn, test plans to write and about 50 defects to verify), I was in the process of building a team, I was short on equipment,  the CTO resented the fact that they needed a QA team at all and he hated me from day one.  In short, it sucked to be me and I was super stressed out.

We were crammed into a tiny suite, but a big new space in the same building was being renovated for us to move into.  I mentioned to my boss that I was having a hard time making progress on my to-do list because I was constantly being interrupted.  He said that his office in the new space was finished and I should hide out there until he moved in.  I immediately took him up on the offer and started rounding up my stuff.

In my desk was a bottle of wine I’d received as a birthday gift, but had forgotten to take home.  It was after 5:00 and I knew I was in for the long haul that night, so I decided that a glass or two of wine was warranted.  The only problem was that I didn’t have a corkscrew and couldn’t find one anywhere in the office (strange, because we had happy hours pretty often).

No bottle was going to outsmart me – I wasn’t about to let a silly thing like the lack of the proper tool keep me from enjoying a good Shiraz.  I found an allen wrench on a mostly-assembled IKEA desk and decided that I would just push the cork into the bottle rather than pulling it out.  Genius!

I gently started pushing down on the cork and felt it start to give.  Yippee!  Progress!  Suddenly, the cork gave way entirely and with a whoosh, my bottle of wine was transformed into a fountain.  Everything in a 10-foot radius was splattered with wine drops.  The brand new wooden desk, the freshly-painted walls, the newly-cleaned carpet, my laptop, my notebook, a big stack of documentation, me – all covered with red, red wine.

I didn’t realize I wasn’t the only one there and before I could even catch my breath, the IT Manager poked his head in the office.

“Are you OK?” he asked, stifling a chuckle.

“Uh…nope…not really.” I said as wine dripped off my nose.  “Does this look as bad as I think it does?”

“Yeah – it doesn’t look good.  I’ll help you clean up.”

What a great guy!  He helped me find spot cleaner for the carpet and we took to dabbing up wine from every surface.  After I thanked him, I IM-ed my boss to admit I’d nearly ruined his brand new office.  He laughed, and surprisingly, didn’t kick me out.  There was even some wine left in the bottle.

A couple of weeks later, everyone moved into the new space.  After my boss moved into his office, he marveled that there was no sign of my wine-bombing.  I wanted to take credit for a great clean-up, but all I could do was point to the ceiling.  Even the ceiling tiles had been showered, but we couldn’t get the wine off them.

Not the best mark I’ve made on a company, but it could turn out to be the most lasting…..

March 13, 2009 at 3:51 pm Leave a comment

IRB is your friend.

They say that there’s no such thing as a dumb question, but we’ve all asked questions that we wish we could take back.  That’s why IRB and watir-console are so great when you’re writing Watir tests- you get to try out any command (or even a group of commands) to quickly see if it works without having to ask someone else or run your whole test.  The best part is that, unlike a post to a group, any totally off base attempts are not available for the world to see.

Think of IRB as a buffer for embarrassing questions.  Learn it, use it, love it.

From a command prompt:

C:>irb
irb(main):001:0> require 'watir'
=> true
irb(main):002:0> browser = Watir::Browser.new
=> a bunch of output describing the browser

irb(main):003:0> browser.goto('http://www.google.com')
=> 1.115
irb(main):004:0> browser.text_field(:name, 'q').set('watir information')
=> ""

If I try something that doesn’t work, I get a helpful error message:

irb(main):005:0> browser.text_field(:name, 'qwerty').set('watir information')
=>Watir::Exception::UnknownObjectException: Unable to locate element, using :name, "qwerty"

March 11, 2009 at 4:20 pm Leave a comment

Ouch.

There I was, minding my own business, when one of our senior developers stopped by my cube.

Developer: “You suck.”

Me: “Probably.  How so this time?”

Developer: “Your automated tests missed a problem that I just caught on my machine.”

Me: “OK – let’s try to reproduce it so I can add it to my tests.”

We went through his steps together in the QA environment and found that the problem didn’t happen – everything worked as expected.  Turns out, he hadn’t updated his local source with the latest version from the repository.

Developer: “Oh, I guess I’m the one who sucks.”

I gave him some chocolate to soothe his bruised ego.

March 9, 2009 at 6:29 pm 1 comment

So you want to be a ___________…

If you were asked in high school to fill in the blank, would it be the career you’re working in now?  I’d wager that for most people, it wouldn’t.  Not that that’s a bad thing – after all, the world only needs so many Zamboni drivers and dolphin trainers.  For software test professionals, I’d up the ante and then wager that wouldn’t be the answer for anyone.  I honestly didn’t even know the field existed until I was working in it.

In 1998, I was working as a semiconductor engineer.  The job had been good, despite the lousy salary, but I had been transferred from a great manager to a terrible one.  I decided it was time to move on and went to a tech fair in Boulder with some friends to find a new job.  We were surprised to learn that ‘tech’ really meant ‘software’ – how did we miss that!?!

On the way out, I handed my resume to the VP of Engineering for a software company and apologized for wasting his time.  Apparently, he’d never had someone hand him a resume and tell him that they were wholly unqualified for any position at his company. He took pity on me and made up a position for me that was half software test, half tech pubs.  I seriously hated the tech pubs part of my job, but found I was really good at the software test part.  After a few months, I became the full-time test lead (no more wordsmithing – hooray!).

From the start, I saw that test was an unglamorous, under-appreciated position and dreamed of becoming a developer.  It didn’t matter that my only programming experience was in FORTRAN and BASIC, I wanted to write code like the real engineers.  TheGods.com had other plans for me.

I didn’t have any development experience, so when my company sank under the weight of the CEO’s ego, I took another test job.  And then another, and then another.  As companies kept tanking, I kept moving on to the next QA job.  The good news was that each time I moved, I got a better position with a higher salary.  But I began to realize that the only places that would pay me the salary I was making to be a developer were startups throwing VC around like Rip Taylor with confetti and the government.  I’d worked for the former and saw how long that lasted and I’m just not cut out for bureaucracy.

Finally, it occurred to me that the problem wasn’t with software testing, it was with me.  I longed to do more technical work, but hadn’t really asked for more technical assignments.   I was waiting around for someone to notice that I was smart enough, rather than asking for a chance to prove myself.  Since then, I’ve volunteered for the work that interests me if I see it and asked about it when I don’t.  Often, no one has considered it or had a chance to define it yet and they’re happy to let me work on it.

In the end, I’ve learned that, like most things, software testing is what you make of it.  Now that I’m working mostly with Watir, I get to do more interesting work than many developers working on bug fixes and I have more autonomy than I might have working on an official development team.  A career that I was hoping to move out of has become something of a dream job for me.  If I’d known all this in high school, I just may have put “Software Test Engineer” in the blank (unless I’d also known that there would someday be Mythbusters!)

March 7, 2009 at 7:35 am Leave a comment


Categories

Recent Tweets

Error: Twitter did not respond. Please wait a few minutes and refresh this page.