Selenium:
• Test tool for web applications
• Runs in any mainstream browser
• Supports tests in many languages
• Selenese (pure HTML, no backend required)
• Java, C#, Perl, Python, Ruby
• Record/playback (Selenium IDE)
• Open Source with corporate backing
• Lives at selenium.openqa.org.
Selenium Uses:
• Use Selenium when it makes sense
• when you want to reproduce a user’s interaction with your application in a real web browser
• when you depend on the browser (AJAX)
• Do consider presentation model and HTTPUnit
• Use Selenium for Integration Testing
• Use Selenium in your development environment
• Use the features offered by your language
A few Selenese commands:
Click, Close, CreateCookie, dragdrop, fireEvent, getEval, getHtmlSource, , getTitle, getValue
goBack, isElementPresent, isTextPresent, isVisible, ,keyPress, mouseOver, open, refresh, type
The most commonly used commands for building tests:
Open: opens a page using a URL.
click/clickAndWait: performs a click operation, and optionally waits for a new page to load.
verifyTitle/assertTitle: verifies an expected page title.
verifyTextPresent: verifies expected text is somewhere on the page.
verifyElementPresent: verifies an expected UI element, as defined by its HTML tag, is present on the page.
verifyText: verifies expected text and it’s corresponding HTML tag are present on the page.
verifyTable: verifies a table’s expected contents.
waitForPageToLoad: pauses execution until an expected new page loads. Called automatically when clickAndWait is used.
waitForElementPresent: pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.