Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
06/21/11
What is Selenium?
Selenium Portable software testing framework for web applications Selenium Selenium Selenium Selenium IDE Client Drivers RC Grid
06/21/11
06/21/11
06/21/11
Selenium Locators
id fastest method name link dom css xpath slowest method
06/21/11
06/21/11
Selenium RC
Image: www.seleniumhq.org
06/21/11
Selenium Challenges
Web app latency can cause tests to fail waiting on page events Tests tend to lock in web pages, slowing iterative development Selenium core is JavaScript based
Not all browsers interpret the same way Can't perform cross-domain testing Testing secure connections is tricky, and often browser specific
Execution is slow (compared to most unit tests) Formatting problems are untested
06/21/11
06/21/11
10
Managing Change
Separate page content used in tests from actual test logic. Most frequently used content: Page titles Field locators (ids, names)
06/21/11
11
Selenium 2
Advantages No Selenium RC installation Disadvantages No final version released (summer 2011) Limited backwards compatibility
06/21/11
12
Speeding Up Selenium
Avoid xpath; have id attributes for all tested fields Reuse browser sessions (although this can cause subsequent tests to fail if the session fails) Test local builds to reduce network latency Avoid using multi-page test flows for atomic tests Use parameterized tests to test multiple browsers at once Parallelize tests to run multiple test classes
06/21/11
13
06/21/11
14
Image: www.saucelabs.com
06/21/11
15
06/21/11
16
Additional Resources
http://www.seleniumhq.com - selenium docs and downloads http://www.saucelabs.com - cloud-based selenium testing. http://cargo.codehaus.org - thin wrapper for java containers http://ce-games.blogger.com - links to this presentation