Professional Documents
Culture Documents
Agenda
What is Selenium?
Writing Maintainable Tests
What is Selenium?
Demo
getHtmlSource
isVisible
close
getTitle
keyPress
createCookie
getValue
mouseOver
dragdrop
goBack
open
fireEvent
isElementPresent
refresh
getEval
isTextPresent
type
Element locators
selenium.click("btnG");
ID: id=foo
Name: name=foo
First ID, then name: identifier=foo
DOM: document.forms[myform].myDropdown
XPath: xpath=//table[@id='table1']//tr[4]/td[2]
Link Text: link=sometext
CSS Selector: css=a[href=#id3]
Sensible defaults, e.g. xpath if starts with //
Agenda
What is Selenium?
Writing Maintainable Tests
Functional/Acceptance/User/Compatibility
Presentation Model
Create abstractions
log("setup");
explicitly prevented
Dependencies between tests} are
Separate tests are testing separate
public units
void testFoo() {
log("foo");
every test method
Everything gets torn down after
}
browser
Constantly starting/stoppingpublic
void testBar() {
Summary