What is Selenium?
A test tool for web applications Selenium tests run directly in the browser
Just like real users do Browser plays back testing scripts Uses JavaScript
Safari
Mac OS X
Selenium Demo
"TestRunner"mode
Static HTML, JavaScript, CSS and Test Suite deployed alongside the Application under Test (AUT) on the web server
Both the application and Selenium on the same (arbitrary) web server
Driven Mode
Leveraging a unit testing framework for functional testing Test Suite coded in Python (or another language)
Selenium Engine
Selenese Actions
select, selectAndWait
<select> widget
type, typeAndWait
<input> or <textarea>
Selenese Checks
verify that the state of the application conforms to what is expected verifyLocation, assertLocation
Location of the current page, e.g. "/Plone"
verifySelected, assertSelected
Label of the selected option of a drop-down
verifyTextPresent, assertTextPresent
Text appears somewhere on the page
Verify* checks
Record failure and continues
Element Locators
Element Locators tell Selenium which HTML element a command refers to Identifier: Find element based on the id or name attribute of the element.
example: TheElementId, TheElementName
Variables
Extending Selenium
user-extension.js.sample
contains demo code of how to write your own
Action Check Locator Strategy
Test Development #1
Testing plan
Contains all the test cases that need to be run Should describe
methodology used for testing desired results
Test Development #2
Test Development #3
Test Development #4
Test Development #5
Test Development #6
Test Development #7
Write Test
Test Development #8
Zelenium
Quick Start
Install Zelenium / ExternalEditor products Add Zuite instance Populate with File instances
content type: text/html contain the test table table
Resources:
http://www.zope.org/Members/tseaver/Zelenium
PloneSelenium #1
Ingeniweb product Lets you define tests with a simple Python Script The goal is to move it into Plone
Plone Roadmap #100 Plone Sprint after EuroPython
PloneSelenium #2
Don't necessarily want to use Unit Testing framework to do some quick tests
Import subtests from other test library by name Exports to Zelenium once the test is stable
PloneSelenium #3
Plone Selenium #4
PloneSelenium #5
Go to Selenium Configlet Add a functional test Edit the generated Python Script
Created in portal_skins/custom Contains the test boilerplate
Run the Test in development mode Register other tests in skin path
have to be named "get" + mytestname + "ftests".py
Resources
Selenium site
http://selenium.thoughtworks.com
Zelenium product
http://www.zope.org/Members/tseaver/Zelenium
PloneSelenium
http://ingeniweb.sourceforge.net/Products/PloneSeleni um/
Credits
Maik Rder
maik.roeder@ingeniweb.com
Ingeniweb
http://www.ingeniweb.com
Ingeniweb Support
support@ingeniweb.com