with selenium - accueil - 11es rmll du 6 au 11 juillet 20102010.rmll.info/img/pdf/selenium.pdf-java...
TRANSCRIPT
Web Applications Testingwith Selenium
Jérémy HéraultKévin Pollet
Agenda
• The speakers
• Web applications functional testing
• The software suite
• Selenium in practice
• Selenium 2
• Q&A
Agenda
• The speakers
•• Web applications functional testing
• The software suite
• Selenium in practice
• Selenium 2
• Q&A
Kévin POLLET
• Java Engineer
• Open Source activity
- Selenium commiter
- Member of the Selenium IDE Lead
- Co-Leader and Lead developer of the Helium project
• Hobbies
- Java / Java EE Technologies
- Helium :)
Jérémy HERAULT
• Java Engineer
• In charge of functional test process automation for a business application as part of a System Information overhaul
• Open Source activity
- Selenium IDE commiter
- Member of the Selenium IDE Lead
- Lead-Mentor and Co-Mentor on the GSoC 2010
• Hobbies
- Java / Java EE Technologies
- Selenium :)
Agenda
• The speakers
• The software suite
• Selenium in practice
• Selenium 2
• Q&A
• Web applications functional testing
• Functional Test allow to
- Verify that functionalities of an application are present as needed
- Verify the non-regression of application during evolutions and fixes
• Functional Tests are long and fastidious
- Need to automate it
➥ A possible answer: Selenium
The Functional Test
Agenda
• The speakers
• Web applications functional testing
• Selenium in practice
• Selenium 2
• Q&A
• The software suite
• Open Source project
- Currently hosted on Google Code
- Created in 2005 by Jason Huggins
• Functional Test automation of web applications
- Framework used by Google (+51 000 tests/day)
- Record / Replay of test cases
Selenium ?
• It’s the core of Selenium :)
- Cross browsers: 100% JavaScript
• Allow to manipulate the DOM of the web page
- Do verifications
- Replay user actions: send DOM events
• Used by Selenium IDE and RC
Selenium Core
• Firefox extension
- Help in the text writing
- Spy the DOM events
- Replay saved test cases: use of Selenium Core
• Allow to export test cases to different formats
- Java, Groovy, Python, C#, PHP, Perl
- Exported test cases: Selenium RC Client
• Extensible
- Open a lost of possibilities !!
Selenium IDE
➥
• « User Extensions »
- locators, actions, ...
• Plugin: Enriches Selenium IDE with Firefox extension
- Use the XUL extension mechanism
- Plugins already exist or in progres:
‣ Helium
‣ FlexMonkium, SilverLight
‣ Save test cases on remote storage (SVN, WebDav, ...)
- “ Pluginification ” work: Adam Goucher
‣ Create an API
‣ Available since the version 1.0.4
Selenium IDE Extensible
• Replay server written in Java
- Driven by a client written in Java, PHP, Groovy, ...
➡ Exported from Selenium IDE for example :)
- Runs remote test cases
• Use Selenium Core + specific config. for each browser
- Example: Chrome extension for Firefox
Selenium RC (Remote Control)
Selenium RC (Remote Control)
• Allow to run test cases in parallel
- Software hub
- Manage multiple instances of Selenium RC
• Routing of the test case according to the desired platform
- Linux + Firefox
- MacOs + Safari
- ...
• Cross Platforms: Java
Selenium Grid
Selenium Grid
Agenda
• The speakers
• Web applications functional testing
• The software suite
• Selenium 2
• Q&A
• Selenium in practice
• Development side
- Need to use unique IDs for web components
- Preferred binding for Selenium RC
- Facilitates replay
• Project Owner MOA / Unit testing side
- Record test cases with Selenium IDE
- Run test cases with management tools
‣ TestLink, Selenium Bromine
Selenium in practiceSeizure of test cases
• Java EE 6 application (JSF 2.0, EJB 3.1, JPA 2.0)
• Application server: GlassFish 3.0
- Embedded server: « maven-embedded-glassfish-plugin »
- Standalone server
• Selenium RC for functional tests replay
- Use of Maven plugin: “ selenium-maven-plugin ”
- Standalone instance of Selenium RC
• Hudson for continuous integration
- Nighty build for example
Selenium in practiceEx: Continuous integration chain with Maven
• Integration of the Selenium tests in the Maven LifeCycle
Selenium in practice
package
pre-integration-test
integration-test
post-integration-test
validate
deploy
Deploy the application
Run tests with Selenium RC
Delete the application
Ex: Continuous integration chain with Maven
Agenda
• The speakers
• Web applications functional testing
• The software suite
• Selenium in practice
• Selenium 2
• Q&A
• Selenium 2
- WebDriver
- Integration with Selenium
• Allow functional testing of web applications
- Created by Simon Stewart at ThoughtWorks and now at Google
• Object view of the application « myObjet.click() »
• Light and powerful API
• Send native events
• One browser = One driver
- Closer to browser / One development per browser
Selenium 2WebDriver
• Integration of WebDriver in Selenium
- More powerful
- More faster
• Improved API (use of the WebDriver API)
- before: selenium.type != selenium.typeKeys
- now: selenium.type == selenium.typeKeys
• More native integration with the OS
• Better integration/simulation with the webapp
Selenium 2Integration with Selenium
• Curently in the 2a4 version
- even more stable
• Advanced features available soon for the mouse
• And the other projects ?
- Selenium Grid soon
- Integration in progress for Selenium IDE
Selenium 2RoadMap
[email protected]@serli.com
Thanks for your attentionAny questions ?