SlideShare une entreprise Scribd logo
1  sur  36
- Selenium - Browser-Based Automated Testing of Web Apps Under Continuous Integration  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
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
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],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
Manual Steps Involved In Running Selenium ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Launching Selenium
Recording New Selenium Tests
Exporting test commands to 3GL (Java, etc.)
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
Selenium Components ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Selenium Client Side Library & Server In Action HTTP Selenium-server.jar Source: http://seleniumhq.org/docs/05_selenium_rc.html 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)
A Look Same Origin Policy (Which Selenium’s 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
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-Core’s 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
Functional Test Alternatives: Canoo vs Selenium ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Canoo Web Test Reports Canoo's reports show overall test results and let you drill down into any test
Canoo Web Test Reports (cont.) Click to review a copy of the response HTML page corresponding to the first test step that failed
Gluing together the steps in your build process ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
deploy Compile Unit Test  Integration Test Package .war file Download And Install Tomcat
Structure of our demo project mvn install Maven Repository Lives in $HOME/.m2/repostitory or  /Docuemts and Settings/<user>/.m2/repository declares the artifact it produces to be  org.example:demo:1.1 declares a a dependency on org.example:demo:1.1 org.example:demo:1.1
Demo All Tests Pass Some Tests Fail
Maven Basics ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Maven Nested Module Structure, Dependencies and Shared Repo mvn install Maven Repository Lives in $HOME/.m2/repostitory or  /Docuemts and Settings/<user>/.m2/repository declares the artifact it produces to be  org.example:demo:1.1 declares a a dependency on org.example:demo:1.1 org.example:demo:1.1
Maven pom.xml – Nested Module Structure
Maven pom.xml – Dependency Relationships Maven Repository org.example:demo:1.1
Hooking Maven Plug-ins Maven Into the Build Life Cycle  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 pom.xml
Cargo  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],<target name=&quot;functional-test&quot; > <cargo containerId=&quot;tomcat6x&quot; action=&quot;start&quot;  …  > <zipurlinstaller installurl=&quot;http://somewhere/tomcat-6.0.zip&quot;/> <configuration type=&quot;standalone&quot; home=&quot;${tomcatdir}&quot;> <deployable type=&quot;war&quot; file=&quot;foo.war&quot;/> </configuration> </cargo> <plugin> ... <artifactId>cargo-maven2-plugin</artifactId> <config> <wait>false</wait> <container> <containerId>tomcat6x</containerId> <zipUrlInstaller> <url>http://somewhere/tomcat-6.0.zip</url> ... Installer installer =  new URL(&quot;http://somewhere/tomcat-6.0.zip&quot;)); installer.iZipURLInstaller(new nstall(); LocalConfiguration configuration =  new DefaultConfigurationFactory().createConfiguration(&quot;tomcat6x&quot;)...) container = new DefaultContainerFactory() .createContainer(&quot;tomcat6x&quot;....); container.setHome(installer.getHome()); WAR deployable = new WAR(&quot;foo.war);  deployable.setContext(&quot;ROOT&quot;); configuration.addDeployable(deployable);
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
 
 
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
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
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 email, 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 broken ! Build ok?
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
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
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank You  !
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 <at> buildlackey.com to discuss licensing terms.

Contenu connexe

Tendances

CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesJesse Gallagher
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ CodeceptionTudor Barbu
 
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)Dave Haeffner
 
Testing Java EE apps with Arquillian
Testing Java EE apps with ArquillianTesting Java EE apps with Arquillian
Testing Java EE apps with ArquillianIvan Ivanov
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with CodeceptionJeremy Coates
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScriptSimon Guest
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentMax Klymyshyn
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumBrian Jordan
 
Selenium webdriver interview questions and answers
Selenium webdriver interview questions and answersSelenium webdriver interview questions and answers
Selenium webdriver interview questions and answersITeLearn
 
Test automation with php codeception
Test automation with php codeceptionTest automation with php codeception
Test automation with php codeceptionbuddhieash
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Adam Štipák
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: DemystifiedSeth McLaughlin
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to ProtractorFlorian Fesseler
 
Selenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI TestingSelenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI Testingmikereedell
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools OverviewSachin-QA
 

Tendances (20)

CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPages
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ Codeception
 
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)
 
Testing Java EE apps with Arquillian
Testing Java EE apps with ArquillianTesting Java EE apps with Arquillian
Testing Java EE apps with Arquillian
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
 
