Platinum Partner
groovy,bdd easyb selenium groovy

Behavior driven development: Generating Groovy EasyB Story with Selenium IDE

Are you an easyb user which would like to create story that run selenium's commands? You can let's Selenium IDE generate it for you instead of code it by your hand.

I try to google selenium and easyb, I couldn't found format of Selenium IDE to generate easyb story. So, I decided to create one myself for automated testing of grails project.

Below is the code generated for scenario of google search for "hello world" for your reference:

import com.thoughtworks.selenium.*
import java.util.regex.Pattern

before "start selenium", {
given "selenium is up and running", {
selenium = new DefaultSelenium("localhost",
4444, "*firefox", "http://www.google.com.my/")
selenium.start()
}
}

scenario "Enter scenario description here", {
then "Enter any description here", {
selenium.open("/")
selenium.getTitle().shouldBeEqualTo "Google"
selenium.type("q", "hello world")
selenium.click("btnG")
selenium.waitForPageToLoad("30000")
selenium.getTitle().shouldBeEqualTo "hello world - Google Search"
}
}

after "stop selenium", {
then "selenium should be shutdown", {
selenium.stop()
}
}

You can find out more information from the URL below:

http://limcheekin.blogspot.com/2009/07/behavior-driven-development-generating.html

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}