Example of using Selenium to automate Drupal configuration changes across several servers

During a recent push to a production server, I recorded a Selenium test to illustrate one of its uses, which is porting Drupal configuration changes from one server to another reliably. In this example, I use a Selenum test suite to accomplish several tasks, including:

  • Import a content type
  • Import a view
  • Install modules
  • Create a multi-paned panel page
  • Fill out several configuration forms.

This series of tests saved me a lot of time and reduced the probability of errors to virtually nothing. In the past, I would keep a list of configuration changes to port, and do them manually to push from a development server to staging, and then from staging to production. It's time-consuming and error-prone that way.

This video just shows the tests running with me narrating (rather poorly). I just wanted to actually show what was possible to whet the appetite of folks who haven't used Selenium before. I hope to add more tutorial-style videos later.

This video has been removed, but I will post a clearer one at some point. Thanks!



Comments

that was really cool
I am just starting with selenium and your video gave me so many new ideas to proceed on

thanks
sumitk
http://twitter.com/sumitk

Nice post, this certainly is a great way to automate some configuration changes across sites. :-)

We've been working on the Patterns module for automating Drupal configuration to accomplish similar tasks. The idea being that you can create an update pattern and run it locally on dev, copy your db down from live to staging and run your patterns on staging. Make sure everything is good and then run them again on live.

We've planned to have recording capability (it's not finished yet) similar to Selenium or macro.module to run through a few steps and have it spit out a pattern or set of patterns for you.

Hopefully soon we'll be able to do the same things that can be done with the Selenium method with the added benefit of the configurations being simple easy to read and update files (yaml or xml) that can live in version control and be reused.

Hi Chris,

I've watched a demo of the Patterns module at BADCamp, and have been looking forward to learning more about it. I'm really looking forward to the possibilities there. I see it replacing some of what I currently using Selenium for, but it will most likely continue to be a useful tool where a programmatic solution is to unwieldy or impractical, especially for regression testing (not demonstrated in this video). I remember asking you about the macro recording after the presentation, because it seems like that would really help bring the power of Patterns to admins as well as developers.

Thanks for piping in!

Have a look at iMacros, https://addons.mozilla.org/en-US/firefox/addon/3863

Its a great "macro recorder" Firefox addon.

very good informations realy , thanks....evden eve nakliyat

I am just starting with selenium and your video gave me so many new ideas to proceed on