How to selectively run, in jBehave, stories tagged with multiple words in a meta field.

1) a working jBehave based project
This short tutorial is based on an jbehave-tutorial project available on github:
To be precise I used the “java-spring” submodule from the “etsy-selenium” module, available here:, to run the modified story presented below.
2) Maven

OK, let’s consider a situation when we have stories belonging to multiple features, categories etc.
Below is an example story, tagged with multiple categories and features:


@categories category1 category2 category3
@features feature1 feature2 feature3 feature_4

Scenario: scenario description
Given I'm on the homepage

Now, we’d like to run stories only for a selected category or a feature.
To accomplish this we’ll use the value pattern matching mechanism implemented in the jBehave meta matcher and described here.

Run stories covering only category3:

mvn clean install -Dmeta.filter="+categories *category3*"

Run stories covering only feature_4:

mvn clean install -Dmeta.filter="+features *feature_4*"

And finally, run stories matching feature2 and category1:

mvn clean install -Dmeta.filter="+features *feature2* +categories *category1*"

It seems that jBehave is not handling “-” hyphens in the keyword value properly, but it works fine with “_” underscores, separate words and camelCase notation 🙂

Replacing FF driver with Chrome in JBehave’s tutorial project

Hi All,

Recently I’ve started playing with JBehave or rather with their interesting extension JBehave-web

JBehave-Web is a collection of extension for JBehave that extend its capabilities in ways related to HTTP and the web.

As a starting point I tried running an example project available here:
After getting bored with running all the tests in FF, I’ve decided to replace it with Chrome. Below is the short tut. describing how to do that 🙂

Steps to get you there:

  1. Download chrome driver
  2. Change the webDriver to a PropertyWebDriverProvider
  3. Set System Properties

Step 1)
Download chrome driver that suits your needs:
Extract it wherever you want.

Step 2)
Change the webDriver from FirefoxWebDriverProvider to a PropertyWebDriverProvider that allows running your tests with Google Chrome.
Edit etsy-steps.xml located […]/jbehave-tutorial/etsy-stories-java-spring/src/main/resources/etsy-steps.xml
and replace a FirefoxWebDriverProvider bean with a PropertyWebDriverProvider:

<bean id="driverProvider" class="org.jbehave.web.selenium.PropertyWebDriverProvider" >

Step 3)
To set System Properties, edit Maven’s etsy-stories-java-spring module config file: […]/jbehave-tutorial/etsy-stories-java-spring/pom.xml
Follow this xpath to add the new props in the right place:

/pom:project pom:build/pom:plugins/pom:plugin/ pom:executions/pom:execution[2]/pom:configuration


ps. in case you’ll encounter problems solving all the dependencies while running the demo project, just add repos listed below to your main project Maven config file: ([…]/jbehave-tutorial/pom.xml)

      <name>jbehave web repo</name>

      <name>Codehaus Snapshots</name>