SlideShare a Scribd company logo
1 of 29
Download to read offline
W15
Test Automation
5/7/2014 3:00:00 PM
Implementing Testing for
Behavior-Driven Development
Using Cucumber
Presented by:
Max Saperstone
Coveros
Brought to you by:
340 Corporate Way, Suite 300, Orange Park, FL 32073
888-268-8770 ∙ 904-278-0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com
Max Saperstone
Coveros
For almost a decade, Max Saperstone has been a test engineer focusing on test automation
and the continuous integration/continuous delivery process. Max specializes in open source
tools-Selenium, JMeter, AutoIT, Cucumber, and Chef. He has led several testing automation
efforts, including developing an automated suite focused on web-based software to operate
over several applications. Max also headed a major project developing an automated testing
structure to run Cucumber tests over multiple test interfaces and environments, while
developing a system to keep test data “ageless.” He is currently developing a new testing
architecture for SecureCI to allow testing of multiple interfaces, custom reporting, and minimal
test upkeep.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Implementing Effective Testing
for Behavior Driven Development
using Cucumber-JVM
STAREAST 2014
© Copyright 2010 Coveros, Inc.. All rights reserved.
Max Saperstone has been working as a Software and Test Engineer for almost a
decade, with a focus on Test Automation and the CI/CD process. He specializes
in open source tools, including the Selenium Tool Suite, JMeter, AutoIT,
Cucumber, and Chef. Max has lead several testing automation efforts, including
developing an automated suite focusing on web-based software to operate over
several applications for Kronos Federal. He also headed a project with Delta
Dental, developing an automated testing structure to run Cucumber tests over
multiple test interfaces and environments, while also developing a system to keep
test data 'ageless.' He recently released a new testing architecture for SecureCI™
to allow testing of multiple interfaces, custom reporting, and minimal test upkeep.
He is currently engaged in CI/CD work, working to create full automated delivery
using open source tools including Jenkins, SonarQube, and Nexus.
Max Saperstone
© Copyright 2010 Coveros, Inc.. All rights reserved.
• Coveros helps organizations accelerate the delivery of secure, reliable
software
• Our consulting services:
– Agile software development
– Mobile application development
– Application security
– Software quality assurance
– Software process improvement
• Our key markets:
– Financial services
– Healthcare
– Defense
– Critical Infrastructure
About Coveros
Corporate Partners
© Copyright 2010 Coveros, Inc.. All rights reserved.
Agenda
• Cucumber Overview
– What is Cucumber
– Gherkin
– Glue Code
• Java Implementation
– Cucumber Structure
– Recommended Structure
– Data Models
– Functionality
• Execution
– Ant
– Results
© Copyright 2010 Coveros, Inc.. All rights reserved.
Cucumber Basics
© Copyright 2010 Coveros, Inc.. All rights reserved.
Introduction
• Cucumber is a tool that supports Behavior Driven
Development, BDD.
• Cucumber and BDD is not about testing GUIs. It is about
systems behavior.
• To write tests, specify the properties you want a system to
have.
• You don’t know, and should not care, about the
implementation when you define your features.
© Copyright 2010 Coveros, Inc.. All rights reserved.
How to Write Tests
• The whole point of BDD is that it is vitally important to write
each test/feature step
– one at a time
– with a domain expert
– in plain language
• The use of plain language in the feature file is crucial to
successful use of Cucumber
• State the result that you wish to obtain while avoiding
specifying how you expect to get it
© Copyright 2010 Coveros, Inc.. All rights reserved.
Basic Setup
• The most basic Cucumber-jvm setup includes 3 files
– Generic Test Runner
– Feature File
– Test Implementation
• The Test Runner is the actual file to execute within your
IDE, and by default runs as a JUnit test
• The Feature Files are what contain all of the human
readable tests
• The Test Implementation file will contain all of our
implementations for our tests
© Copyright 2010 Coveros, Inc.. All rights reserved.
Gherkin
© Copyright 2010 Coveros, Inc.. All rights reserved.
Gherkin
• Gherkin is a business readable, domain specific language
that lets you describe software’s behaviour
• A Feature is a set of functionality - think Test Suite
• A single Feature is typically contained in its own file (ending
in .feature)
• Features are typically composed of multiple Scenarios
• A Scenario is a block of statements that describe some
desired behavior
• A Scenario Outline is a block of statements that gets
repeated over a set of data
• Scenarios specify What and should avoid answering the
question How
© Copyright 2010 Coveros, Inc.. All rights reserved.
How to write Scenarios
• A scenario statement - step - consists of three parts:
• Given – the preconditions of the system under test. The
setup of the systems state if you want. For our tests, we
indicate (if desired) which interface we want to test.
• When – the actual change of the system. Transforming it
from the initial state to the final state.
• Then – the expected final state of the system. The
verification that the state change was the desired change.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Example Feature File
Feature: Testing for login page
Scenario: Login without password
Given I want to use the browser Firefox
When I provide username testuser1
And I login
Then I see the login error message "Please provide a password."
And I am on the login page
Scenario: Login without username
Given I want to use the browser Firefox
When I provide testuser1
And I login
Then I see the login error message "Please provide a username."
And I am on the login page
© Copyright 2010 Coveros, Inc.. All rights reserved.
How to Write Tests (example)
• For example, for a login scenario you should write:
• And not:
• You should concern yourself with what has to happen and
not how you expect it to happen.
When I login as USER1 to CosmicComix
When I visit www.cosiccomix.com
And I click on the login button
When I enter USER1 in the username field
And I click the continue button
And I click the login button
© Copyright 2010 Coveros, Inc.. All rights reserved.
Feature and Scenario File Tips
• Scenario Outlines can contain multiple variable types
– Doc Strings
– Data Tables
– Data Table Diffing
• Often times when writing multiple scenarios you see
repeated test steps
• Initial similar test steps can be moved out into Background
• These steps get executed before every scenario
– List of Maps/Scalars/Lists
– Data Table Transformation
– String Transformations
© Copyright 2010 Coveros, Inc.. All rights reserved.
What was once...
Feature: Testing for login page
Scenario: Login without password
Given I want to use the browser Firefox
When I provide username testuser1
And I login
Then I see the login error message "Please provide a password."
And I am on the login page
Scenario: Login without username
Given I want to use the browser Firefox
When I provide testuser1
And I login
Then I see the login error message "Please provide a username."
And I am on the login page
© Copyright 2010 Coveros, Inc.. All rights reserved.
Can become...
Feature: Testing for login page
Background
Given I want to use the browser Firefox
Scenario: Login without password
When I set the username to testuser1
And I login to CosmicComix
Then I see the login error message "Please provide a password."
And I am on the login page
Scenario: Login without username
When I set the password to testuser1
And I login to CosmicComix
Then I see the login error message "Please provide a username."
And I am on the login page
© Copyright 2010 Coveros, Inc.. All rights reserved.
Tagging
© Copyright 2010 Coveros, Inc.. All rights reserved.
Tagging Basics
• Cucumber provides a simple method to organize features
and scenarios by user determined classifications.
• This is implemented using the convention that any space
delimited string found in a feature file that is prefaced with
the commercial at (@) symbol is considered a tag.
• Any string may be used as a tag and any scenario or entire
feature can have multiple tags associated with it.
• Be aware that tags are heritable within Feature files.
– Scenarios inherit tags from the Feature statement.
– Examples inherit tags from the Feature and Scenario statements.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Tagging Examples
@CCOrg @CCNet
Feature: Testing for login page
Scenario Outline: Bad login
Given I want to use the browser Firefox
When I set the username to [username]
When I set the password to [password]
When I login to CosmicComix
Then I see the error message "[message]"
And I am on the login page
@Regression
Examples:
| username | password | message |
| testuser1 | | Please provide a password. |
| | testuser1 | Please provide a username. |
| testuser | testuser | That username does not match anything in our records.
| testuser1 | testuser2 | The password provided does not match the username enter
© Copyright 2010 Coveros, Inc.. All rights reserved.
Step Definitions/Glue Code
© Copyright 2010 Coveros, Inc.. All rights reserved.
Cucumber Implementation
• Cucumber searches the classpath provided in the runner to
find any methods annotated with regular expressions that
will match each Given/When/Then part of the feature
• There must only be one method, step, which matches the
regular expression in the classpath
• If you have described two different parts of the system with
the exact same wording, then you have an issue with
ambiguity
© Copyright 2010 Coveros, Inc.. All rights reserved.
Step Definition Best Practices
• The matcher is not overly verbose.
• The matcher handles both positive and negative (true and
false) conditions.
• The matcher has at most two value parameters
• The parameter variables are clearly named
• The body is less than fifteen lines of code
• The body does not call other steps
© Copyright 2010 Coveros, Inc.. All rights reserved.
Step Definition Basics
• When you put part of a regular expression in parentheses,
whatever it matches gets captured for use later.
– This is known as a “capture group.”
• In Cucumber, captured strings become step definition
parameters.
– Typically, if you’re using a wildcard, you probably want to capture
the matching value for use in your step definition.
Given("^I'm logged in as an? (.*)$")
public void ImLoggedInAsA(String role) {
// log in as the given role
}
• If your step is Given I'm logged in as an admin, then the
step definition gets passed "admin" for role.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Capturing and not capturing
• Cucumber converts captured strings to the step definition
parameter type
• Sometimes, you have to use parentheses to get a regular
expression to work, but you don’t want to capture the
match.
• For example, suppose I want to be able to match
both When I log in as an admin and Given I'm logged in as
an admin.
• Both step definitions do the same thing, there is no reason
to have duplicated automation code
When("^(I'm logged|I log) in as an? (.*)$")
public void LogInAs(string role) {
// log in as the given role
}
© Copyright 2010 Coveros, Inc.. All rights reserved.
Capturing and not capturing (cont.)
• My regular expression is capturing two strings, but my step
definition method only takes one.
• I need to designate the first group as non-capturing like this:
When("^(?:I'm logged|I log) in as an? (.*)$")]
public void LogInAs(string role) {
// log in as the given role
}
• Now, with the addition of ?: at the beginning of the group, it
will perform as expected
• As mentioned previously, a multitude of object types can be
provided, and if expected in (.*) will be automatically parsed
© Copyright 2010 Coveros, Inc.. All rights reserved.
Hooks
© Copyright 2010 Coveros, Inc.. All rights reserved.
Hooks Overview
• Hooks allow us to perform actions at various points in the
cucumber test cycle
• Before hooks will be run before the first step of each
scenario.
• After hooks will be run after the last step of each scenario,
even when there are failing, undefined, pending or skipped
steps.
• Scenario Hooks
– Similar to JUnit @Before and @After run with each scenario
– Placing common functionality in these reduces the number of test
steps in each scenario
© Copyright 2010 Coveros, Inc.. All rights reserved.
Hooks Overview
• Tagged Hooks
– We can also indicate that @Before and @After only run with
scenarios with certain tags
e.x. @Before('@web') for tests needing a browser launched
– Tagged hooks can have multiple tags, and follow similar tagging
AND/OR rules that the runner does
e.x. @Before('@CCOrg, @CCNet) would run before scenarios
tagged with @CCOrg OR @CCNet
e.x. @Before('@CCOrg', '~@CCNet') would run before scenarios
tagged with @CCOrg AND NOT @CCNet
• Global Hooks
– Cucumber doesn’t support global hooks, however, hacks are
possible
© Copyright 2010 Coveros, Inc.. All rights reserved.
Sample Code
@Before //performed before anything is done
public void setup() {
if ( webEls == null ) {
webEls = new LoadElements( xmlFiles );
//set our database
if( System.getProperty( "dataenvironment" ) != null ) {
database = Databases.valueOf( System.getProperty(
"dataenvironment" ).substring(1) );
}
}
tests.clear();
tests.add( database.getValidTestingInterfaces() );
}
@Before('@ExternalWebsite') //performed before each web scenario
public void externalWebsite() {
tests.add( new ExternalWebsite( webEls, Browsers.Firefox ) );
}
© Copyright 2010 Coveros, Inc.. All rights reserved.
Java Structure
© Copyright 2010 Coveros, Inc.. All rights reserved.
Test Architecture
Gherkin Glue Model Implementation Functionality
© Copyright 2010 Coveros, Inc.. All rights reserved.
Definition Structure
Test Runner
cucumber parameters
Test Base
initializes test inputs
Test Setup
parses
cucumber
parameters and
sets test inputs
Login
Definitions
Library
Definitions
Help
Definitions
extends
© Copyright 2010 Coveros, Inc.. All rights reserved.
Data Modeling
© Copyright 2010 Coveros, Inc.. All rights reserved.
Java Implementation
• Drive the initial implementation from the steps. As it looks
now I will need
– Potential Interface selector
– A place to store user information
▪ Username
▪ Password
– A method to submit the information
– A method to check the page
– A method to check the message
• Before I start implementing the model, I want to implement
the steps that will verify the model.
• Start with an implementation of the steps like this...
© Copyright 2010 Coveros, Inc.. All rights reserved.
//type in our username
@When("^I set the username to (.*)$")
public void setUsername(String user) throws Exception {
user.setUsername( user );
}
//type in our password
@When("^I set the password to (.*)$")
public void setPassword(String password) throws Exception {
user.setPassword( password );
}
//click the login button
@When("^I login to CosmicComix$")
public void login() throws Exception {
login.login( user );
}
//check our message
@Then("^I see the login error message "(.*)"$")
public void checkLoginErrorMessage(String errorMessage) throws Exception {
login.checkLoginErrorMessage( errorMessage );
}
//check our page
@Then("^I am on the (.*) page$")
public void checkPage(Pages page) throws Exception {
login.checkPage( page );
}
Java Implementation - Code
© Copyright 2010 Coveros, Inc.. All rights reserved.
Data Modeling
• Once all of the test steps have been implemented, data
models should be created to encapsulate all needed fields
• Based on our above examples, we’ll need a User object
which will contain:
– Username
– Password
–
public class User {
private String user;
private String password;
public void setUser( String user ) { this.user = user; }
public void setPassword( String password ) { this.password = password; }
public String getUser() { return user; }
public String getPassword() { return password; }
}
© Copyright 2010 Coveros, Inc.. All rights reserved.
Exercising Functionality
© Copyright 2010 Coveros, Inc.. All rights reserved.
Functionality
• The functionality should be broken down into two distinct
‘layers’
– Base calls (e.g. Selenium, ODBC, HTTP)
– Implementation of workflow
• All of the static calls to external services are defined and
can remain unmodified as workflow and application
functionality changes
• These calls can also automatically log all data being passed
to and from the services to provide a more seamless
logging
© Copyright 2010 Coveros, Inc.. All rights reserved.
Implementation
• The workflow of the application (the how) is all contained in
the abstract class forming the implementation
• One class should be written to contain all workflows (each
as a method) expected from the application
– Login
– Help
– Library
• Some methods can be defined at this level, however any
that are interface specific should be left as abstract to be
defined by the extending class
© Copyright 2010 Coveros, Inc.. All rights reserved.
Base Class
public abstract class TestStructure {
protected WebDriver driver; //this is our selenium webdriver controlling our browse
protected SeleniumWebdriver selenium; //this is our selenium instance
private ArrayList<Object> call = new ArrayList<Object>(); //this is the call being made
private ArrayList<Object> response = new ArrayList<Object>(); //this is the response from th
private ArrayList<Object> actions = new ArrayList<Object>(); //this is all of the responses from
protected final String appURL = "http://cosmiccomix.net"; //the url of our application
public abstract void setDriver() throws InvalidBrowserException;
public abstract void unsetDriver();
public SeleniumWebdriver getSelenium() {
return selenium;
}
public WebDriver getDriver() {
return driver;
}
public abstract void login(User user);
public void checkPage(Pages page) {
if ( selenium == null )
throw new InvalidTestInterfaceException();
selenium.getTitle();
}
}
© Copyright 2010 Coveros, Inc.. All rights reserved.
public class ExternalWebsite extends TestStructure {
private LoadElements webEls;
private Browsers browser;
private String subDomain;
public ExternalWebsite(LoadElements webEls, Browsers browser, String subDomain) {
this.webEls = webEls;
this.browser = browser;
this.subDomain = subDomain;
}
@Override
public void setDriver() throws InvalidBrowserException {
selenium = new SeleniumWebdriver(this, webEls, browser);
driver = selenium.getDriver();
}
@Override
public void unsetDriver() {
if ( selenium != null ) {
selenium.killDriver();
}
}
@Override
public HashMap<Products,QuoteResult> login(User user) {
//navigate to our URL
selenium.goToURL( "http://" + subDomain + ".cosmiccomix.com/" );
selenium.type( "username", user.getUser() );
selenium.type( "password", user.getPassword() );
selenium.submit( "login" );
External Web Class
© Copyright 2010 Coveros, Inc.. All rights reserved.
External Website Class
© Copyright 2010 Coveros, Inc.. All rights reserved.
Executing Tests
© Copyright 2010 Coveros, Inc.. All rights reserved.
• Cucumber can currently be executed using two different
methods.
– A command line tool
– A JUnit runner
• Connecting through JUnit with a runner such as Ant can
make it a seamless part of a project developed using tests.
• Multiple inputs can be set, which can be overridden by
values in the build.xml script
Executing Tests
package comix.cosmic.definitions;
@RunWith(Cucumber.class)
@Cucumber.Options(
features = "comix/cosmic/features/",
glue = "comix.cosmic.definitions",
format = {"pretty", "html:target/cucumber-html-report", "json-pretty:target/cucumber-report.json"},
tags = {"@Smoke"}
)
public class TestRunner{
}
© Copyright 2010 Coveros, Inc.. All rights reserved.
Test Inputs (cont.)
• Additionally, Java system environments can also be set
from the Ant script to create a more dynamic testing
scenario.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Interpreting Results
© Copyright 2010 Coveros, Inc.. All rights reserved.
General Results
• Upon completion, test results will be available in the project
directory under a folder labeled target.
• Navigate to the folder labeled cucumber-html-report and
open the index.html file.
• This file will show your results.
• There are four different stylings for the results.
– Unimplemented
– Failed
– Skipped
– Passed
© Copyright 2010 Coveros, Inc.. All rights reserved.
Unimplemented Steps
• The test step was not properly implemented and therefore
could not be run.
• These will appear yellow in the cucumber HTML results
• If run directly as a JUnit test, the output will offer
suggestions on how to implement the missing steps
• Once all these test steps are completed re-run the tests,
and re-check for problem areas.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Failing Steps
• These are steps where an exception was thrown (either via
asserts, or Java exceptions).
• The next step is to examine these test steps.
• There are also several possibilities for a bad test steps.
– The test code may not be waiting properly for a return
– The code may be checking a bad field
– The internal call may have changed
– The input data may be bad
– The expected output may have changed.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Getting to Green
• After all of these un-implemented and failed test steps are
fixed, and the tests are re-run, the skipped (blue) test steps
should resolve themselves.
© Copyright 2010 Coveros, Inc.. All rights reserved.
Debugging Tests
© Copyright 2010 Coveros, Inc.. All rights reserved.
Debugging Options
• Missing Locators
– Selenium IDE
– xPather
– Firebug
– WebDriver Element Locator
• Failing Test Steps
– Input/Output Validation
– Change of workflow
– Change of design
• Thrown Exceptions
– Eclipse debugging mode
▪ Breakpoints
▪ System output
© Copyright 2010 Coveros, Inc.. All rights reserved.
Questions

More Related Content

What's hot

A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...Ho Chi Minh City Software Testing Club
 
Behavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with BehatBehavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with Behatimoneytech
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /CapybaraShraddhaSF
 
Testing Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and SeleniumTesting Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and SeleniumChris Johnson
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testingdversaci
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunSQABD
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVMAlan Parkinson
 
BDD in Java using Cucumber
BDD in Java using CucumberBDD in Java using Cucumber
BDD in Java using Cucumberslavkurochkin
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011dimakovalenko
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With CucumberSean Cribbs
 
Web automation in BDD
Web automation in BDDWeb automation in BDD
Web automation in BDDSandy Yu
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsLeticia Rss
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
BDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web ApplicationsBDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web ApplicationsPatrick Viafore
 
Cucumber Ru09 Web
Cucumber Ru09 WebCucumber Ru09 Web
Cucumber Ru09 WebJoseph Wilk
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingViget Labs
 
Outside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecJoseph Wilk
 

What's hot (20)

A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
 
Behavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with BehatBehavior Driven Development - How To Start with Behat
Behavior Driven Development - How To Start with Behat
 
BDD / cucumber /Capybara
BDD / cucumber /CapybaraBDD / cucumber /Capybara
BDD / cucumber /Capybara
 
Testing Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and SeleniumTesting Any Site With Cucumber and Selenium
Testing Any Site With Cucumber and Selenium
 
Behavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile TestingBehavior Driven Development (BDD) and Agile Testing
Behavior Driven Development (BDD) and Agile Testing
 
CUCUMBER - Making BDD Fun
CUCUMBER - Making BDD FunCUCUMBER - Making BDD Fun
CUCUMBER - Making BDD Fun
 
Test automation with Cucumber-JVM
Test automation with Cucumber-JVMTest automation with Cucumber-JVM
Test automation with Cucumber-JVM
 
BDD in Java using Cucumber
BDD in Java using CucumberBDD in Java using Cucumber
BDD in Java using Cucumber
 
Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)Behavior Driven Development Testing (BDD)
Behavior Driven Development Testing (BDD)
 
Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011Selenium and Cucumber Selenium Conf 2011
Selenium and Cucumber Selenium Conf 2011
 
Story Driven Development With Cucumber
Story Driven Development With CucumberStory Driven Development With Cucumber
Story Driven Development With Cucumber
 
Web automation in BDD
Web automation in BDDWeb automation in BDD
Web automation in BDD
 
Writing automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjectsWriting automation tests with python selenium behave pageobjects
Writing automation tests with python selenium behave pageobjects
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
BDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web ApplicationsBDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
BDD to the Bone: Using Behave and Selenium to Test-Drive Web Applications
 
Cucumber Ru09 Web
Cucumber Ru09 WebCucumber Ru09 Web
Cucumber Ru09 Web
 
BDD, Behat & Drupal
BDD, Behat & DrupalBDD, Behat & Drupal
BDD, Behat & Drupal
 
Make Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance TestingMake Everyone a Tester: Natural Language Acceptance Testing
Make Everyone a Tester: Natural Language Acceptance Testing
 
Outside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and RspecOutside-in Development with Cucumber and Rspec
Outside-in Development with Cucumber and Rspec
 
Cqrs api
Cqrs apiCqrs api
Cqrs api
 

Similar to Implementing Testing for Behavior-Driven Development Using Cucumber

Executing Parallel Test Sessions with TestNG and Selenium WebDriver
Executing Parallel Test Sessions with TestNG and Selenium WebDriverExecuting Parallel Test Sessions with TestNG and Selenium WebDriver
Executing Parallel Test Sessions with TestNG and Selenium WebDriverpCloudy
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareTakahiro Haruyama
 
Frontend testing of (legacy) websites
Frontend testing of (legacy) websitesFrontend testing of (legacy) websites
Frontend testing of (legacy) websitesMichael Kubovic
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotLearning Slot
 
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A CookbookJavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A CookbookJorge Hidalgo
 
Using DevOps to Improve Software Quality in the Cloud
Using DevOps to Improve Software Quality in the CloudUsing DevOps to Improve Software Quality in the Cloud
Using DevOps to Improve Software Quality in the CloudTechWell
 
OSX/Pirrit: The blue balls of OS X adware
OSX/Pirrit: The blue balls of OS X adwareOSX/Pirrit: The blue balls of OS X adware
OSX/Pirrit: The blue balls of OS X adwareAmit Serper
 
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__finalMule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__finalSubhash Patel
 
Project_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxProject_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxskhushi9980
 
Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!
Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!
Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!ThoughtWorks
 
Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...
Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...
Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...Ektron
 
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Coveros, Inc.
 
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Sauce Labs
 
Selenium training
Selenium trainingSelenium training
Selenium trainingShivaraj R
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Niels Frydenholm
 
Beginners overview of automated testing with Rspec
Beginners overview of automated testing with RspecBeginners overview of automated testing with Rspec
Beginners overview of automated testing with Rspecjeffrey1ross
 
Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkSusannSgorzaly
 

Similar to Implementing Testing for Behavior-Driven Development Using Cucumber (20)

Executing Parallel Test Sessions with TestNG and Selenium WebDriver
Executing Parallel Test Sessions with TestNG and Selenium WebDriverExecuting Parallel Test Sessions with TestNG and Selenium WebDriver
Executing Parallel Test Sessions with TestNG and Selenium WebDriver
 
Malicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic SoftwareMalicious File for Exploiting Forensic Software
Malicious File for Exploiting Forensic Software
 
Frontend testing of (legacy) websites
Frontend testing of (legacy) websitesFrontend testing of (legacy) websites
Frontend testing of (legacy) websites
 
Interview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlotInterview Question & Answers for Selenium Freshers | LearningSlot
Interview Question & Answers for Selenium Freshers | LearningSlot
 
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A CookbookJavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
 
Using DevOps to Improve Software Quality in the Cloud
Using DevOps to Improve Software Quality in the CloudUsing DevOps to Improve Software Quality in the Cloud
Using DevOps to Improve Software Quality in the Cloud
 
OSX/Pirrit: The blue balls of OS X adware
OSX/Pirrit: The blue balls of OS X adwareOSX/Pirrit: The blue balls of OS X adware
OSX/Pirrit: The blue balls of OS X adware
 
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__finalMule soft meetup_virtual_ 3_charlotte_07july_2021__final
Mule soft meetup_virtual_ 3_charlotte_07july_2021__final
 
Project_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptxProject_Goibibo information technology automation testing.pptx
Project_Goibibo information technology automation testing.pptx
 
Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!
Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!
Too Dependent on Shared Test Environments? Kick Start Local Workstation Testing!
 
Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...
Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...
Ektron London Conference: New Features of Ektron 9 from a Developers' Perspec...
 
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
 
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
 
Security testing
Security testingSecurity testing
Security testing
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Help Doctor, my application is an onion!
Help Doctor, my application is an onion!Help Doctor, my application is an onion!
Help Doctor, my application is an onion!
 
soa
soasoa
soa
 
Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...Getting your mobile test automation process in place - using Cucumber and Cal...
Getting your mobile test automation process in place - using Cucumber and Cal...
 
Beginners overview of automated testing with Rspec
Beginners overview of automated testing with RspecBeginners overview of automated testing with Rspec
Beginners overview of automated testing with Rspec
 
Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP framework
 

More from TechWell

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and RecoveringTechWell
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization TechWell
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTechWell
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartTechWell
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyTechWell
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTechWell
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowTechWell
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityTechWell
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyTechWell
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTechWell
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipTechWell
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsTechWell
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GameTechWell
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsTechWell
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationTechWell
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessTechWell
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateTechWell
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessTechWell
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTechWell
 

More from TechWell (20)

Failing and Recovering
Failing and RecoveringFailing and Recovering
Failing and Recovering
 
Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization Instill a DevOps Testing Culture in Your Team and Organization
Instill a DevOps Testing Culture in Your Team and Organization
 
Test Design for Fully Automated Build Architecture
Test Design for Fully Automated Build ArchitectureTest Design for Fully Automated Build Architecture
Test Design for Fully Automated Build Architecture
 
System-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good StartSystem-Level Test Automation: Ensuring a Good Start
System-Level Test Automation: Ensuring a Good Start
 
Build Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test StrategyBuild Your Mobile App Quality and Test Strategy
Build Your Mobile App Quality and Test Strategy
 
Testing Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for SuccessTesting Transformation: The Art and Science for Success
Testing Transformation: The Art and Science for Success
 
Implement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlowImplement BDD with Cucumber and SpecFlow
Implement BDD with Cucumber and SpecFlow
 
Develop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your SanityDevelop WebDriver Automated Tests—and Keep Your Sanity
Develop WebDriver Automated Tests—and Keep Your Sanity
 
Ma 15
Ma 15Ma 15
Ma 15
 
Eliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps StrategyEliminate Cloud Waste with a Holistic DevOps Strategy
Eliminate Cloud Waste with a Holistic DevOps Strategy
 
Transform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOpsTransform Test Organizations for the New World of DevOps
Transform Test Organizations for the New World of DevOps
 
The Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—LeadershipThe Fourth Constraint in Project Delivery—Leadership
The Fourth Constraint in Project Delivery—Leadership
 
Resolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile TeamsResolve the Contradiction of Specialists within Agile Teams
Resolve the Contradiction of Specialists within Agile Teams
 
Pin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile GamePin the Tail on the Metric: A Field-Tested Agile Game
Pin the Tail on the Metric: A Field-Tested Agile Game
 
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile TeamsAgile Performance Holarchy (APH)—A Model for Scaling Agile Teams
Agile Performance Holarchy (APH)—A Model for Scaling Agile Teams
 
A Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps ImplementationA Business-First Approach to DevOps Implementation
A Business-First Approach to DevOps Implementation
 
Databases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery ProcessDatabases in a Continuous Integration/Delivery Process
Databases in a Continuous Integration/Delivery Process
 
Mobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to AutomateMobile Testing: What—and What Not—to Automate
Mobile Testing: What—and What Not—to Automate
 
Cultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for SuccessCultural Intelligence: A Key Skill for Success
Cultural Intelligence: A Key Skill for Success
 
Turn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile TransformationTurn the Lights On: A Power Utility Company's Agile Transformation
Turn the Lights On: A Power Utility Company's Agile Transformation
 

Recently uploaded

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 

Recently uploaded (20)

APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 

Implementing Testing for Behavior-Driven Development Using Cucumber

  • 1. W15 Test Automation 5/7/2014 3:00:00 PM Implementing Testing for Behavior-Driven Development Using Cucumber Presented by: Max Saperstone Coveros Brought to you by: 340 Corporate Way, Suite 300, Orange Park, FL 32073 888-268-8770 ∙ 904-278-0524 ∙ sqeinfo@sqe.com ∙ www.sqe.com
  • 2. Max Saperstone Coveros For almost a decade, Max Saperstone has been a test engineer focusing on test automation and the continuous integration/continuous delivery process. Max specializes in open source tools-Selenium, JMeter, AutoIT, Cucumber, and Chef. He has led several testing automation efforts, including developing an automated suite focused on web-based software to operate over several applications. Max also headed a major project developing an automated testing structure to run Cucumber tests over multiple test interfaces and environments, while developing a system to keep test data “ageless.” He is currently developing a new testing architecture for SecureCI to allow testing of multiple interfaces, custom reporting, and minimal test upkeep.
  • 3. © Copyright 2010 Coveros, Inc.. All rights reserved. Implementing Effective Testing for Behavior Driven Development using Cucumber-JVM STAREAST 2014 © Copyright 2010 Coveros, Inc.. All rights reserved. Max Saperstone has been working as a Software and Test Engineer for almost a decade, with a focus on Test Automation and the CI/CD process. He specializes in open source tools, including the Selenium Tool Suite, JMeter, AutoIT, Cucumber, and Chef. Max has lead several testing automation efforts, including developing an automated suite focusing on web-based software to operate over several applications for Kronos Federal. He also headed a project with Delta Dental, developing an automated testing structure to run Cucumber tests over multiple test interfaces and environments, while also developing a system to keep test data 'ageless.' He recently released a new testing architecture for SecureCI™ to allow testing of multiple interfaces, custom reporting, and minimal test upkeep. He is currently engaged in CI/CD work, working to create full automated delivery using open source tools including Jenkins, SonarQube, and Nexus. Max Saperstone
  • 4. © Copyright 2010 Coveros, Inc.. All rights reserved. • Coveros helps organizations accelerate the delivery of secure, reliable software • Our consulting services: – Agile software development – Mobile application development – Application security – Software quality assurance – Software process improvement • Our key markets: – Financial services – Healthcare – Defense – Critical Infrastructure About Coveros Corporate Partners © Copyright 2010 Coveros, Inc.. All rights reserved. Agenda • Cucumber Overview – What is Cucumber – Gherkin – Glue Code • Java Implementation – Cucumber Structure – Recommended Structure – Data Models – Functionality • Execution – Ant – Results
  • 5. © Copyright 2010 Coveros, Inc.. All rights reserved. Cucumber Basics © Copyright 2010 Coveros, Inc.. All rights reserved. Introduction • Cucumber is a tool that supports Behavior Driven Development, BDD. • Cucumber and BDD is not about testing GUIs. It is about systems behavior. • To write tests, specify the properties you want a system to have. • You don’t know, and should not care, about the implementation when you define your features.
  • 6. © Copyright 2010 Coveros, Inc.. All rights reserved. How to Write Tests • The whole point of BDD is that it is vitally important to write each test/feature step – one at a time – with a domain expert – in plain language • The use of plain language in the feature file is crucial to successful use of Cucumber • State the result that you wish to obtain while avoiding specifying how you expect to get it © Copyright 2010 Coveros, Inc.. All rights reserved. Basic Setup • The most basic Cucumber-jvm setup includes 3 files – Generic Test Runner – Feature File – Test Implementation • The Test Runner is the actual file to execute within your IDE, and by default runs as a JUnit test • The Feature Files are what contain all of the human readable tests • The Test Implementation file will contain all of our implementations for our tests
  • 7. © Copyright 2010 Coveros, Inc.. All rights reserved. Gherkin © Copyright 2010 Coveros, Inc.. All rights reserved. Gherkin • Gherkin is a business readable, domain specific language that lets you describe software’s behaviour • A Feature is a set of functionality - think Test Suite • A single Feature is typically contained in its own file (ending in .feature) • Features are typically composed of multiple Scenarios • A Scenario is a block of statements that describe some desired behavior • A Scenario Outline is a block of statements that gets repeated over a set of data • Scenarios specify What and should avoid answering the question How
  • 8. © Copyright 2010 Coveros, Inc.. All rights reserved. How to write Scenarios • A scenario statement - step - consists of three parts: • Given – the preconditions of the system under test. The setup of the systems state if you want. For our tests, we indicate (if desired) which interface we want to test. • When – the actual change of the system. Transforming it from the initial state to the final state. • Then – the expected final state of the system. The verification that the state change was the desired change. © Copyright 2010 Coveros, Inc.. All rights reserved. Example Feature File Feature: Testing for login page Scenario: Login without password Given I want to use the browser Firefox When I provide username testuser1 And I login Then I see the login error message "Please provide a password." And I am on the login page Scenario: Login without username Given I want to use the browser Firefox When I provide testuser1 And I login Then I see the login error message "Please provide a username." And I am on the login page
  • 9. © Copyright 2010 Coveros, Inc.. All rights reserved. How to Write Tests (example) • For example, for a login scenario you should write: • And not: • You should concern yourself with what has to happen and not how you expect it to happen. When I login as USER1 to CosmicComix When I visit www.cosiccomix.com And I click on the login button When I enter USER1 in the username field And I click the continue button And I click the login button © Copyright 2010 Coveros, Inc.. All rights reserved. Feature and Scenario File Tips • Scenario Outlines can contain multiple variable types – Doc Strings – Data Tables – Data Table Diffing • Often times when writing multiple scenarios you see repeated test steps • Initial similar test steps can be moved out into Background • These steps get executed before every scenario – List of Maps/Scalars/Lists – Data Table Transformation – String Transformations
  • 10. © Copyright 2010 Coveros, Inc.. All rights reserved. What was once... Feature: Testing for login page Scenario: Login without password Given I want to use the browser Firefox When I provide username testuser1 And I login Then I see the login error message "Please provide a password." And I am on the login page Scenario: Login without username Given I want to use the browser Firefox When I provide testuser1 And I login Then I see the login error message "Please provide a username." And I am on the login page © Copyright 2010 Coveros, Inc.. All rights reserved. Can become... Feature: Testing for login page Background Given I want to use the browser Firefox Scenario: Login without password When I set the username to testuser1 And I login to CosmicComix Then I see the login error message "Please provide a password." And I am on the login page Scenario: Login without username When I set the password to testuser1 And I login to CosmicComix Then I see the login error message "Please provide a username." And I am on the login page
  • 11. © Copyright 2010 Coveros, Inc.. All rights reserved. Tagging © Copyright 2010 Coveros, Inc.. All rights reserved. Tagging Basics • Cucumber provides a simple method to organize features and scenarios by user determined classifications. • This is implemented using the convention that any space delimited string found in a feature file that is prefaced with the commercial at (@) symbol is considered a tag. • Any string may be used as a tag and any scenario or entire feature can have multiple tags associated with it. • Be aware that tags are heritable within Feature files. – Scenarios inherit tags from the Feature statement. – Examples inherit tags from the Feature and Scenario statements.
  • 12. © Copyright 2010 Coveros, Inc.. All rights reserved. Tagging Examples @CCOrg @CCNet Feature: Testing for login page Scenario Outline: Bad login Given I want to use the browser Firefox When I set the username to [username] When I set the password to [password] When I login to CosmicComix Then I see the error message "[message]" And I am on the login page @Regression Examples: | username | password | message | | testuser1 | | Please provide a password. | | | testuser1 | Please provide a username. | | testuser | testuser | That username does not match anything in our records. | testuser1 | testuser2 | The password provided does not match the username enter © Copyright 2010 Coveros, Inc.. All rights reserved. Step Definitions/Glue Code
  • 13. © Copyright 2010 Coveros, Inc.. All rights reserved. Cucumber Implementation • Cucumber searches the classpath provided in the runner to find any methods annotated with regular expressions that will match each Given/When/Then part of the feature • There must only be one method, step, which matches the regular expression in the classpath • If you have described two different parts of the system with the exact same wording, then you have an issue with ambiguity © Copyright 2010 Coveros, Inc.. All rights reserved. Step Definition Best Practices • The matcher is not overly verbose. • The matcher handles both positive and negative (true and false) conditions. • The matcher has at most two value parameters • The parameter variables are clearly named • The body is less than fifteen lines of code • The body does not call other steps
  • 14. © Copyright 2010 Coveros, Inc.. All rights reserved. Step Definition Basics • When you put part of a regular expression in parentheses, whatever it matches gets captured for use later. – This is known as a “capture group.” • In Cucumber, captured strings become step definition parameters. – Typically, if you’re using a wildcard, you probably want to capture the matching value for use in your step definition. Given("^I'm logged in as an? (.*)$") public void ImLoggedInAsA(String role) { // log in as the given role } • If your step is Given I'm logged in as an admin, then the step definition gets passed "admin" for role. © Copyright 2010 Coveros, Inc.. All rights reserved. Capturing and not capturing • Cucumber converts captured strings to the step definition parameter type • Sometimes, you have to use parentheses to get a regular expression to work, but you don’t want to capture the match. • For example, suppose I want to be able to match both When I log in as an admin and Given I'm logged in as an admin. • Both step definitions do the same thing, there is no reason to have duplicated automation code When("^(I'm logged|I log) in as an? (.*)$") public void LogInAs(string role) { // log in as the given role }
  • 15. © Copyright 2010 Coveros, Inc.. All rights reserved. Capturing and not capturing (cont.) • My regular expression is capturing two strings, but my step definition method only takes one. • I need to designate the first group as non-capturing like this: When("^(?:I'm logged|I log) in as an? (.*)$")] public void LogInAs(string role) { // log in as the given role } • Now, with the addition of ?: at the beginning of the group, it will perform as expected • As mentioned previously, a multitude of object types can be provided, and if expected in (.*) will be automatically parsed © Copyright 2010 Coveros, Inc.. All rights reserved. Hooks
  • 16. © Copyright 2010 Coveros, Inc.. All rights reserved. Hooks Overview • Hooks allow us to perform actions at various points in the cucumber test cycle • Before hooks will be run before the first step of each scenario. • After hooks will be run after the last step of each scenario, even when there are failing, undefined, pending or skipped steps. • Scenario Hooks – Similar to JUnit @Before and @After run with each scenario – Placing common functionality in these reduces the number of test steps in each scenario © Copyright 2010 Coveros, Inc.. All rights reserved. Hooks Overview • Tagged Hooks – We can also indicate that @Before and @After only run with scenarios with certain tags e.x. @Before('@web') for tests needing a browser launched – Tagged hooks can have multiple tags, and follow similar tagging AND/OR rules that the runner does e.x. @Before('@CCOrg, @CCNet) would run before scenarios tagged with @CCOrg OR @CCNet e.x. @Before('@CCOrg', '~@CCNet') would run before scenarios tagged with @CCOrg AND NOT @CCNet • Global Hooks – Cucumber doesn’t support global hooks, however, hacks are possible
  • 17. © Copyright 2010 Coveros, Inc.. All rights reserved. Sample Code @Before //performed before anything is done public void setup() { if ( webEls == null ) { webEls = new LoadElements( xmlFiles ); //set our database if( System.getProperty( "dataenvironment" ) != null ) { database = Databases.valueOf( System.getProperty( "dataenvironment" ).substring(1) ); } } tests.clear(); tests.add( database.getValidTestingInterfaces() ); } @Before('@ExternalWebsite') //performed before each web scenario public void externalWebsite() { tests.add( new ExternalWebsite( webEls, Browsers.Firefox ) ); } © Copyright 2010 Coveros, Inc.. All rights reserved. Java Structure
  • 18. © Copyright 2010 Coveros, Inc.. All rights reserved. Test Architecture Gherkin Glue Model Implementation Functionality © Copyright 2010 Coveros, Inc.. All rights reserved. Definition Structure Test Runner cucumber parameters Test Base initializes test inputs Test Setup parses cucumber parameters and sets test inputs Login Definitions Library Definitions Help Definitions extends
  • 19. © Copyright 2010 Coveros, Inc.. All rights reserved. Data Modeling © Copyright 2010 Coveros, Inc.. All rights reserved. Java Implementation • Drive the initial implementation from the steps. As it looks now I will need – Potential Interface selector – A place to store user information ▪ Username ▪ Password – A method to submit the information – A method to check the page – A method to check the message • Before I start implementing the model, I want to implement the steps that will verify the model. • Start with an implementation of the steps like this...
  • 20. © Copyright 2010 Coveros, Inc.. All rights reserved. //type in our username @When("^I set the username to (.*)$") public void setUsername(String user) throws Exception { user.setUsername( user ); } //type in our password @When("^I set the password to (.*)$") public void setPassword(String password) throws Exception { user.setPassword( password ); } //click the login button @When("^I login to CosmicComix$") public void login() throws Exception { login.login( user ); } //check our message @Then("^I see the login error message "(.*)"$") public void checkLoginErrorMessage(String errorMessage) throws Exception { login.checkLoginErrorMessage( errorMessage ); } //check our page @Then("^I am on the (.*) page$") public void checkPage(Pages page) throws Exception { login.checkPage( page ); } Java Implementation - Code © Copyright 2010 Coveros, Inc.. All rights reserved. Data Modeling • Once all of the test steps have been implemented, data models should be created to encapsulate all needed fields • Based on our above examples, we’ll need a User object which will contain: – Username – Password – public class User { private String user; private String password; public void setUser( String user ) { this.user = user; } public void setPassword( String password ) { this.password = password; } public String getUser() { return user; } public String getPassword() { return password; } }
  • 21. © Copyright 2010 Coveros, Inc.. All rights reserved. Exercising Functionality © Copyright 2010 Coveros, Inc.. All rights reserved. Functionality • The functionality should be broken down into two distinct ‘layers’ – Base calls (e.g. Selenium, ODBC, HTTP) – Implementation of workflow • All of the static calls to external services are defined and can remain unmodified as workflow and application functionality changes • These calls can also automatically log all data being passed to and from the services to provide a more seamless logging
  • 22. © Copyright 2010 Coveros, Inc.. All rights reserved. Implementation • The workflow of the application (the how) is all contained in the abstract class forming the implementation • One class should be written to contain all workflows (each as a method) expected from the application – Login – Help – Library • Some methods can be defined at this level, however any that are interface specific should be left as abstract to be defined by the extending class © Copyright 2010 Coveros, Inc.. All rights reserved. Base Class public abstract class TestStructure { protected WebDriver driver; //this is our selenium webdriver controlling our browse protected SeleniumWebdriver selenium; //this is our selenium instance private ArrayList<Object> call = new ArrayList<Object>(); //this is the call being made private ArrayList<Object> response = new ArrayList<Object>(); //this is the response from th private ArrayList<Object> actions = new ArrayList<Object>(); //this is all of the responses from protected final String appURL = "http://cosmiccomix.net"; //the url of our application public abstract void setDriver() throws InvalidBrowserException; public abstract void unsetDriver(); public SeleniumWebdriver getSelenium() { return selenium; } public WebDriver getDriver() { return driver; } public abstract void login(User user); public void checkPage(Pages page) { if ( selenium == null ) throw new InvalidTestInterfaceException(); selenium.getTitle(); } }
  • 23. © Copyright 2010 Coveros, Inc.. All rights reserved. public class ExternalWebsite extends TestStructure { private LoadElements webEls; private Browsers browser; private String subDomain; public ExternalWebsite(LoadElements webEls, Browsers browser, String subDomain) { this.webEls = webEls; this.browser = browser; this.subDomain = subDomain; } @Override public void setDriver() throws InvalidBrowserException { selenium = new SeleniumWebdriver(this, webEls, browser); driver = selenium.getDriver(); } @Override public void unsetDriver() { if ( selenium != null ) { selenium.killDriver(); } } @Override public HashMap<Products,QuoteResult> login(User user) { //navigate to our URL selenium.goToURL( "http://" + subDomain + ".cosmiccomix.com/" ); selenium.type( "username", user.getUser() ); selenium.type( "password", user.getPassword() ); selenium.submit( "login" ); External Web Class © Copyright 2010 Coveros, Inc.. All rights reserved. External Website Class
  • 24. © Copyright 2010 Coveros, Inc.. All rights reserved. Executing Tests © Copyright 2010 Coveros, Inc.. All rights reserved. • Cucumber can currently be executed using two different methods. – A command line tool – A JUnit runner • Connecting through JUnit with a runner such as Ant can make it a seamless part of a project developed using tests. • Multiple inputs can be set, which can be overridden by values in the build.xml script Executing Tests package comix.cosmic.definitions; @RunWith(Cucumber.class) @Cucumber.Options( features = "comix/cosmic/features/", glue = "comix.cosmic.definitions", format = {"pretty", "html:target/cucumber-html-report", "json-pretty:target/cucumber-report.json"}, tags = {"@Smoke"} ) public class TestRunner{ }
  • 25. © Copyright 2010 Coveros, Inc.. All rights reserved. Test Inputs (cont.) • Additionally, Java system environments can also be set from the Ant script to create a more dynamic testing scenario. © Copyright 2010 Coveros, Inc.. All rights reserved. Interpreting Results
  • 26. © Copyright 2010 Coveros, Inc.. All rights reserved. General Results • Upon completion, test results will be available in the project directory under a folder labeled target. • Navigate to the folder labeled cucumber-html-report and open the index.html file. • This file will show your results. • There are four different stylings for the results. – Unimplemented – Failed – Skipped – Passed © Copyright 2010 Coveros, Inc.. All rights reserved. Unimplemented Steps • The test step was not properly implemented and therefore could not be run. • These will appear yellow in the cucumber HTML results • If run directly as a JUnit test, the output will offer suggestions on how to implement the missing steps • Once all these test steps are completed re-run the tests, and re-check for problem areas.
  • 27. © Copyright 2010 Coveros, Inc.. All rights reserved. Failing Steps • These are steps where an exception was thrown (either via asserts, or Java exceptions). • The next step is to examine these test steps. • There are also several possibilities for a bad test steps. – The test code may not be waiting properly for a return – The code may be checking a bad field – The internal call may have changed – The input data may be bad – The expected output may have changed. © Copyright 2010 Coveros, Inc.. All rights reserved. Getting to Green • After all of these un-implemented and failed test steps are fixed, and the tests are re-run, the skipped (blue) test steps should resolve themselves.
  • 28. © Copyright 2010 Coveros, Inc.. All rights reserved. Debugging Tests © Copyright 2010 Coveros, Inc.. All rights reserved. Debugging Options • Missing Locators – Selenium IDE – xPather – Firebug – WebDriver Element Locator • Failing Test Steps – Input/Output Validation – Change of workflow – Change of design • Thrown Exceptions – Eclipse debugging mode ▪ Breakpoints ▪ System output
  • 29. © Copyright 2010 Coveros, Inc.. All rights reserved. Questions