Copyright 2009, Build Lackey Labs (see last slide for licensing terms) - Selenium - Browser-Based Automated Testing of Web Apps.

Slides:



Advertisements
Similar presentations
Vincent Massol, 1 st December 2006 Quality with Maven2.
Advertisements

© 2011 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Ashish Mishra Automation Lifecycle of Mobile Applications.
Apache Maven: J2EE Front to Back Jesse McConnell -
17 Copyright © 2005, Oracle. All rights reserved. Deploying Applications by Using Java Web Start.
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
Jenkins User Conference San Francisco, Sept #jenkinsconf Business Process Model & Notation (BPMN) Workflows in Jenkins Max Spring Cisco
Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
Test Case Management and Results Tracking System October 2008 D E L I V E R I N G Q U A L I T Y (Short Version)
Pubman and Selenium tests. What is Selenium Selenium is a suite of Web application test automation tools for any browser on any operating system –Firefox,
Introduction to Maven Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to the Java Stack.
Test Automation Framework Ashesh Jain 2007EE50403 Manager Amit Maheshwari.
Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler.
Maven: Build and project management in the 21th century.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Selenium – Testing Tool. What is Selenium? Selenium is a robust set of tools that supports rapid development of test automation for web-based applications.
Talend 5.4 Architecture Adam Pemble Talend Professional Services.
Selenium Web Test Tool Training Using Ruby Language Discover the automating power of Selenium Kavin School Kavin School Presents: Presented by: Kangeyan.
Automation using Selenium Authored & Presented by : Chinmay Sathe & Amit Prabhu Cybage Software Pvt. Ltd.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Maven and Stack Starter Michael Youngstrom. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack.
PHP, QA, and Jenkins Eric Cope June 25, 2013
Maven & Bamboo CONTINUOUS INTEGRATION. QA in a large organization In a large organization that manages over 100 applications and over 20 developers, implementing.
MAVEN-BLUEMARTINI Yannick Robin. What is maven-bluemartini?  maven-bluemartini is Maven archetypes for Blue Martini projects  Open source project on.
Sumedha Rubasinghe October,2009 Introduction to Programming Tools.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
LDS Account Integration. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in labs Please ask questions Prerequisites:
AUTOBUILD Build and Deployment Automation Solution.
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Using the ALM Module Fully Automated Deployments in Stack 3.2.
MAE Continuous Integration Administration guide July 8th, 2013.
Using the ALM Module Michael Youngstrom. Disclaimer This is a training NOT a presentation. – Be prepared to learn and participate in lab Please ask questions.
Selenium and Selenium on Rails. Agenda  Overview of Selenium Simple Selenium Tests Selenium IDE  Overview of Selenium on Rails  Problems with Selenium.
Web Automation Testing With Selenium By Rajesh Kanade.
Pubman and Selenium tests. What is Selenium Selenium is a suite of Web application test automation tools for any browser on any operating system –Firefox,
37 Copyright © 2007, Oracle. All rights reserved. Module 37: Executing Workflow Processes Siebel 8.0 Essentials.
Selenium January Selenium course content  Introduction (Session-1)Session-  Automation  What is automation testing  When to go for automation.
Chapter 1 Introducing Ant. What is ant? Ant is a build tool  Automate the tasks of compiling code, running test, and packaging the results for redistribution.
Maven for building Java applications By Nalin De Zoysa
Build Systems Presentation December 14, 2015 Noon-1pm Kathy Lee Simunich Bldg. 203/ D120 Brought to you by: Argonne Java.
1 G52IWS: Example Web-services Chris Greenhalgh. 2 Contents Software requirements AXIS web service run-time components Getting started with Jetty & AXIS.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
(1) Introduction to Continuous Integration Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of.
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
Build and Deployment Process Understand NCI’s DevOps and continuous integration requirements Understand NCI’s build and distribution requirements.
Selenium server By, Kartikeya Rastogi Mayur Sapre Mosheca. R
Test Automation Using Selenium Presented by: Shambo Ghosh Ankit Sachan Samapti Sinhamahapatra Akshay Kotawala.
8/29/10 Maven Repository Management with Nexus Jim McMahon.
© 2013 IBM Corporation Accelerating Product and Service Innovation Service Virtualization Testing in Managed Environments Michael Elder, IBM Senior Technical.
Arklio Studija 2007 File: / / Page 1 Automated web application testing using Selenium
Platform & Maven2 David Šimonek. Certified Engineer Course Agenda What is Maven? Why Maven? NB IDE & Maven NB Platform & Maven.
Open-O Integration Project Introduction
Maven 04 March
Essentials of UrbanCode Deploy v6.1 QQ147
JRA2: Acceptance Testing senarious
Testing with Selenium IDE
Understanding SOAP and REST calls The types of web service requests
Data Virtualization Tutorial… CORS and CIS
prepared by hasan.we4tech.com
Unit 6-Chapter 2 Struts.
PHP / MySQL Introduction
Continuous Performance Engineering
Open Source Continuous Integration Server
- Selenium - Browser-Based Automated Testing of Web Apps Under Continuous Integration Presented By Chris Bedford Founder & Lackey at Large Build Lackey.
JENKINS TIPS Ideas for making your life with Jenkins easier
Continuous Integration
Selenium Tutorials Cheyat Training.
Node.js Test Automation using Oracle Developer Cloud- Simplified
Presentation transcript:

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) - Selenium - Browser-Based Automated Testing of Web Apps Under Continuous Integration Presented By Chris Bedford Founder & Lackey at Large Build Lackey Labs Company Overview Founded 2008 Services Release engineering & Build/Test Automation for Java Environments Spring/Hibernate & Groovy/Grails App Development Training: Spring/Groovy/Grails & Build/Test Automation Technologies Employees Chris Bedford Mike Jackson

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Agenda Different Ways To Test a Grails App Unit, Integration, Functional Selenium Demo of IDE Architecture Alternatives (Canoo WebTest) Automating Testing Using Selenium Maven Demo Cargo Viewing Test Results Lab 1 – maven project Ant Continuous Integration With Hudson How to write functional tests with Selenium KEY TAKE- AWAYS How to set up Selenium Testing On Grails Apps In Continuous Integration Building With Ant Building with maven Continuous Integration With Hudson

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Unit Unit Tests are created and run developer and run using framework like Junit or TestNG test class or package functionality in isolation heavy use of mocks and stubs tests should execute quickly and be run often to catch problems early on Integration If you are dependent on someone elses stuff, the test includes your stuff and theirs Verifies that two or more components work together, usually directly, and not with mocks To simplify test set-up components typically execute same JVM process Functional Testing Run application in container Exercise functionality via a client side agent that executes Javascript. Agent could be either: your actual target browser (Firefox, IE, etc.) [Selenium's approach] a Javascript engine embedded into test framework [Canoo Webtest's approach] Different Ways To Test a Java Web App Real http requests Separate client Mock http requests Client requests from same process Package or class level scope increasingly coarse grained components under test

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Manual Steps Involved In Running Selenium Before running Selenium Functional Tests we need to Compile classes Run unit and integration tests bail on functional tests if we catch problems with lighter weight tests Package.war file Install and start the container in which we want to run the.war Deploy the.war to the container unless your running Jetty, which runs embedded in your app Launch target browser Launch Selenium on desired test suite

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Launching Selenium

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Recording New Selenium Tests

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Exporting test commands to 3GL (Java, etc.)

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Individual tests referenced by the suite are recorded using their paths relative to the suite. For simplicity put your suite and all tests in the same directory (to start) Saving New or Modified Selenium Tests

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Selenium Components Selenium IDE Selenese Commands Enable test author to simulate navigation, clicks Make assertions about expected responses Selenium RC Client side library that enables you to program more sophistication into your tests than the IDE allows (conditions, looping, error handling) The Selenium Server which launches and kills browsers, interprets and runs the Selenese commands passed from the test program, and acts as an HTTP proxy,

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Selenium Client Side Library & Server In Action HTTP Selenium-server.jar Source: Reports back results of test to client HTTP (javascript) (client side java script / Ajax portion of application under Test – originates from here ) Application under test (server side)

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) A Look Same Origin Policy (Which Seleniums Architecture Circumvents) Same origin policy: Forbids JavaScript code running on a web page from interacting with resources which originate from any web site other than the one which served up that web page

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Selenium RC Server Acting As Proxy To Avoid Same Origin Policy Restrictions What happens when a test suite starts ? 1) client/driver establishes connection w.selenium-RC 2) Selenium-RC server launches a browser (or reuses an old one) with URL that injects Selenium-Cores javascript into browser- loaded web page. 3) client-driver passes a Selenese command to the server e.g.: open command 4) Server interprets the command and then triggers the corresponding javascript execution to execute that command within the browser (say open page in app under test)s 5) Request to open the page is routed through proxy server 6) 7) Proxy forwards request to app server App server returns response

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Functional Test Alternatives: Canoo vs Selenium Canoo Web Test built on HtmlUnit pros: excellent test reporting allows you to pin point errors in test very easily. faster to run (no browser spin up overhead) better support for non HTML content (like spread sheets) cons: Weaker IDE (for test recording and playback) develop tests in Ant or Gant only Selenium pros: develop tests in HTML markup or 3 GL's like Java, Ruby, etc. run test in actual browser vs.embedded Javascript engine used by NO popular browser platform cons: slower to start. see 'pros' listed Canoo RECOMMENDATION: Id go with Canoo for testing a REST-ful API

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Canoo Web Test Reports Canoo's reports show overall test results and let you drill down into any test

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Canoo Web Test Reports (cont.) Click to review a copy of the response HTML page corresponding to the first test step that failed

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Gluing together the steps in your build process Before running Functional Tests need to Compile Run unit and integration tests bail on functional tests if we catch problems with lighter weight tests Package.war file Install the container in which we want to run the.war (optional) Deploy the.war to the container (optional – can just do grails run-app) Launch your target browser Launch Selenium on your desired test suite To automate this process you can use ant maven Groovy/Gant scripts Gradle Our example uses Maven (demo) (tour of pom.xml files that wire together our build steps)

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) deploy Compile Unit Test Integration Test Package.war file Download And Install Tomcat

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Structure of our demo project mvn install Maven Repository Lives in $HOME/.m2/repostitory or /Docuemts and Settings/ /.m2/repository declares the artifact it produces to be org.example:demo:1.1 declares a a dependency on org.example:demo:1.1

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Demo All Tests Pass Some Tests Fail

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Maven Basics Convention over configuration Standardizes where things live and what they are named Lets you know where to look for the things you need… and what to do when you find them Project Object Model (pom.xml) specifies the complete recipe for your build what artifact type are your producing ? (the name, the version…) what are the dependencies (things you need) to produce that artifact ? What plug-ins activate at what phases in the build life cycle ? Shared Repository for storing artifacts that result from a build Convention for naming artifacts Build Life Cycle each project is typically responsible for producing a distinct artifact (a.k.a. packaging) type.jar,.war,.ear, etc. each packaging type has an associated life cycle (ordered set of build phases) Nested build project (module) structure overall driver for your build project lives at top level of a directory hierarchy sub-modules underneath the parent can be either individual components of your product …or…. key phases in your build

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Maven Nested Module Structure, Dependencies and Shared Repo mvn install Maven Repository Lives in $HOME/.m2/repostitory or /Docuemts and Settings/ /.m2/repository declares the artifact it produces to be org.example:demo:1.1 declares a a dependency on org.example:demo:1.1

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Maven pom.xml – Nested Module Structure

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Maven pom.xml – Dependency Relationships Maven Repository org.example:demo:1.1

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Hooking Maven Plug-ins Maven Into the Build Life Cycle pom.xml Build Life Cycle Phases validate generate/process-sources process-sources generate/process-resources compile test prepare-package package pre-integration-test integration-test post-integration-test verify install deploy

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Cargo A set of APIs that assists in installing web containers (such as Tomcat, JBoss) booting and shutting them down deploying web applications (.wars and.ears) Invokable via ant tasks maven plugin Java API... cargo-maven2-plugin false tomcat6x Installer installer = new URL(" installer.iZipURLInstaller(new nstall(); LocalConfiguration configuration = new DefaultConfigurationFactory().createConfiguration("tomcat6x")...) container = new DefaultContainerFactory().createContainer("tomcat6x"....); container.setHome(installer.getHome()); WAR deployable = new WAR("foo.war); deployable.setContext("ROOT"); configuration.addDeployable(deployable);

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Launching Selenium Via Ant Walk through of ant script that launches Selenium server in separate JVM, Waits for server ready, then launches Selenium tests, then waits for shut down

