Automated Web Application Testing With Selenium 21750
Automated Web Application Testing With Selenium 21750
BEA Confidential. | 1
Outline
What is Selenium? Writing Maintainable Selenium Tests Writing Testable Web Applications
BEA Confidential. | 2
What is Selenium?
Open source test tool for web applications
http://selenium.openqa.org
BEA Confidential. | 3
Demo
Record a test in Selenium IDE Demo same test written in Java
BEA Confidential. | 4
BEA Confidential. | 5
BEA Confidential. | 7
Element Locators
selenium.click(____) ID: id=foo Name: name=foo Identifier (ID, then name): identifier=foo DOM: document.forms[myform].myDropdown XPath: //table[@id='table1']//tr[4]/td[2] Link Text: link=text CSS Selector: css=a[href=#id3] Default:
DOM if it starts with document. XPath if it starts with // Identifier otherwise
BEA Confidential. | 8
How It Works
BEA Confidential. | 9
Outline
What is Selenium? Writing Maintainable Selenium Tests Writing Testable Web Applications
BEA Confidential. | 10
BEA Confidential. | 11
If the UI for any one of those features changes, your search test fails
BEA Confidential. | 12
BEA Confidential. | 13
BEA Confidential. | 14
BEA Confidential. | 15
Outline
What is Selenium? Writing Maintainable Selenium Tests Writing Testable Web Applications
BEA Confidential. | 17
BEA Confidential. | 18
Use Selenium to test your view and controller (navigation) UI Testing API Testing Model Unit Testing Classes
BEA Confidential. | 19
BEA Confidential. | 20
BEA Confidential. | 21