Skip to content
Modus-Logo-Long-BlackCreated with Sketch.
  • Services
  • About
  • Blog
  • Partners
  • Work
  • Insights
  • Careers
  • Contact
Modus-Logo-Long-BlackCreated with Sketch.
  • Services
  • About
  • Blog
  • Partners
  • Work
  • Insights
  • Careers
  • Contact
November 12, 2015

Automated testing with Cucumber and Watir-Webdriver

Application Development, DevOps, Quality Assurance

At Modus Create, we heavily rely on test automation tools to run regression tests and make our client’s products better. We use a mixture of open source tools such as cucumber, selenium webdriver, watirwebdriver, jmeter and protractor.

For the last couple of years we have been using cucumber and watir-webdriver to build robust test automation suites. We believe that contributing to the open source community is vitally important, so we made the test harness public to benefit the community.

https://github.com/ModusCreateOrg/cucumber-watir

Implementing this test suite is very easy. To get started, clone the repo and follow steps in the readme file to install all the dependencies. On Linux or Mac OS X, this is a pretty simple matter. On Windows, it can be more challenging, so we have assembled a set of precompiled and preassembled binaries that can make this easier. Then run the rake all command to run all tests.

We also have a detailed post on how to integrate this in Jenkins.

To add new tests, follow along with this screencast:

 

Automation Testing with Cucumber & Watir-Webdriver from Modus Create on Vimeo.

 

Steps to add a new feature file

Create a new file under the feature folder named search.feature and copy the following code:

Feature: Search
  In order to make sure that the search feature is working
  As a user I will search for a search term and expect to see valid results

@desktop
Scenario: search for modus create
  Given I am on the duckduckgo home page
  Then I must see the page title "DuckDuckGo"
  Given I fill in the text field "q" with "Modus Create"
  And I click the "S" button
  Then I must see the page title "Modus Create at DuckDuckGo"

Add the URL to the urls.rb file just before the else statement:

when /the duckduckgo home page/i
       base_url="http://duckduckgo.com"

Run the new test:

cucumber features/search.feature

The big benefit of starting with this cucumber test suite is that you don’t have to create all of the features and step definitions from scratch; the set of built-in features and step definitions are inspired by real-world tests from projects that we have completed over the course of several years. By adapting these steps you can reduce the effort needed when testing user-interface heavy projects.

We would love to help you build a full suite of regression tests using this test harness. We also have other useful tools located at labs.moduscreate.com. Give this a whirl and let us know what you think!

Posted in Application Development, DevOps, Quality Assurance
Share this

Bharath Khambadkone

Bharath Khambadkone loves to automate and break systems by writing automated functional and performance tests. His favourite test frameworks/tools are cucumber, watir-webdriver, selenium, and JMeter. When Bharath is away from the keyboard he loves to spend time with family, hit the links, and aspires to be a Champions Tour Player. During his time with Modus Create, Bharath was a Sr. QA/DevOps Engineer.
Follow

Related Posts

  • End-to-end Tests Using Watir Webdriver
    End-to-end Tests Using Watir Webdriver

    Functional automated testing tools have come a long way since the days of winrunner, quick…

  • Jmeter for Performance Testing
    Jmeter for Performance Testing

    We all agree how important functional automated testing is, however not many applications go through…

Subscribe to the Modus Newsletter

Receive the latest insights from our team each month.

modus create logo_white
  • Services
  • About
  • Partners
  • Work
  • Insights
  • Careers

© 2023 Modus. All Rights Reserved.

Privacy Policy | Accessibility Statement | Sitemap

Scroll To Top