Comparison with webtest/g-func Comparison with Selenium IDE Test examples Running tests Browsers Page Objects Data Driving Spock/BDD
Show example suite run
Selenese not a 'real' language Sequence, Selection & Iteration (1 out of 3) No encapsulation / modularity
Selenese tests as a 'run-on sentence' divide into methods simpler modularity (no custom commands) leads into… less repetition… page object pattern Bits of coverage hide in long tests Temptation to extend tests
What is a page object? exposes methods that reflect the things the user can see and do on a page eliminate duplication by building abstractions hides the detail of how code completion tests responsible for assertions, not page object Underlying implementation can be changed
Note does not extend or mixin Selenium test classes
shows how page object hide detail of implementation Page object handles position of elements in table, test can access by name
Factory method that opens URL Navigation method that returns another page object Scrapes error messages and returns in useful form Returns element value if present (can't do in Selenese) Uses MOP to override property access to type in form fields
using monolithic data setup Build test data Fixtures tearDown
withTransaction blocks ensure data committed and errors thrown right away Importance of tearDown