SlideShare a Scribd company logo
1 of 10
Automation solution for web apps

Vadym Goncharenko, December 2013
Agenda:
•
•
•
•
•
•
•

1. Introduction in JBehave
2. Behavior driven development
3. Selenium as a tool for automation testing
4. How to create new test scenario
5. The page objects pattern
6. Good and bad practices
7. Running test scenarios through maven
Introduction in JBehave
• JBehave is a framework for Behaviour-Driven Development
Behavior driven development
• Behavior-driven development is a software development
process based on test-driven development (TDD)
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.
Create new test
• 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() {
}
The page objects pattern
• More popular in test automation;
• Page object is an object-oriented;
• Serves as an interface to a page;
Web page

Java class

Enhancing test maintenance;
Reducing code duplication;

Test cases
Good and bad practices
public class GoogleLoginSteps {
private Selenium selenium;
public void googleLoginSteps() {
selenium.open("google.com");
selenium.waitForPageToLoad("10000");
selenium.click("id=gb_70");
selenium.type("id=Email", "wrong@gmail.com");
selenium.type("id=Passwd", "wrong password");
selenium.click("id=signIn");
selenium.waitForPageToLoad("10000");
assertTrue(selenium.isElementPresent("errormsg_0_Passwd"));
}
}
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
Questions ?

More Related Content

What's hot

Auditing Drupal Sites
Auditing Drupal SitesAuditing Drupal Sites
Auditing Drupal Sites
Exove
 

What's hot (20)

Protractor
ProtractorProtractor
Protractor
 
Beyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms OrganizationsBeyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms Organizations
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
 
2 selenium-aakar gupte
2 selenium-aakar gupte2 selenium-aakar gupte
2 selenium-aakar gupte
 
Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010Lap Around Visual Studio 2010 Ultimate And TFS 2010
Lap Around Visual Studio 2010 Ultimate And TFS 2010
 
Selenium
SeleniumSelenium
Selenium
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Run Selenium Tests With Microsoft Test Manager
Run Selenium Tests With Microsoft Test ManagerRun Selenium Tests With Microsoft Test Manager
Run Selenium Tests With Microsoft Test Manager
 
Intro to Service Worker API and its use cases
Intro to Service Worker API and its use casesIntro to Service Worker API and its use cases
Intro to Service Worker API and its use cases
 
Drupal 7 ci and testing
Drupal 7 ci and testingDrupal 7 ci and testing
Drupal 7 ci and testing
 
Automation test framework with cucumber – BDD
Automation test framework with cucumber – BDDAutomation test framework with cucumber – BDD
Automation test framework with cucumber – BDD
 
Automation using Javascript
Automation using JavascriptAutomation using Javascript
Automation using Javascript
 
ProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applicationsProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applications
 
Auditing Drupal Sites
Auditing Drupal SitesAuditing Drupal Sites
Auditing Drupal Sites
 
Continuous Testing Meets the Classroom at Code.org
Continuous Testing Meets the Classroom at Code.orgContinuous Testing Meets the Classroom at Code.org
Continuous Testing Meets the Classroom at Code.org
 
What's new in selenium 4
What's new in selenium 4What's new in selenium 4
What's new in selenium 4
 
Qa process
Qa processQa process
Qa process
 
Test automation Frame Works
Test automation Frame WorksTest automation Frame Works
Test automation Frame Works
 
Testing desktop apps with selenium
Testing desktop apps with seleniumTesting desktop apps with selenium
Testing desktop apps with selenium
 
test_automation_POC
test_automation_POCtest_automation_POC
test_automation_POC
 

Viewers also liked (6)

ASKEP Flu Burung & Babi
ASKEP Flu Burung & BabiASKEP Flu Burung & Babi
ASKEP Flu Burung & Babi
 
Askep flu burung dan flu babi,,
Askep flu burung dan flu babi,,Askep flu burung dan flu babi,,
Askep flu burung dan flu babi,,
 
