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.

Marking tests as skipped in TestNG

Marking tests as skipped in TestNG is not very obvious. In fact, most people use the @Test annotation with the “disabled” option, but that is not the same as skipping.

In order to skip a test effectively, throwing the exception within @Test doesn’t work, and neither did throwing it in @BeforeTest, while I am using parallel by classes. If you do that, the exception will break the test setup and your TestNG report will show exceptions within all of the related @Configuration methods and may even cause subsequent tests to fail without being skipped.

On the other hand, when I throw it within @BeforeMethod, it works perfectly. Glad I was able to figure it out. The documentation of the class implies this vaguely, but I had to study it before it would reveal itself.

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