Selenium Boot Camp

In true something or other style, at last nights Selenium Boot Camp the teacher was the student. We decided to hold an after hours “boot camp” so we could beef up our skills at automated testing. And while technically I was the teacher, I ended up learning just as much about doing Selenium testing as the students! Darn those hard to answer questions from professional QA people (thanks Cristen!).

So, the biggest thing we learned about was using the Web Developer plugin for FireFox. That plugin really helps simplify testing with Selenium. So, a couple tips:

  • Trying to figure out the name or ID of some content that is returned by an AJAX call? Typically doing “View Source” wont return that content! However, with the Web Developer, henceforth called WD, you can do “View Source -> View Generated Source” and see the source for your AJAX generated HTML.
  • Trying to figure out the field names and ids? Use “Forms -> Display Form Details” to see all the form element data. Much faster then digging through source.
  • However, if you are just building up a bunch of type or select lines to populate a form, then use “Forms -> Populate Form Fields” puts the names of the form elements into the fields in large text.
  • Lastly, if you want a quick summary of the form, then use “Forms -> View Form Information”. You can get information like label or max length or size and quickly write up all your form data entry actions.

We also learned how important sensible id= tags are in HTML pages. Without them you have to resort to all sorts of odd hacks and xpath queries to find what you want to click on. Unfortunantly AjaxScaffold doesnt support id= everywhere, but it was easy to add.