SlideShare uma empresa Scribd logo
1 de 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 ?

Mais conteúdo relacionado

Mais procurados

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

Mais procurados (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
 

Destaque (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
 

Semelhante a 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
 

Semelhante a 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
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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