SlideShare a Scribd company logo
Solution for automated testing web apps
Vadym Goncharenko, December 2013
Agenda:
1. Behavior driven development
2. Introduction to JBehave
3. Automated testing with Selenium
4. The page objects pattern
5. How to add new test scenario
6. Running test scenarios through maven
7. An example of best practice
8. Reporting JBehave results
9. Questions ?
Behavior driven development
Behavior-driven development is a software development process
based on test-driven development (TDD)
Introduction to JBehave
JBehave is a framework for Behaviour-Driven Development
Automated testing with selenium
• Selenium is a suite of tools to automate web browsers across
many platforms.
• Selenium IDE is a complete integrated development
environment (IDE) for Selenium tests.
• Selenium Remote Control (RC) is a server, written in Java, that
accepts commands for the browser via HTTP.
• Selenium WebDriver is the successor to Selenium RC.
The page objects pattern
• More popular in test automation;
• Page object is an object-oriented;
• Serves as an interface to a page;
Enhancing test maintenance;
Reducing code duplication;
Web page Java class Test cases
How to add new test scenario
• Write new test scenario on the Gherkin like:
Scenario: “describes what should be passed”
Given: “given something”
When: “something happened”
Then: “should be something”
• Implementation for this scenario
@Given ("given something")
public void givenSomething() {
}
@When ("something happened")
public void whenSomethingHappened() {
}
@Then ("should be something")
public void thenShouldBeSomething() {
}
Running test scenarios through maven
Maven is a build automation tool used primarily for Java projects
Basic concepts, examples:
<dependency>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-core</artifactId>
<version>3.4</version>
</dependency>
<execution>
<id>unpack-view-resources</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-view-resources</goal>
</goals>
</execution>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<compilerVersion>1.5</compilerVersion>
</configuration>
</plugin>
mvn clean install
mvn install –Dtest=testname
mvn install -DskipTests
An example of best practices
• Each scenario must make sense and be able to be executed
independently;
• Stories may be dependent of each other. If so, they must
declare their dependencies;
• A scenario should consist of steps: "Given“, "When“, "Then";
• Steps of type "Given" and "When" should not perform a
verification;
• Steps of type "Then" should not perform actions;
• Each scenario should not run longer than 3 minutes.
• Step names should be written in business language terms.
Reporting Jbehave results
Questions ?

More Related Content

PPTX
Automation solution using jbehave, selenium and hudson
PPTX
Automation solution
PPTX
Exactpro Systems for KSTU Students in Kostroma
PPT
BDD with JBehave and Selenium
PPT
Behavior Driven Development (BDD) and Agile Testing
PDF
Acceptance Test-driven Development with Cucumber-jvm
PPTX
Jbehave- Basics to Advance
PPTX
Behavior Driven Development Testing (BDD)
Automation solution using jbehave, selenium and hudson
Automation solution
Exactpro Systems for KSTU Students in Kostroma
BDD with JBehave and Selenium
Behavior Driven Development (BDD) and Agile Testing
Acceptance Test-driven Development with Cucumber-jvm
Jbehave- Basics to Advance
Behavior Driven Development Testing (BDD)

What's hot (20)

PDF
Test and Behaviour Driven Development (TDD/BDD)
PDF
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
PPTX
Testing Java EE apps with Arquillian
PPT
Behavior Driven Development by Example
PDF
Mastering Test Automation: How to Use Selenium Successfully
PDF
Arquillian & Citrus
PDF
Rspec and Capybara Intro Tutorial at RailsConf 2013
PPTX
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
DOCX
Automation Frame works Instruction Sheet
PPTX
Better Page Object Handling with Loadable Component Pattern
PPTX
An Introduction to AngularJS End to End Testing using Protractor
PDF
Integration testing - A&BP CC
PDF
Using Selenium to Improve a Teams Development Cycle
PDF
Automated Testing in Angular Slides
PPTX
Protractor overview
PPT
Intro to Service Worker API and its use cases
PPTX
Bdd – with cucumber and gherkin
PDF
How to Build Your Own Test Automation Framework?
PDF
Better Page Object Handling with Loadable Component Pattern
PDF
Introduction to Protractor
Test and Behaviour Driven Development (TDD/BDD)
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Testing Java EE apps with Arquillian
Behavior Driven Development by Example
Mastering Test Automation: How to Use Selenium Successfully
Arquillian & Citrus
Rspec and Capybara Intro Tutorial at RailsConf 2013
QA Fest 2015. Сергей Пирогов. Красивые JBehave отчеты
Automation Frame works Instruction Sheet
Better Page Object Handling with Loadable Component Pattern
An Introduction to AngularJS End to End Testing using Protractor
Integration testing - A&BP CC
Using Selenium to Improve a Teams Development Cycle
Automated Testing in Angular Slides
Protractor overview
Intro to Service Worker API and its use cases
Bdd – with cucumber and gherkin
How to Build Your Own Test Automation Framework?
Better Page Object Handling with Loadable Component Pattern
Introduction to Protractor
Ad

