Cucumber - A testing tool?



A lot of test engineers in India do not know or have never even heard of a tool called cucumber, Jbehave is the alternative tool being used but not in big numbers. So for all my fellow testers here is an update on what is cucumber and why do we use it and where does it fit in the testing world ?

Cucumber is a tool for running automated acceptance tests written in a behavior driven development (BDD) style.
  • Cucumber is Aslak Helles√ły’s rewrite of RSpec’s “Story runner”, which was originally written by Dan North.
  • written in the Ruby programming language
  • The language that Cucumber understands is called Gherkin
  • Cucumber was the second most popular testing framework after RSpec in the Ruby Toolbox.
  • Best website to refer - http://cukes.info/
  • The text is written in a business-readable domain-specific language and serves as documentation, automated tests and development-aid - all rolled into one format.
  • While Cucumber can be thought of as a “testing” tool, the intent of the tool is to support BDD
  • Cucumber works with Ruby, Java, .NET, Flex or web applications written in any language
  • Translated in close to 40 spoken languages
  • Cucumber also supports more succinct tests in tables - similar to what FIT does

To use Cucumber :
  1. You need Ruby installed.
  2. Then just run  gem install cucumber from a command prompt.
  3. Now, run cucumber --help
  4. The user describes the behavior of the system with natural language with some specific keywords
  5. The process starts with creating a feature file, which explains a feature of the system and some scenarios of different test situations.
  6. As Cucumber doesn’t know how to interpret the features by itself, the next step is to create step definitions explaining it what to do when finding that step in one of the scenarios.
  7. The step definitions are written in Ruby.
  8. It can use and already has step definitions for Webrat, an acceptance testing tool for Ruby, which simulates a browser without Javascript support. But it can also be combined with a web automation framework like webdriver / waitir.
Best place for tutorials:
  1. Wiki - https://github.com/cucumber/cucumber/wiki
  2. https://github.com/cucumber/cucumber/wiki/tutorials-and-related-blog-posts
  3. Some good sites for starters:
    1. http://blog.spritecloud.com/2010/03/web-testing-with-cucumber/
    2. http://cuke4ninja.com/sec_why_cucumber.html

Comments

  1. Hi.. william . thanks for sharing a information on testingtools

    ReplyDelete
    Replies
    1. Thanks, Glad that helped!

      Delete
  2. SInce early 2012 there is also Cucumber-JVM - an implementation that runs natively on the JVM.

    There's also Behat (for PHP), Cucumber.js and SpecFlow (for .NET) among others.

    ReplyDelete
  3. When I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and now whenever a comment is added I receive 4 emails with the same comment. Is there a means you are able to remove me from that service? Thanks!
    Hadoop Online Training

    ReplyDelete

Post a Comment

Popular posts from this blog

Website's underlying technology for automation

XPATH for IE / internet explorer

All time good software testing books!