How to add a jGrowl wrapper to your Selenium framework.

This all started because I have a Macintosh computer at home. I always got this nagging “growl” message in the upper right hand side of the screen and when I search google for this I found the jGrowl website. Since I am not only a quality assurance software developer, I usually experiment with web development technologies to improve my understanding of how websites work, and so I did. In the process of doing this I thought it would be nice to show messages like this in my browser as a test is running. At first this was just an idea, which I handed off to Dave Haeffner, but when I started keeping videos of my Selenium tests on SauceLabs, it became clear that this kind of logging can really help when watching a recorded video that had logged messages like this.

And so a new project was born. On my GitHub account you can find a project called jquery-growl-selenium-example and henceforth are some bits about how it works.

First, I had to create an event wrapper using Selenium’s AbstractWebDriverEventListener class.

Then, the actual test needs to generate an EventFiringWebDriver and register the above listener.

Using Java for a recursive Fibonacci sequence calculation.

Fibonacci sequence is: f(n) = f(n – 1) – f(n – 2)

Here is the Fibonacci sequence calculated in Java.

Take DB snapshots using Schemacrawler with Oracle from a Windows batch script

I created an example of using Schemacrawler with Oracle from a Windows batch script. I stored the code in a Gist at this location, but here is the basic script.

JMeter WebDriver sampler example.

Here is some sample code for a JMeter WebDriver sampler example.

Example of a DOS do-for loop

A neat example of a DOS do-for loop. You wont find an example like this very often:

Selecting parent or child element with Selenium cssSelector

A cssSelector can be used for locating dynamically changing elements.

css = a[title='textA']

If some part of your id remains constant,for instance,in your case if id47 changes to id48 or id200 and so on, you can use contains (i.e. *) or starts with (i.e. ^) :

css = a[id*='id'][title='textA']
css = a[id^='id'][title='textA']
For span (textB),the following would work :
css = span.icon + span
Here + is used to locate following sibling.

Using the cssParentSelector project, you can select a parent from the following XHTML example:

You can also select that when the input is active and show it:
.input-wrap! .help > input[type=text]:focus { display: block; }

Address handler class for unit testing with Java.

I created a address handler class for unit testing with Java. This is my own version but you could adjust it for your own purposes.

I am a 'QA Engineer' since 1997 & 'Software Development Engineer in Test (SDET)' since 2008