Transcript gojko.net

Testing Web Applications with
Selenium & Selenium Remote
Control
Gojko Adzic
[email protected]
http://gojko.net
Why should you care?
Automate Web user interface tests
 Verify functionality in different
browsers on different platforms
 Check periodically to see if the site
is on-line and works correctly

Selenium in a nut-shell
Javascript functional test runner
 Started by Jason Huggins, Paul
Gross and Jie Tina Wang, in 2004.
 Opensource product
 Actively developed and maintained
by Thoughtworks
 Download from OpenQA.org

Selenese – the language of Selenium
Lots of different commands to manipulate DOM
elements and verify text, DOM or timing
 Locate elements by name, id, xpath...
 Tests are described as tables

Selenium - Core
http://selenium.openqa.org/
Selenium - IDE

Firefox extension

Record-replay

Command reference

save/export/load tests
http://selenium-ide.openqa.org
Selenium-RC



Automate Selenium
tests from
Java/.NET/Ruby etc
Execute in multiple
browsers, on remote
machines
Integrate into wider
business tests and CI
tools
http://selenium-rc.openqa.org
Selenium Grid



Run tests on multiple
machines in parallel
Solves the biggest
problem with
Selenium, speed
Supports EC2
http://selenium-grid.openqa.org
CubicTest



http://www.cubictest.com
Visual test
management
Eclipse-based
Mocking up web
sites based on
test scripts
StoryTestIQ




http://storytestiq.solutionsiq.com/
Wiki-based
Mashup of
Selenium and
FitNesse
Run SQL
commands
Integrate with
CI tools
WebTest fixtures



http://www.fitnesse.info/webtest
FitNesse fixtures for
Selenium
User-friendly
language or direct
selenium RC
access
Integrate Selenium
in your business
tests
Domain specific testing language
Agile 2008 presentation from Solutions IQ
What's good?

Relatively easy to automate web UI tests

Record/Replay for regression tests

RC allows integration with CI and
JUnit/FitNesse tests
What's bad?



Speed: RC->Browser communication is a
speed bottleneck (run in grid, overnight)
UI is brittle, tests depending on the UI break a
lot (DSTL might fix this, page abstractions as
well)
Data-backed tests are not easily repeatable
(integrate with DB test engines)
Best practices

Use Selenium to verify workflow and session

Don't use it to check business rules



Don't put Selenium tests in your main
development build – run them overnight
Have dedicated machines that run tests
DON'T THINK OF THIS AS A REPLACEMENT
FOR EXPLORATORY TESTING!!!
Although selenium is an
essential trace element, it is
toxic if taken in excess.
Wikipedia on chemical element Selenium
Links

http://gojko.net

http://www.openqa.org

http://www.solutionsiq.com/agile2008/agile-2008-domain.php

http://storytestiq.solutionsiq.com

http://www.cubictest.com

http://fitnesse.info/webtest
Some important dates





18th September: Agile Acceptance Testing
25th September: Script #, .NET response to
Google Web Toolkit
23rd October: Dependency injection with Castle
Windsor
27th November: Asynchronous enterprise .NET
applications with NServiceBus
17th December: Test driven development in
.NET