Similar to Jbehave selenium (20)

PDF
Behaviour testing for single-page applications and API’s
PDF
BDD and Test Automation Tech Talk - Atlogys Academy Series
PPTX
Bdd test automation analysis
PPTX
Bridging the communication Gap & Continuous Delivery
PDF
cucumber harpal.pdf
PPTX
Testing basics for developers
PPTX
Bdd with Cucumber and Mocha
PPT
Introduction to Behavior Driven Development
PDF
BDD and Test Automation in Evalutionary Product Suite
PPTX
Testable Agile Requirements with BDD - Jennifer Flora Black
DOCX
Diversified AT Framework - Initial Version
PDF
Behavior-Driven-Development (BDD) for Conversational Applications
PDF
CBDW2014 - Behavior Driven Development with TestBox
PDF
Behavior driven development with Behat and Gherkin
PDF
An Introduction to Behaviour Driven Development with Cucumber Java
PDF
Test Essentials @mdevcon 2012
PPTX
So What Do Cucumbers Have To Do With Testing
PDF
Behavior Driven Testing with SpecFlow
PDF
Behavior Driven Development with SpecFlow
Behaviour testing for single-page applications and API’s
BDD and Test Automation Tech Talk - Atlogys Academy Series
Bdd test automation analysis
Bridging the communication Gap & Continuous Delivery
cucumber harpal.pdf
Testing basics for developers
Bdd with Cucumber and Mocha
Introduction to Behavior Driven Development
BDD and Test Automation in Evalutionary Product Suite
Testable Agile Requirements with BDD - Jennifer Flora Black
Diversified AT Framework - Initial Version
Behavior-Driven-Development (BDD) for Conversational Applications
CBDW2014 - Behavior Driven Development with TestBox
Behavior driven development with Behat and Gherkin
An Introduction to Behaviour Driven Development with Cucumber Java
Test Essentials @mdevcon 2012
So What Do Cucumbers Have To Do With Testing
Behavior Driven Testing with SpecFlow
Behavior Driven Development with SpecFlow
Ad

Recently uploaded (20)

PDF
Advanced Soft Computing BINUS July 2025.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced IT Governance
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Electronic commerce courselecture one. Pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Spectral efficient network and resource selection model in 5G networks
Advanced Soft Computing BINUS July 2025.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
GamePlan Trading System Review: Professional Trader's Honest Take
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Chapter 2 Digital Image Fundamentals.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced IT Governance
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Advanced methodologies resolving dimensionality complications for autism neur...
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Electronic commerce courselecture one. Pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Dropbox Q2 2025 Financial Results & Investor Presentation
Spectral efficient network and resource selection model in 5G networks

Jbehave selenium

  • 1. Solution for automated testing web apps Vadym Goncharenko, December 2013
  • 2. Agenda: 1. Behavior driven development 2. Introduction to JBehave 3. Automated testing with Selenium 4. The page objects pattern 5. How to add new test scenario 6. Running test scenarios through maven 7. An example of best practice 8. Reporting JBehave results 9. Questions ?
  • 3. Behavior driven development Behavior-driven development is a software development process based on test-driven development (TDD)
  • 4. Introduction to JBehave JBehave is a framework for Behaviour-Driven Development
  • 5. Automated testing with selenium • Selenium is a suite of tools to automate web browsers across many platforms. • Selenium IDE is a complete integrated development environment (IDE) for Selenium tests. • Selenium Remote Control (RC) is a server, written in Java, that accepts commands for the browser via HTTP. • Selenium WebDriver is the successor to Selenium RC.
  • 6. The page objects pattern • More popular in test automation; • Page object is an object-oriented; • Serves as an interface to a page; Enhancing test maintenance; Reducing code duplication; Web page Java class Test cases
  • 7. How to add new test scenario • Write new test scenario on the Gherkin like: Scenario: “describes what should be passed” Given: “given something” When: “something happened” Then: “should be something” • Implementation for this scenario @Given ("given something") public void givenSomething() { } @When ("something happened") public void whenSomethingHappened() { } @Then ("should be something") public void thenShouldBeSomething() { }
  • 8. Running test scenarios through maven Maven is a build automation tool used primarily for Java projects Basic concepts, examples: <dependency> <groupId>org.jbehave</groupId> <artifactId>jbehave-core</artifactId> <version>3.4</version> </dependency> <execution> <id>unpack-view-resources</id> <phase>process-resources</phase> <goals> <goal>unpack-view-resources</goal> </goals> </execution> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <compilerVersion>1.5</compilerVersion> </configuration> </plugin> mvn clean install mvn install –Dtest=testname mvn install -DskipTests
  • 9. An example of best practices • Each scenario must make sense and be able to be executed independently; • Stories may be dependent of each other. If so, they must declare their dependencies; • A scenario should consist of steps: "Given“, "When“, "Then"; • Steps of type "Given" and "When" should not perform a verification; • Steps of type "Then" should not perform actions; • Each scenario should not run longer than 3 minutes. • Step names should be written in business language terms.