Copyright 2009, Build Lackey Labs (see last slide for licensing terms)

Copyright 2009, Build Lackey Labs (see last slide for licensing terms)

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Continuous Integration Dedicated box runs regular full builds (including tests) of your software Build triggers whenever any developer checks into SCM Team is notified of any failures

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Continuous Integration Benefits Replaces big (and long) integration cycles with small frequent ones. Same benefits as continous compilation in Eclipse Immediate feedback when an error is introduced. Fewer deltas between when it worked and when it broke => easier resolution of failures Lower ripple through impact when colleagues checks in broken code CI server build fails & team is notified Other developers know it is not safe to pull from source Mail sent out when build goes back to normal

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Workflow After Adopting Continous Integration CI Server: 0- Receive notification of change in SCM repo 1- Check out latest sources 2- Build from scratch 3 Build passes? yes: publish, e.g., deploy.war to QA server no: send out , flash red lights... Developer: 0- Check CI server for current build status broken ? don't update !... otherwise.. 1- check out from SCM 2- code new feature 3- run automated build on your box 4- Tests pass ? no? go back to 2 ! 5- Commit changes SCM Repo Build ok?

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Continuous Integration With Hudson Hudson orchestrates the execution of repeatable jobs periodic builds (e.g., nightly) builds that are triggered by some event (like checkin to source control) Keeps History of Past Builds (Trend Reports) Notifies When Builds Fail Written in Java and runs from a.jar (no install required) Integrates with wide range of SCM systems (SVN, P4, etc.) Supports ant, maven, shell script based builds

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Small Sample of Available Hudson Plug-ins Project Metrics Code Coverage (clover, cobertura, emma) Checkstyle Frameworks Grails (invoke grails tasks as build steps) Gradle Build Wrappers Locks and Latches - allows orchestration of multiple jobs Build Time Out

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Resources Selenium Mailing List Selenium Web Site Ant and Maven CI Tips & Tricks

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Thank You !

Copyright 2009, Build Lackey Labs (see last slide for licensing terms) Content Licensing Terms for This Work You may present, distribute, copy, or incorporate into your own work, any and all portions of this presentation as long as such copies, or derivative works are made available without charge. If you would like to redistribute this work on any type of fee-for-use or subscription basis, or if you wish incorporate any or all portions of this work into content which you charge for, please contact info buildlackey.com to discuss licensing terms.