Wakugadu amaruwa 01 11-2012
Wakugadu amaruwa 01 11-2012Wakugadu amaruwa 01 11-2012
Wakugadu amaruwa 01 11-2012
 
Natural Born Killers, Performance issues to avoid
Natural Born Killers, Performance issues to avoid Natural Born Killers, Performance issues to avoid
Natural Born Killers, Performance issues to avoid
 
Askep Flu Burung & Babi
Askep Flu Burung & BabiAskep Flu Burung & Babi
Askep Flu Burung & Babi
 
Jbehave selenium
Jbehave seleniumJbehave selenium
Jbehave selenium
 

Similar to Automation solution

Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Enhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfEnhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdf
AnanthReddy38
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
Nikhil Kapoor
 

Similar to Automation solution (20)

Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
11-01-2023.pptx
11-01-2023.pptx11-01-2023.pptx
11-01-2023.pptx
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
Selenium
SeleniumSelenium
Selenium
 
Selenium – Web Browser Automation
Selenium – Web Browser AutomationSelenium – Web Browser Automation
Selenium – Web Browser Automation
 
Story Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkStory Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium Framework
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
 
Enhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdfEnhancing Website and Application Testing with Java Scrapers.pdf
Enhancing Website and Application Testing with Java Scrapers.pdf
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
4.1 Selenium_Course_Content.ppt
4.1 Selenium_Course_Content.ppt4.1 Selenium_Course_Content.ppt
4.1 Selenium_Course_Content.ppt
 
Selenium_Course_Contenttttttttttttttttt.ppt
Selenium_Course_Contenttttttttttttttttt.pptSelenium_Course_Contenttttttttttttttttt.ppt
Selenium_Course_Contenttttttttttttttttt.ppt
 
Selenium-Course-Content.ppt
Selenium-Course-Content.pptSelenium-Course-Content.ppt
Selenium-Course-Content.ppt
 
Introduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeopleIntroduction to Selenium Webdriver - SpringPeople
Introduction to Selenium Webdriver - SpringPeople
 
前端網頁自動測試
前端網頁自動測試 前端網頁自動測試
前端網頁自動測試
 
Getting up and running with selenium for automated Code palousa
Getting up and running with selenium for automated  Code palousaGetting up and running with selenium for automated  Code palousa
Getting up and running with selenium for automated Code palousa
 
Selenium using C# by Yogesh Kumar
Selenium using C# by  Yogesh KumarSelenium using C# by  Yogesh Kumar
Selenium using C# by Yogesh Kumar
 
Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch  Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
 
Automated Testing for Websites With Selenium IDE
Automated Testing for Websites With Selenium IDEAutomated Testing for Websites With Selenium IDE
Automated Testing for Websites With Selenium IDE
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Automation solution

  • 1. Automation solution for web apps Vadym Goncharenko, December 2013
  • 2. Agenda: • • • • • • • 1. Introduction in JBehave 2. Behavior driven development 3. Selenium as a tool for automation testing 4. How to create new test scenario 5. The page objects pattern 6. Good and bad practices 7. Running test scenarios through maven
  • 3. Introduction in JBehave • JBehave is a framework for Behaviour-Driven Development
  • 4. Behavior driven development • Behavior-driven development is a software development process based on test-driven development (TDD)
  • 5. 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. Create new test • 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() { }
  • 7. The page objects pattern • More popular in test automation; • Page object is an object-oriented; • Serves as an interface to a page; Web page Java class Enhancing test maintenance; Reducing code duplication; Test cases
  • 8. Good and bad practices public class GoogleLoginSteps { private Selenium selenium; public void googleLoginSteps() { selenium.open("google.com"); selenium.waitForPageToLoad("10000"); selenium.click("id=gb_70"); selenium.type("id=Email", "wrong@gmail.com"); selenium.type("id=Passwd", "wrong password"); selenium.click("id=signIn"); selenium.waitForPageToLoad("10000"); assertTrue(selenium.isElementPresent("errormsg_0_Passwd")); } }
  • 9. 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