Testing with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous DeploymentTesting with Jenkins, Selenium and Continuous Deployment
Testing with Jenkins, Selenium and Continuous Deployment
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
 
Selenium webdriver interview questions and answers
Selenium webdriver interview questions and answersSelenium webdriver interview questions and answers
Selenium webdriver interview questions and answers
 
Test automation with php codeception
Test automation with php codeceptionTest automation with php codeception
Test automation with php codeception
 
Selenium Training in Chennai
Selenium Training in ChennaiSelenium Training in Chennai
Selenium Training in Chennai
 
Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)Testing with Codeception (Webelement #30)
Testing with Codeception (Webelement #30)
 
Front-End Testing: Demystified
Front-End Testing: DemystifiedFront-End Testing: Demystified
Front-End Testing: Demystified
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Selenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI TestingSelenium2 and Jenkins: Almost pain-free UI Testing
Selenium2 and Jenkins: Almost pain-free UI Testing
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
 
Automation Tools Overview
Automation Tools OverviewAutomation Tools Overview
Automation Tools Overview
 
Apache Maven In 10 Slides
Apache Maven In 10 SlidesApache Maven In 10 Slides
Apache Maven In 10 Slides
 
Maven Overview
Maven OverviewMaven Overview
Maven Overview
 

Similaire à Testing Java Web Apps With Selenium

Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Appschrisb206 chrisb206
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With SeleniumJodie Miners
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudCarlos Sanchez
 
Selenium Testing with TestingBot.com
Selenium Testing with TestingBot.comSelenium Testing with TestingBot.com
Selenium Testing with TestingBot.comtestingbot
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Puneet Kala
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance TestingAlan Hecht
 
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 Haitham Refaat
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfMinh Quân Đoàn
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
 
Steps to write Selenium
Steps to write Selenium  Steps to write Selenium
Steps to write Selenium Rohit Thakur
 

Similaire à Testing Java Web Apps With Selenium (20)

Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Sel
SelSel
Sel
 
Selenium
SeleniumSelenium
Selenium
 
Qa process
Qa processQa process
Qa process
 
Qa process
Qa processQa process
Qa process
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Enterprise Build And Test In The Cloud
Enterprise Build And Test In The CloudEnterprise Build And Test In The Cloud
Enterprise Build And Test In The Cloud
 
Selenium Testing with TestingBot.com
Selenium Testing with TestingBot.comSelenium Testing with TestingBot.com
Selenium Testing with TestingBot.com
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
 
Integration and Acceptance Testing
Integration and Acceptance TestingIntegration and Acceptance Testing
Integration and Acceptance Testing
 
Codeception
CodeceptionCodeception
Codeception
 
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
 
Selenium Testing
Selenium Testing Selenium Testing
Selenium Testing
 
Testing In Java
Testing In JavaTesting In Java
Testing In Java
 
Testing In Java4278
Testing In Java4278Testing In Java4278
Testing In Java4278
 
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdfLesson_06_Software_and_Automation_Testing_Frameworks.pdf
Lesson_06_Software_and_Automation_Testing_Frameworks.pdf
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
Steps to write Selenium
Steps to write Selenium  Steps to write Selenium
Steps to write Selenium
 

Plus de Marakana Inc.

Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaMarakana Inc.
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven DevelopmentMarakana Inc.
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMarakana Inc.
 
Why Java Needs Hierarchical Data
Why Java Needs Hierarchical DataWhy Java Needs Hierarchical Data
Why Java Needs Hierarchical DataMarakana Inc.
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android SecurityMarakana Inc.
 
Pictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User GroupPictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User GroupMarakana Inc.
 
Android UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesAndroid UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesMarakana Inc.
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6Marakana Inc.
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Marakana Inc.
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Marakana Inc.
 
What's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovationWhat's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovationMarakana Inc.
 
jQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda KatzjQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda KatzMarakana Inc.
 
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...Marakana Inc.
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldMarakana Inc.
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldMarakana Inc.
 
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas EneboLearn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas EneboMarakana Inc.
 
Replacing Java Incrementally
Replacing Java IncrementallyReplacing Java Incrementally
Replacing Java IncrementallyMarakana Inc.
 
Learn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache BuildrLearn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache BuildrMarakana Inc.
 

Plus de Marakana Inc. (20)

Android Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar GargentaAndroid Services Black Magic by Aleksandar Gargenta
Android Services Black Magic by Aleksandar Gargenta
 
JRuby at Square
JRuby at SquareJRuby at Square
JRuby at Square
 
Behavior Driven Development
Behavior Driven DevelopmentBehavior Driven Development
Behavior Driven Development
 
Martin Odersky: What's next for Scala
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
 
Why Java Needs Hierarchical Data
Why Java Needs Hierarchical DataWhy Java Needs Hierarchical Data
Why Java Needs Hierarchical Data
 
Deep Dive Into Android Security
Deep Dive Into Android SecurityDeep Dive Into Android Security
Deep Dive Into Android Security
 
Securing Android
Securing AndroidSecuring Android
Securing Android
 
Pictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User GroupPictures from "Learn about RenderScript" meetup at SF Android User Group
Pictures from "Learn about RenderScript" meetup at SF Android User Group
 
Android UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesAndroid UI Tips, Tricks and Techniques
Android UI Tips, Tricks and Techniques
 
2010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-62010 07-18.wa.rails tdd-6
2010 07-18.wa.rails tdd-6
 
Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6Efficient Rails Test-Driven Development - Week 6
Efficient Rails Test-Driven Development - Week 6
 
Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)Graphicsand animations devoxx2010 (1)
Graphicsand animations devoxx2010 (1)
 
What's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovationWhat's this jQuery? Where it came from, and how it will drive innovation
What's this jQuery? Where it came from, and how it will drive innovation
 
jQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda KatzjQuery State of the Union - Yehuda Katz
jQuery State of the Union - Yehuda Katz
 
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
Pics from: "James Gosling on Apple, Apache, Google, Oracle and the Future of ...
 
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram ArnoldEfficient Rails Test Driven Development (class 4) by Wolfram Arnold
Efficient Rails Test Driven Development (class 4) by Wolfram Arnold
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
 
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas EneboLearn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
Learn about JRuby Internals from one of the JRuby Lead Developers, Thomas Enebo
 
Replacing Java Incrementally
Replacing Java IncrementallyReplacing Java Incrementally
Replacing Java Incrementally
 
Learn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache BuildrLearn to Build like you Code with Apache Buildr
Learn to Build like you Code with Apache Buildr
 

Dernier

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 

Dernier (20)

SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

Testing Java Web Apps With Selenium

  • 1.
  • 2. 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
  • 3.
  • 4.
  • 7. Exporting test commands to 3GL (Java, etc.)
  • 8. 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
  • 9.
  • 10. Selenium Client Side Library & Server In Action HTTP Selenium-server.jar Source: http://seleniumhq.org/docs/05_selenium_rc.html 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)
  • 11. A Look Same Origin Policy (Which Selenium’s 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
  • 12. 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-Core’s 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
  • 13.
  • 14. Canoo Web Test Reports Canoo's reports show overall test results and let you drill down into any test
  • 15. Canoo Web Test Reports (cont.) Click to review a copy of the response HTML page corresponding to the first test step that failed
  • 16.
  • 17. deploy Compile Unit Test Integration Test Package .war file Download And Install Tomcat
  • 18. Structure of our demo project mvn install Maven Repository Lives in $HOME/.m2/repostitory or /Docuemts and Settings/<user>/.m2/repository declares the artifact it produces to be org.example:demo:1.1 declares a a dependency on org.example:demo:1.1 org.example:demo:1.1
  • 19. Demo All Tests Pass Some Tests Fail
  • 20.
  • 21. Maven Nested Module Structure, Dependencies and Shared Repo mvn install Maven Repository Lives in $HOME/.m2/repostitory or /Docuemts and Settings/<user>/.m2/repository declares the artifact it produces to be org.example:demo:1.1 declares a a dependency on org.example:demo:1.1 org.example:demo:1.1
  • 22. Maven pom.xml – Nested Module Structure
  • 23. Maven pom.xml – Dependency Relationships Maven Repository org.example:demo:1.1
  • 24. Hooking Maven Plug-ins Maven Into the Build Life Cycle 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 pom.xml
  • 25.
  • 26. 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
  • 27.  
  • 28.  
  • 29. 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
  • 30. 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
  • 31. 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 email, 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 broken ! Build ok?
  • 32. 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
  • 33. 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
  • 34.
  • 36. 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 <at> buildlackey.com to discuss licensing terms.