Learning Capybara, Part 1

Capybara is rapidly becoming the go-to test tool of choice among Rubyists. I will NOT be covering this tool in the context of the Rails platform. A lot of people see the Ruby test ecosystem as existing largely to support Rails and that’s simply not true. It is true that Capybara, in particular, was forged in and around a set of tools that exist largely to support testing Rails applications. What I’ll show you here is any web application can be tested using Capybara.

Continue reading Learning Capybara, Part 1

BDD Specs and Parameterizing Phrases

If you plan on using a BDD tool (like Cucumber, SpecFlow, Behat, etc) you are going to want to have some guidelines for how and to what extent you allow parameterized and conditionalized phrases. This is an area that I’ve found can become a rat’s nest of bad habits unless you establish early on how much and to what extent to use these features.

Continue reading BDD Specs and Parameterizing Phrases

An Introduction to Using Cucumber-JVM

A lot of testers I run into learn Cucumber on Ruby. This tends to be a very easy path since the overhead on a dynamic language like Ruby is generally pretty low. However, some testers need or want to run Cucumber on the Java Virtual Machine. Yes, you can use JRuby to run the Ruby version of Cucumber on the JVM. But you can also use Cucumber-JVM, which is a port of the Ruby version into Java. However, I find many testers have a hard time getting started with it, particularly if they are coming from Ruby. What follows is the tutorial I wanted and either didn’t find or didn’t look hard enough to find.

Continue reading An Introduction to Using Cucumber-JVM

Data Building with Symbiont

In the previous post in data setting, I talked about the start of a data builder pattern. Sometimes it’s nice to have your automation use descriptive phrases that stand in for specific bits of data. So here I’ll describe how Symbiont allows this by adhering to a data builder pattern.

Continue reading Data Building with Symbiont

Symbiont and the Context Factory

In the post on using page objects with Symbiont, the focus was on how Symbiont leverages the page object to allow test scripts to separate intent from implementation. This also allowed for test script logic to be concise in terms of its expression. Here I’m going to focus on how we can get even slightly more concise by adhering to a factory pattern.

Continue reading Symbiont and the Context Factory

Symbiont and the Page Object

In the post on going from Watir to Symbiont, I talked about how Symbiont encourages you to delegate as much as possible to the page definition. The reason for this being that page definitions get turned into page objects, thus allowing your scripts to rely on the page object to handle functionality, rather than having each automated script do so. Here I’ll explore that idea a bit more.

Continue reading Symbiont and the Page Object

From Watir to Symbiont

Encouraged a bit after the fact by a Ruby test framework in 15 minutes, along with my own post on a slimmed down Ruby test framework, and coupled with my Dialect experiment, I reworked an existing framework of mine (Symbiont) from another framework of mine (Fluent). Here I’ll explain how to get started with Symbiont.

Continue reading From Watir to Symbiont

Align Automated Test Language with Development Language?

I pose the title of this post as a question. My focus here is as a tester who sometimes has to work with Java shops that really don’t want to involve their developers with Ruby or some other dynamic language. I, on the other hand, do not want to give up the benefits of a dynamic language when I develop my automated test solutions. Yet I do want to involve the developers in test automation. I don’t want to use JRuby necessarily because it’s really just a complicating element of running Ruby on the JVM. What I want is to utilize the Java platform (the JVM) but look beyond the Java language to languages that are lightweight but also dynamic. Groovy is proving to be that.

Continue reading Align Automated Test Language with Development Language?

Specifying Application Workflow Activities

Lately I’ve been writing a lot of specifications and by that I mean test specifications. And by that I mean the specifications you tend to write in tools like Cucumber, SpecFlow, Lettuce and so on. What’s been interesting is deciding at what level of intent to write at.

Continue reading Specifying Application Workflow Activities

Thinking and Testing with Executable Specs – Part 5

This is the fifth post in my series of using a tool that supports writing executable specifications. If this is the first post in the series you’re reading, then you are also reading the last post in the series. Which means this post will be almost totally meaningless to you. To catch up you can read parts one, two, three, and four. (Whether those make this post less meaningless is then up to you!)

Continue reading Thinking and Testing with Executable Specs – Part 5

Thinking and Testing with Executable Specs – Part 4

This post is the fourth in my series regarding approaching testing when you are using an executable specification type tool. The first, second and third posts are pretty much necessary reading for this one to make any sense to you at all.

Continue reading Thinking and Testing with Executable Specs – Part 4

Thinking and Testing with Executable Specs – Part 3

This post is the third in my series regarding approaching testing when you are using an executable specification type tool. This one will following on directly from the activities done in the first two posts. (I recommend reading part one and part two if you want to follow along, since these really are interconnected threads.)

Continue reading Thinking and Testing with Executable Specs – Part 3

Thinking and Testing with Executable Specs – Part 2

This post is the second in my series regarding approaching testing when you are using an executable specification type tool. Assuming you want to follow along, the first post is fairly critical to understanding how the project is currently set up.

Continue reading Thinking and Testing with Executable Specs – Part 2

Thinking and Testing with Executable Specs – Part 1

I’ve been doing some presentations and training sessions on using tools like Cucumber. What’s interesting about these is that in many cases people have tried to play around with the tool but have conceptual difficulties with figuring out how to get started in terms of making decisions continuing to using the tool.

As a tester, when introducing yourself to this area of practice, you might read that You’re Cuking It Wrong or that You’re Cuking It Right. It still may not be clear which you are doing. You might read about being imperative versus declarative and wonder which is for you. (Can’t I do both?) You might even come to the conclusion that Cucumber sucks.

Continue reading Thinking and Testing with Executable Specs – Part 1

Starting to Tame Capybara

Capybara is one of those open source testing tools that, when you get to use it, is really nice. However, it’s new enough (or, at least, changing enough) that good documentation on it is a bit sparse when your goal is simply to get started and you don’t have a lot of supporting frameworks in place. Case in point: what if I want to test against a browser that’s displaying my web application? I’m not using Rails. I have no other automated test frameworks in place. I just need to get started as quick as possible to determine if this tool will do what I need.

I’ll show you how I started out here.

Continue reading Starting to Tame Capybara

Action Sets in QTP

Assume you have some data that tells your scripts how to function when they run a particular set of actions. Instead of this logic being stored in a test script, common action sets are stored off in a data source. In this case, I’ll use Excel but you can use any data source at all. One thing I’ve found fairly effective in terms of an approach here is to create a class that contains the methods for building a dictionary that will essentially bring in the “action sets.” Here an action set refers to the data plus the test actions to take with that data against the application.

Continue reading Action Sets in QTP

An Extended Parameters Mechanism for Procedures in QTP

A problem with VBScript is that it doesn’t allow you to have optional parameters in your procedures. This also means you can’t do function overloading. There are various ways to deal with this but many of them can lead to a maintenance problem and require you to change how your new (“extended”) procedures are called. Ideally, you don’t want to have to change how the function is called each time you extend it. So let’s look at a few ideas here.

Continue reading An Extended Parameters Mechanism for Procedures in QTP