big-logo.png

This module integrates Drupal with the Selenium test tool.

Itegration of Selenium with simpletest. All tests can run in both Firefox and Chrome and work against simpletest sandbox.

Selenium Webdriver is completely different product then Selenium 1 RC and tests should be written manually (not recorded with Selenium IDE). However we try to keep API similar to general drupal simpletests (DrupalWebTestCase class). Our aim is to create most of the methods from DrupalWebTestCase so tests can be written similar way we write unit tests.

Selenium 2 communicates with browsers in 'native way' i.e. it is not javascript framework like in Selenium 1. This gives us possibility to do completely all actions user can do in browser. This includes upload files, drag and drop, submit forms, test all ajax javascripts, make screenshots.

We can get all properties of every dom element of the page. We can find elements using sizzle library selectors (this library is used by jQuery). Example: "div.header a.active" -- Find all links with class "active" in all div blocks with class .header.

Our aim is to implement all methods DrupalWebTestCase. So current tests can be run in Selenium instead of internal web browser.

Current functionality of Selenium module has already a lot of methods implemented including:
1. drupalLogin, drupalLogout
2. asserts: assertLink, assertTitle, assertText, assertNoText
3. verboseScreenshot -- grab screenshot
4. drupalGet, drupalPost

All other functionality can be reached using connection to Driver (class SeleniumFirefoxDriver, SeleniumChromeDriver) and using element control (class SeleniumWebElement).

Module includes tests for following core javascripts:

  • autocomplete.js
  • collapse.js
  • machine_name.js
  • states.js
  • tabledrag.js
  • tableheader.js
  • tableselect.js
  • textarea.js
  • vertical_tabs.js

Slides from presentation held on DrupalCafe Kyiv
http://www.slideshare.net/ygerasimov/automated-ui-testing-with-selenium

Related blog posts:
1. http://ygerasimov.com/integrating-selenium-to-drupal-simpletest-framework
2. http://ygerasimov.com/run-selenium-tests-drupal-on-debian-headless
3. http://ygerasimov.com/drupal-selenium-tests-api
4. http://ygerasimov.com/chrome-joins-simpletest-selenium-framework-drupal

Project Information

Downloads

Recommended releases

Version Downloads Date Links
7.x-2.0-beta2 tar.gz (26.04 KB) | zip (33.2 KB) 2011-Aug-07 Notes

Development releases

Version Downloads Date Links
7.x-2.x-dev tar.gz (26.15 KB) | zip (33.35 KB) 2011-Aug-22 Notes

Maintainers for Selenium

  • ygerasimov - 47 commits
    last: 26 weeks ago, first: 38 weeks ago
  • dolar4ik - 2 commits
    last: 37 weeks ago, first: 37 weeks ago
  • Owen Barton - 8 commits
    last: 5 years ago, first: 5 years ago

Issues for Selenium

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Oldest open issue: 10 Jun 11
nobody click here